[scribus] Scribus 1.3.5.1: Adjust Frame to Image script

Mátis Barnabás matis.barnabas at gmail.com
Wed Sep 16 18:42:54 CEST 2009


The setUnit() its not function in this version (1.3.5.1)
Split the first line:

saveUnit = getUnit()
setUnit(UNIT_POINTS)

(win xp, Scribus 1.3.5.1)

barna


Stefano Danzi írta:
> Hi!!!
>
> 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)
> imageW = frameW * (saveScaleX / fullScaleX)
> imageH = frameH * (saveScaleY / fullScaleY)
> sizeObject( imageW, imageH, obj )
> setUnit( saveUnit )
>
>
> _______________________________________________
> scribus mailing list
> scribus at lists.scribus.net
> http://lists.scribus.net/mailman/listinfo/scribus
>






More information about the scribus mailing list