[poppler] cpp/poppler-image.cpp

Pino Toscano pino at kemper.freedesktop.org
Wed Dec 29 06:58:52 PST 2010


 cpp/poppler-image.cpp |   12 ++++++++++++
 1 file changed, 12 insertions(+)

New commits:
commit 1399b9ab14b19f25583c75af2b36f63a6a01129a
Author: Pino Toscano <pino at kde.org>
Date:   Wed Dec 29 15:56:45 2010 +0100

    [cpp] add TIFF output to 'image'

diff --git a/cpp/poppler-image.cpp b/cpp/poppler-image.cpp
index ef50611..ef213a5 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;
 }
 


More information about the poppler mailing list