r20719 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Mon Jan 25 20:35:53 UTC 2016


Author: jghali
Date: Mon Jan 25 20:35:53 2016
New Revision: 20719

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20719
Log:
#13684: Import failure with jpeg files whose path contains chars not supported by current codepage on Windows

Modified:
    branches/Version14x/Scribus/scribus/scimgdataloader_jpeg.cpp
    branches/Version14x/Scribus/scribus/scimgdataloader_ps.cpp

Modified: branches/Version14x/Scribus/scribus/scimgdataloader_jpeg.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20719&path=/branches/Version14x/Scribus/scribus/scimgdataloader_jpeg.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/scimgdataloader_jpeg.cpp	(original)
+++ branches/Version14x/Scribus/scribus/scimgdataloader_jpeg.cpp	Mon Jan 25 20:35:53 2016
@@ -65,8 +65,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);
@@ -126,8 +131,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: branches/Version14x/Scribus/scribus/scimgdataloader_ps.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20719&path=/branches/Version14x/Scribus/scribus/scimgdataloader_ps.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/scimgdataloader_ps.cpp	(original)
+++ branches/Version14x/Scribus/scribus/scimgdataloader_ps.cpp	Mon Jan 25 20:35:53 2016
@@ -915,8 +915,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);
@@ -1032,8 +1037,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