diff options
author | Steven Lee <roc.sky@gmail.com> | 2014-03-11 21:24:59 +0100 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2014-03-11 21:25:21 +0100 |
commit | e24cbeae22d6c8630e292897bd982a87e6290ca6 (patch) | |
tree | 7c2189330551efdaa71ac7426256dc8d5421e72d /goo | |
parent | b984a3b5946ebcd736e0583a10eb614cede3388a (diff) |
Fix TIFF writting in Windows
Bug #75969
Diffstat (limited to 'goo')
-rw-r--r-- | goo/TiffWriter.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/goo/TiffWriter.cc b/goo/TiffWriter.cc index d372a5bd..31600877 100644 --- a/goo/TiffWriter.cc +++ b/goo/TiffWriter.cc @@ -8,6 +8,7 @@ // Copyright (C) 2012 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2012 Adrian Johnson <ajohnson@redneon.com> // Copyright (C) 2012 Pino Toscano <pino@kde.org> +// Copyright (C) 2014 Steven Lee <roc.sky@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; |