r19857 by fschmid - Check embedded .wmf files in .odg File for being .emf files.

scribus-commit scribus-commit at lists.scribus.net
Sun Feb 22 22:02:35 UTC 2015


Author: fschmid
Date: Sun Feb 22 22:02:34 2015
New Revision: 19857

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19857
Log:
Check embedded .wmf files in .odg File for being .emf files.

Modified:
    trunk/Scribus/scribus/plugins/import/odg/importodg.cpp

Modified: trunk/Scribus/scribus/plugins/import/odg/importodg.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19857&path=/trunk/Scribus/scribus/plugins/import/odg/importodg.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/odg/importodg.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/odg/importodg.cpp Sun Feb 22 22:02:34 2015
@@ -1586,7 +1586,13 @@
 					if (uz->read(imagePath, f))
 					{
 						QFileInfo fi(imagePath);
-						QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_odg_XXXXXX." + fi.suffix());
+						QString ext = fi.suffix();
+						if (ext == "wmf")
+						{
+							if ((f[0] == '\x01') && (f[1] == '\x00') && (f[2] == '\x00') && (f[3] == '\x00') && (f[40] == '\x20') && (f[41] == '\x45') && (f[42] == '\x4D') && (f[43] == '\x46'))
+								ext = "emf";
+						}
+						QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_odg_XXXXXX." + ext);
 						if (tempFile->open())
 						{
 							QString fileName = getLongPathName(tempFile->fileName());




More information about the scribus-commit mailing list