[scribus] Scribus 1.3.5.1: Adjust Frame to Image script

Gregory Pittman gregp_ky at yahoo.com
Fri Sep 18 14:22:37 CEST 2009


On 09/18/2009 03:19 AM, a.l.e wrote:
> ciao greg,
>
>> http://wiki.scribus.net/index.php/Infobox_in_column
>>
>> you can review this script, which was made to insert a frame in a 
>> column of text, the exact width of the column. There was a kludgy 
>> sort of way that compensated for the lack of Adjust Frame to image, 
>> but what I eventually did is what you see below in this code 
>> fragment. The basic idea is to start with a certain width of the 
>> frame, then use the PIL (Python imaging library) to assess the size 
>> of the image and calculate an appropriate size for the frame.
>>
>>         if (frametype == 'imageL'):
>>         imageload = scribus.fileDialog('Load image','Images(*.jpg 
>> *.png *.tif *.JPG *.PNG *.jpeg *.JPEG *.TIF)',haspreview=1)
>>             im = Image.open(imageload)
>>             xsize, ysize = im.size
>>         new_height = float(ysize)/float(xsize)*new_width
>>         new_image = scribus.createImage(new_left, float(new_top), 
>> new_width, float(new_height),framename)
>>         scribus.loadImage(imageload, new_image)
>
> i guess it's time to go  through the scripts in the wiki and create a 
> new systematic where you can get full scripts and find snippets which 
> make your life eaysier!
I'm wondering if we need something like a "Working with Scripter..." 
series, to make it easier for people file things they need. There could 
of course be links to complete scripts that actually have some useful 
functionality.

First, though, we need to re-create an up-to-date list of available 
commands.

Greg




More information about the scribus mailing list