[scribus] patching getImageScale()

a.l.e ale.comp_06 at xox.ch
Wed Feb 16 11:46:37 CET 2011


hi josé,

> 2011/2/15 a.l.e <ale.comp_06 at xox.ch>
> 
> > is anybody using a script which already uses the value returned by
> >  getImageScale()?
> > (comparing the X and Y value does not count: the proportions among
> > X and Y scale will not be changed, except in the case you have
> > pictures which really weird X and Y resolutions).
> >
> 
> Here is how I adjust images to frame:
> 
> ##########################
> # Fit image to frame
> ##########################
> SCALETOFRAME = 1
> FREESCALE = 0
> PROPORTIONAL = 1
> DISTORTED = 0
> 
> def adjustImageToFrame(frame):
>     """Adjust bitmap image to frame."""
>     scribus.setScaleImageToFrame(SCALETOFRAME,DISTORTED,frame)
>     s = *scribus.getImageScale(**frame)*
>     m = max(s[0],s[1])
>     scribus.setScaleImageToFrame(FREESCALE,PROPORTIONAL,frame)
>     scribus.scaleImage(m,m,frame) # scaleImage depracated (?)


this means that scaleImage() is probably also "broken" and should be fixed the same way as getImageScale() is.

i will create a patch for it, too!

concerning the main matter: you don't seem to be using the result from getImageScale() for anything else than comparing the x and y scale (and missing to considerate a difference in the x and y resolution... which is probably rare but seems to be theoretically possible)


ciao
a.l.e



More information about the scribus mailing list