r20720 by jghali -
scribus-commit
scribus-commit at lists.scribus.net
Mon Jan 25 20:36:25 UTC 2016
Author: jghali
Date: Mon Jan 25 20:36:25 2016
New Revision: 20720
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20720
Log:
#13684: Import failure with jpeg files whose path contains chars not supported by current codepage on Windows
Modified:
trunk/Scribus/scribus/imagedataloaders/scimgdataloader_jpeg.cpp
trunk/Scribus/scribus/imagedataloaders/scimgdataloader_ps.cpp
Modified: trunk/Scribus/scribus/imagedataloaders/scimgdataloader_jpeg.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20720&path=/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_jpeg.cpp
==============================================================================
--- trunk/Scribus/scribus/imagedataloaders/scimgdataloader_jpeg.cpp (original)
+++ trunk/Scribus/scribus/imagedataloaders/scimgdataloader_jpeg.cpp Mon Jan 25 20:36:25 2016
@@ -66,8 +66,13 @@
return;
}
jpeg_create_decompress (&cinfo);
+#if defined(Q_OS_WIN32)
+ if ((infile = _wfopen((const wchar_t*) fn.utf16(), L"rb")) == NULL)
+ return;
+#else
if ((infile = fopen (fn.toLocal8Bit(), "rb")) == NULL)
return;
+#endif
jpeg_stdio_src(&cinfo, infile);
jpeg_save_markers(&cinfo, ICC_MARKER, 0xFFFF);
jpeg_read_header(&cinfo, true);
@@ -129,8 +134,13 @@
return false;
}
jpeg_create_decompress (&cinfo);
+#if defined(Q_OS_WIN32)
+ if ((infile = _wfopen((const wchar_t*) fn.utf16(), L"rb")) == NULL)
+ return false;
+#else
if ((infile = fopen (fn.toLocal8Bit(), "rb")) == NULL)
return false;
+#endif
jpeg_stdio_src(&cinfo, infile);
jpeg_save_markers(&cinfo, ICC_MARKER, 0xFFFF);
jpeg_save_markers(&cinfo, PHOTOSHOP_MARKER, 0xFFFF);
Modified: trunk/Scribus/scribus/imagedataloaders/scimgdataloader_ps.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20720&path=/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_ps.cpp
==============================================================================
--- trunk/Scribus/scribus/imagedataloaders/scimgdataloader_ps.cpp (original)
+++ trunk/Scribus/scribus/imagedataloaders/scimgdataloader_ps.cpp Mon Jan 25 20:36:25 2016
@@ -933,8 +933,13 @@
return false;
}
jpeg_create_decompress (&cinfo);
+#if defined(Q_OS_WIN32)
+ if ((infile = _wfopen((const wchar_t*) fn.utf16(), L"rb")) == NULL)
+ return false;
+#else
if ((infile = fopen (fn.toLocal8Bit(), "rb")) == NULL)
return false;
+#endif
jpeg_stdio_src(&cinfo, infile);
jpeg_read_header(&cinfo, true);
jpeg_start_decompress(&cinfo);
@@ -1053,8 +1058,13 @@
return false;
}
jpeg_create_decompress (&cinfo);
+#if defined(Q_OS_WIN32)
+ if ((infile = _wfopen((const wchar_t*) fn.utf16(), L"rb")) == NULL)
+ return false;
+#else
if ((infile = fopen (fn.toLocal8Bit(), "rb")) == NULL)
return false;
+#endif
jpeg_stdio_src(&cinfo, infile);
jpeg_read_header(&cinfo, true);
jpeg_start_decompress(&cinfo);
More information about the scribus-commit
mailing list