[scribus] Fit photograph to frame

Christian Mandel c.mandel at gmx.net
Thu Nov 26 15:56:41 UTC 2015


Am 26.11.2015 um 15:41 schrieb Gregory Pittman:
> On 11/26/2015 09:10 AM, Christian Mandel wrote:
>> Am 26.11.2015 um 13:43 schrieb Gregory Pittman:
>>> On 11/25/2015 10:27 AM, Christian Mandel wrote:
>>>
>>>> For me it would, (a) more functionality is almost always useful and (b)
>>>> more scripts mean more information to learn from :-)
>>>>
>>>> Nevertheless, did you check my simpler scripting suggestion (my answer
>>>> to your other post)? Is this possible?
>>>>
>>>
>>> I don't see any major advantage to your method; it's not more or less
>>> simple. I distort the frame, you would distort the scaling. But I will
>>> see if I can manage this.
>>
>> I already try it and thereby try to learn a bit of python programming,
>> but I cannot get the scaleImage() function to do something useful. I
>> opened a new thread for this.
>>
>> The benefit that I see is that rounding errors will not change your
>> frame but only the image. I fear that if it is done repeatedly there
>> errors could maybe sum up (in some very constructed, special, cases) if
>> the frame is changed repeatedly, the image, on the other hand, is always
>> set to defined starting conditions (frame completely filled) and
>> therefore you are rounding one time maximum. It is of course a rather
>> theoretical consideration with almost no practical impact, but that's
>> unfortunately the way I think about these things :-)
>>
>
> There will be no rounding errors. As you can see in my notes after the
> script, there is no recalculation to return to the prior size. I save
> the original value and just reassign it.
>
> Meanwhile, I have reworked the script per your suggestion, and posted on
> the wiki:
>
> http://wiki.scribus.net/canvas/Fitting_an_Image_to_its_Frame#fitimage2frame_v2.py
>
> It may be that your mods didn't work because scaleImage() is deprecated,
> the new command is setScaleImage().

That's correct, it works now with setImageScale. Unfortunately I found 
only scaleImage() in the API doc, but it's beta anyway, so I'm happy to 
get the hint. Thanks! :-) That's as well the problem with the 
imageWizard script from the wiki, it uses the old scaleImage as well, 
which does not work as intended.

The script that I came up with looks almost the same as yours (of course 
it was based on your earlier script :-) ) but does not do the if (xscale 
 > yscale) but assigns max(xscale,yscale) to both scales.

Thanks to you and all the others that helped and took part in the 
discussion for the efforts and the script(s) and the feature 
implementation, I learned a lot and will use the script a lot in the 
coming weeks. That will ease my work tremendously.

Best regards

Chris


> Greg
>
>
> ___
> Scribus Mailing List: scribus at lists.scribus.net
> Edit your options or unsubscribe:
> http://lists.scribus.net/mailman/listinfo/scribus
> See also:
> http://wiki.scribus.net
> http://forums.scribus.net
>





More information about the scribus mailing list