aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/sls.cpp12
-rw-r--r--src/sls.h2
2 files changed, 8 insertions, 6 deletions
diff --git a/src/sls.cpp b/src/sls.cpp
index f6cfb6f..4477af7 100644
--- a/src/sls.cpp
+++ b/src/sls.cpp
@@ -261,9 +261,11 @@ const int SLSEncoder::APPTYPE_MOT_CONT = 13;
const std::string SLSEncoder::REQUEST_REREAD_FILENAME = "REQUEST_SLIDES_DIR_REREAD";
-void SLSEncoder::warnOnSmallerImage(size_t height, size_t width, const std::string& fname) {
- if (height < 240 || width < 320)
- fprintf(stderr, "ODR-PadEnc Warning: Image '%s' smaller than recommended size (%zu x %zu < 320 x 240 px)\n", fname.c_str(), width, height);
+void SLSEncoder::warnOnSmallerImage(size_t height, size_t width, const std::string& fname, bool resized) {
+ if (height < 240 || width < 320) {
+ fprintf(stderr, "ODR-PadEnc Warning: %s '%s' smaller than recommended size (%zu x %zu < 320 x 240 px)\n",
+ resized ? "Resized image" : "Image", fname.c_str(), width, height);
+ }
}
@@ -345,7 +347,7 @@ size_t SLSEncoder::resizeImage(MagickWand* m_wand, unsigned char** blob, const s
}
// warn if resized image smaller than default dimension
- warnOnSmallerImage(height, width, fname);
+ warnOnSmallerImage(height, width, fname, true);
MagickRelinquishMemory(*jfif_not_png ? blob_png : blob_jpg);
*blob = *jfif_not_png ? blob_jpg : blob_png;
@@ -485,7 +487,7 @@ bool SLSEncoder::encodeSlide(const std::string& fname, int fidx, bool raw_slides
blobsize = resizeImage(m_wand, &magick_blob, fname, &jfif_not_png, max_slide_size);
} else {
// warn if unresized image smaller than default dimension
- warnOnSmallerImage(height, width, fname);
+ warnOnSmallerImage(height, width, fname, false);
}
#else
diff --git a/src/sls.h b/src/sls.h
index dbbcf3c..4e25fee 100644
--- a/src/sls.h
+++ b/src/sls.h
@@ -227,7 +227,7 @@ private:
static const int MINQUALITY;
static const std::string SLS_PARAMS_SUFFIX;
- void warnOnSmallerImage(size_t height, size_t width, const std::string& fname);
+ void warnOnSmallerImage(size_t height, size_t width, const std::string& fname, bool resized);
#if HAVE_MAGICKWAND
size_t resizeImage(MagickWand* m_wand, unsigned char** blob, const std::string& fname, bool* jfif_not_png, size_t max_slide_size);
#endif