View Issue Details

IDProjectCategoryView StatusLast Update
0016272ScribusScripterpublic2020-10-17 13:56
Reportersreerajp Assigned Tojghali  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionunable to reproduce 
PlatformWindowsOS10OS Version1909
Product Version1.5.6.svn 
Summary0016272: While running ImageExport() python script error is coming if Filename or path has space in it
DescriptionWhile running ImageExport() python script error is coming if Filename or path has space in it
TagsNo tags attached.
PatchNo

Activities

jghali

2020-10-17 10:33

administrator   ~0048174

Unable to reproduce. Works here.

sreerajp

2020-10-17 11:15

reporter   ~0048175

Script
import scribus
import os
import sys
if (len(sys.argv) > 1):

    if haveDoc():
        
        pageImagePreview = scribus.ImageExport()
        pageImagePreview.type = "JPG"
        pageImagePreview.scale = 90
        pageImagePreview.quality = 90
        pageImagePreviewName = (os.path.split(scribus.getDocName())[1]).split(".")[0]
        pageImagePreview.name = "{}\S_{}.jpg".format(sys.argv[2],pageImagePreviewName)
        pageImagePreview.dpi = 150
        pageImagePreview.save()
    
        pageImageThumb = scribus.ImageExport()
        pageImageThumb.type = "JPG"
        pageImageThumb.scale = 6
        pageImageThumb.quality = 100
        pageImageThumbName = (os.path.split(scribus.getDocName())[1]).split(".")[0]
        pageImageThumb.name = "{}\S_{}.jpg".format(sys.argv[4],pageImageThumbName)
        pageImageThumb.dpi = 150
        pageImageThumb.save()
    else:
        print("No Documents")
else:
    print ("Parameters Incorrect")

SLA File: Z:\Shared\STWorking\General KTM-Kottayam-Manorama-First-A-18102020-1.sla

Command Line

cmd /C ""D:\ScribusST\Scribus\scribus.exe" -g -ns "Z:\Shared\STWorking\General KTM-Kottayam-Manorama-First-A-18102020-1.sla" --python-script D:\ScribusST\imgThumb.py --python-arg Z:\Shared\Pages\18102020\\Kottayam\\Manorama\\First\Preview\ --python-arg Z:\Shared\Pages\18102020\\Kottayam\\Manorama\\First\Thumbnail\"

jghali

2020-10-17 11:44

administrator   ~0048176

Last edited: 2020-10-17 11:44

Your command line is wrong in the first place. Current scribus development versions do not support any --python-arg command line options. That option has been removed from code in November 2015, so that means no Scribus version uses it since 1.5.1.

The python script arguments should be specified this way:
scribus.exe -g -ns --python-script yourPythonScript.py pythonArg1 pythonArg2 ... pythonArgN -- scribus-file.sla

jghali

2020-10-17 12:11

administrator   ~0048177

Note also that with such command line your script would be also wrong as sys.argv would have only 3 arguments (script path + 2 scribus python arguments). So sys.argv[4] would itself trigger a Python error as 4 would be out of range.

sreerajp

2020-10-17 13:22

reporter   ~0048178

Actually it was not working with filename having space. I was on it from 12 PM IST to 2:30 PM IST.Now it is working.
Also the argument part, it won't trigger any error as it will take scirpt path, two "--python-args", two arguments all as arguments. in sys.argv

Anyway please close it and if I could find out the issue again I will come back with more details.

Thank You

Issue History

Date Modified Username Field Change
2020-10-17 08:28 sreerajp New Issue
2020-10-17 10:33 jghali Note Added: 0048174
2020-10-17 11:15 sreerajp Note Added: 0048175
2020-10-17 11:44 jghali Note Added: 0048176
2020-10-17 11:44 jghali Note Edited: 0048176
2020-10-17 12:11 jghali Note Added: 0048177
2020-10-17 13:22 sreerajp Note Added: 0048178
2020-10-17 13:56 jghali Assigned To => jghali
2020-10-17 13:56 jghali Status new => resolved
2020-10-17 13:56 jghali Resolution open => no change required
2020-10-17 13:56 jghali Resolution no change required => unable to reproduce
2020-10-17 13:56 jghali Status resolved => closed