summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpp/poppler-image.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/cpp/poppler-image.cpp b/cpp/poppler-image.cpp
index ef506118..ef213a5c 100644
--- a/cpp/poppler-image.cpp
+++ b/cpp/poppler-image.cpp
@@ -28,6 +28,9 @@
#if defined(ENABLE_LIBJPEG)
#include "JpegWriter.h"
#endif
+#if defined(ENABLE_LIBTIFF)
+#include "TiffWriter.h"
+#endif
#include <cstdlib>
#include <cstring>
@@ -310,6 +313,7 @@ image image::copy(const rect &r) const
Image formats commonly supported are:
\li PNG: \c png
\li JPEG: \c jpeg, \c jpg
+ \li TIFF: \c tiff
If an image format is not supported (check the result of
supported_image_formats()), the saving fails.
@@ -339,6 +343,11 @@ bool image::save(const std::string &file_name, const std::string &out_format, in
w.reset(new JpegWriter());
}
#endif
+#if defined(ENABLE_LIBTIFF)
+ else if (fmt == "tiff") {
+ w.reset(new TiffWriter());
+ }
+#endif
if (!w.get()) {
return false;
}
@@ -406,6 +415,9 @@ std::vector<std::string> image::supported_image_formats()
formats.push_back("jpeg");
formats.push_back("jpg");
#endif
+#if defined(ENABLE_LIBTIFF)
+ formats.push_back("tiff");
+#endif
return formats;
}