[poppler] goo/TiffWriter.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Tue Mar 11 13:25:43 PDT 2014


 goo/TiffWriter.cc |   11 +++++++++++
 1 file changed, 11 insertions(+)

New commits:
commit e24cbeae22d6c8630e292897bd982a87e6290ca6
Author: Steven Lee <roc.sky at gmail.com>
Date:   Tue Mar 11 21:24:59 2014 +0100

    Fix TIFF writting in Windows
    
    Bug #75969

diff --git a/goo/TiffWriter.cc b/goo/TiffWriter.cc
index d372a5b..3160087 100644
--- a/goo/TiffWriter.cc
+++ b/goo/TiffWriter.cc
@@ -8,6 +8,7 @@
 // Copyright (C) 2012 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2012 Adrian Johnson <ajohnson at redneon.com>
 // Copyright (C) 2012 Pino Toscano <pino at kde.org>
+// Copyright (C) 2014 Steven Lee <roc.sky at gmail.com>
 //
 //========================================================================
 
@@ -17,6 +18,10 @@
 
 #include <string.h>
 
+#ifdef _WIN32
+#include <io.h>
+#endif
+
 extern "C" {
 #include <tiffio.h>
 }
@@ -151,7 +156,13 @@ bool TiffWriter::init(FILE *openedFile, int width, int height, int hDPI, int vDP
     return false;
   }
 
+#ifdef _WIN32
+  //Convert C Library handle to Win32 Handle
+  priv->f = TIFFFdOpen(_get_osfhandle(fileno(openedFile)), "-", "w");
+#else
   priv->f = TIFFFdOpen(fileno(openedFile), "-", "w");
+#endif
+
 
   if (!priv->f) {
     return false;


More information about the poppler mailing list