View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0016272 | Scribus | Scripter | public | 2020-10-17 08:28 | 2020-10-17 13:56 |
Reporter | sreerajp | Assigned To | jghali | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | unable to reproduce | ||
Platform | Windows | OS | 10 | OS Version | 1909 |
Product Version | 1.5.6.svn | ||||
Summary | 0016272: While running ImageExport() python script error is coming if Filename or path has space in it | ||||
Description | While running ImageExport() python script error is coming if Filename or path has space in it | ||||
Tags | No tags attached. | ||||
Patch | No | ||||
|
Unable to reproduce. Works here. |
|
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\" |
|
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 |
|
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. |
|
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 |
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 |