[Scribus] Image Sizing Functions in Scripter

Gregory Pittman gpittman
Sat Mar 1 00:13:19 CET 2008


Wesley Crossman wrote:
> Hello all,
>
> I'm trying to write a script which generates real estate flyers from 
> templates, and I'm having trouble finding a way to make images fill 
> the frames. I assume that I'll need to calculate it myself, but I 
> haven't found a way to get the size of the image to find the needed 
> percentage. Centering the image in the frame would be nice too. Can 
> anyone help me with this?
I think what you want to do is make a given size frame then adjust image 
to frame, as in this script:
http://wiki.scribus.net/index.php/Automatic_import_of_images:_Versions_not_requiring_Tkinter

something like this:

f = scribus.createImage(x, y, pwidth, pheight)
scribus.loadImage(imagedir + '/' + D[imagecount], f)
scribus.setScaleImageToFrame(scaletoframe=1, proportional=1, name=f)

so you make the frame, load the image, then adjust image to frame.

Greg





More information about the scribus mailing list