[scribus] another photobook script
adam armfield
adamairmailed at yahoo.com
Sun Feb 7 23:36:10 UTC 2021
hello,
i'm writing a hopefully simple script that I can point at a folder of jpegs, and have it make a page per pic with an image frame on it, with one of the jpegs in.
this is what I've got so far:
------------------------------
import os
import glob
os.chdir('/imagefolder')
os.scandir('/imagefolder')
pics = glob.glob('*.jpg')
for p in pics:
newPage(1)
createImage(0, 0, 90,90,["pic{picname}".format(picname = p)])
-----------------
at the moment it doesn't seem to work as I was expecting in scribus, I adapted it for general python, the string formatting does what i'd expected (appends "pic" onto the filename, I was planning to name the imageframes like this):
-----------
import os
import glob
os.chdir(' /imagefolder')
os.scandir('/imagefolder')
pics = glob.glob('*.jpg')
for p in pics:
print(p)
print("pic{picname}".format(picname = p))---------------------
the bit where I create new pages also only works under certain circumstances
for p in pics:
newPage(1)
sometimes it makes 19 new pages, other times it makes 1, other times it doesn't make any, it doesn't work at all when I use my createImage line, but I did manage to create one image frame when I gave it a hardcoded name
createImage(0, 0, 90,90,["pic{picname}".format(picname = p)])
any ideas? I was planning to follow this with a loadImage
this is in 1.5.6.1
cheers :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20210207/d8293255/attachment.htm>
More information about the scribus
mailing list