[scribus] Adjust frame 2 image api?

Gregory Pittman gpittman at iglou.com
Sat Nov 10 01:06:05 UTC 2012


On 11/09/2012 12:14 PM, Mark Heieis wrote:
> Hello
>
> Is there a scripting api that mimics the "Adjusts Frame to Image" 
> capability in the UI along the lines of "setScaleImageToFrame()"? So 
> far, I haven't found that functionality in the API documentation. So 
> wondering whether I missed it, it's undocumented or it doesn't exist.
>
If you look at the versions of Infobox.py that use PIL (Python imaging 
library), this is a trivial thing to accomplish.

Using the Image module:

                 im = Image.open(imageload)
                 xsize, ysize = im.size

and once you have xsize, ysize you use these to size the frame to the 
image, or use some fraction of each and setScaleImageToFrame().

Greg



More information about the scribus mailing list