another photobook script

adam armfield <adamairmailed-/[email protected]>
Newsgroups gmane.comp.graphics.scribus
Message-ID <[email protected]>
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>
___
Scribus Mailing List: [email protected]
Edit your options or unsubscribe:
http://lists.scribus.net/mailman/listinfo/scribus
See also:
http://wiki.scribus.net
http://forums.scribus.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.