[scribus] Scribus Adjust Frame to Image script

Stefano Danzi s.danzi at hawai.it
Tue Sep 15 09:13:05 CEST 2009


Since Scribus I use code above to do "Adjust Frame to Image" in my scripts.
On Scribus 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)
imageW = frameW * (saveScaleX / fullScaleX)
imageH = frameH * (saveScaleY / fullScaleY)
sizeObject( imageW, imageH, obj )
setUnit( saveUnit )

More information about the scribus mailing list