[scribus] Scribus 1.3.5.1: Adjust Frame to Image script
a.l.e
ale.comp_06 at xox.ch
Fri Sep 18 00:17:15 CEST 2009
ciao stefano,
Since Scribus 1.3.3.13 I use code above to do "Adjust Frame to Image"
> in my scripts. On Scribus 1.3.5.1 this don't work...
>
> Somaine has found a solution????
>
> ---------------------------------------
>
> ## Adjust Frame to Image
> ## First select the frame of the image
> saveUnit = setUnit(UNIT_POINTS)
> obj = getSelectedObject()
> frameW = getProperty(obj, "width")
> frameH = getProperty(obj, "height")
> saveScaleX = getProperty(obj, "imageXScale")
> saveScaleY = getProperty(obj, "imageYScale")
> setScaleImageToFrame(True, False, obj)
> fullScaleX = getProperty(obj, "imageXScale")
> fullScaleY = getProperty(obj, "imageYScale")
> setScaleImageToFrame(False, False, obj)
> scaleImage(saveScaleX, saveScaleY, obj)
> sizeObject( imageW, imageH, obj )
> setUnit( saveUnit )
it somehow works in 1.5 (as already reported by matis you have to use getUnit and setUnit)...
still it doesn't really adjust the frame to the image... i'm looking at those lines
> imageW = frameW * (saveScaleX / fullScaleX)
> imageH = frameH * (saveScaleY / fullScaleY)
and try to figure out which computation will also adjust the non fitting frame!
i will post it as soon as i find it...
ciao
a.l.e
More information about the scribus
mailing list