View Issue Details

IDProjectCategoryView StatusLast Update
0017690ScribusImport / Exportpublic2025-11-20 14:07
ReporterRalph Assigned To 
PrioritylowSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformPCOSOpenSuse TumbleweedOS VersionOpenSuse Tumblew
Product Version1.7.1.svn 
Summary0017690: PDF not loaded as image in case of files path with parents
DescriptionPDFs with valid, but strange file pathes, that include multiple parents (..) at the beginning of the path (like PFILE="../../../../../../../home/rtmp/Wk/MfD/mfd/Input/Ads/Annette_Suess_2915594-A.pdf"), are not loaded.

Analysis reveals that gs causes the problem (but it worked for years before - not sure what changed).
To make scribus more robust, I propose to add the attached patch.
Additional Information- It is not clear to me why the path is so strange
- It worked with various scribus versions before
- The path is vaild !!
- I tracked down that the path
                   ../../../../../../../home/rtmp/Wk/MfD/mfd/Input/Ads/Annette_Suess_2915594-A.pdf
  get reduced by scribus to
                   /../../home/rtmp/Wk/MfD/mfd/Input/Ads/Annette_Suess_2915594-A.pdf
  which is still a valid path, and passed to gs, but gs returns an error.
- Please follow the shell session:
1. Show files are existing pdfs
~/Wk/MfD/mfd> file ../../../../../../../home/rtmp/Wk/MfD/mfd/Input/Ads/Annette_Suess_2915594-A.pdf ; file /../../home/rtmp/Wk/MfD/mfd/Input/Ads/Annette_Suess_2915594-A.pdf
../../../../../../../home/rtmp/Wk/MfD/mfd/Input/Ads/Annette_Suess_2915594-A.pdf: PDF document, version 1.3, 1 page(s)
/../../home/rtmp/Wk/MfD/mfd/Input/Ads/Annette_Suess_2915594-A.pdf: PDF document, version 1.3, 1 page(s)

2. Call gs with original path - no error
~/Wk/MfD/mfd> gs -dQUIET -dNOPAUSE -dPARANOIDSAFER -dBATCH -sDEVICE=pngalpha -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r72 -sOutputFile=/home/rtmp/.local/share/scribus/temp/sc.png -dFirstPage=1 -dLastPage=1 -dUseArtBox ../../../../../../../home/rtmp/Wk/MfD/mfd/Input/Ads/Annette_Suess_2915594-A.pdf -c showpage || echo Error

3. Call gs with the arguments as scribus is calling gs:
~/Wk/MfD/mfd> gs -dQUIET -dNOPAUSE -dPARANOIDSAFER -dBATCH -sDEVICE=pngalpha -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r72 -sOutputFile=/home/rtmp/.local/share/scribus/temp/sc.png -dFirstPage=1 -dLastPage=1 -dUseArtBox /../../home/rtmp/Wk/MfD/mfd/Input/Ads/Annette_Suess_2915594-A.pdf -c showpage || echo Error
Error
TagsNo tags attached.
Attached Files
gs-resolve-filename.patch (581 bytes)   
Index: scribus/imagedataloaders/scimgdataloader_pdf.cpp
===================================================================
--- scribus/imagedataloaders/scimgdataloader_pdf.cpp	(Revision 27092)
+++ scribus/imagedataloaders/scimgdataloader_pdf.cpp	(Arbeitskopie)
@@ -42,7 +42,7 @@
 	if (!QFile::exists(fn))
 		return false;
 	QString tmpFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + "sc.png");
-	QString picFile = QDir::toNativeSeparators(fn);
+	QString picFile = QDir::toNativeSeparators(QFileInfo(fn).canonicalFilePath());
 	float xres = gsRes;
 	float yres = gsRes;
 
gs-resolve-filename.patch (581 bytes)   
PatchYes

Activities

Issue History

Date Modified Username Field Change
2025-11-20 14:07 Ralph New Issue
2025-11-20 14:07 Ralph File Added: gs-resolve-filename.patch