r17354 by fschmid - IDML Importer: fixed loading of images with percent encoded filenames.
scribus-commit
scribus-commit at lists.scribus.net
Sun Mar 4 17:43:42 UTC 2012
Author: fschmid
Date: Sun Mar 4 17:43:42 2012
New Revision: 17354
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17354
Log:
IDML Importer: fixed loading of images with percent encoded filenames.
Modified:
trunk/Scribus/scribus/plugins/import/idml/importidml.cpp
Modified: trunk/Scribus/scribus/plugins/import/idml/importidml.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17354&path=/trunk/Scribus/scribus/plugins/import/idml/importidml.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/idml/importidml.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/idml/importidml.cpp Sun Mar 4 17:43:42 2012
@@ -2272,6 +2272,8 @@
imgExt = "png";
else if (imageType.contains("PSD", Qt::CaseInsensitive))
imgExt = "psd";
+ else if (imageType.contains("Photoshop", Qt::CaseInsensitive))
+ imgExt = "psd";
else if (imageType.contains("TIFF", Qt::CaseInsensitive))
imgExt = "tif";
item->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_idml_XXXXXX." + imgExt);
@@ -2295,15 +2297,16 @@
else
{
QUrl url = QUrl(imageFileName);
- QFileInfo fi(url.toLocalFile());
- QString fileName;
+ QString fiNam = url.toLocalFile();
+ QFileInfo fi(fiNam);
+ QByteArray fileName;
if (fi.exists())
- fileName = url.toLocalFile();
+ fileName = url.toLocalFile().toLocal8Bit();
else
- fileName = fi.fileName();
+ fileName = fi.fileName().toLocal8Bit();
item->ScaleType = true;
item->AspectRatio = true;
- m_Doc->loadPict(fileName, item);
+ m_Doc->loadPict(QUrl::fromPercentEncoding(fileName), item);
item->setImageXYScale(scXi / item->pixm.imgInfo.xres * 72, scYi / item->pixm.imgInfo.xres * 72);
item->setImageXYOffset((dxi - grOffset.x()) / item->imageXScale(), (dyi - grOffset.y()) / item->imageYScale());
item->setImageRotation(0);
More information about the scribus-commit
mailing list