2011/2/15 a.l.e <span dir="ltr"><<a href="mailto:ale.comp_06@xox.ch">ale.comp_06@xox.ch</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
is anybody using a script which already uses the value returned by getImageScale()?<br>
(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).<br>
</blockquote></div><br>Here is how I adjust images to frame:<br><br><span style="font-family: courier new,monospace;">##########################</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"># Fit image to frame</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">##########################</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">SCALETOFRAME = 1</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">FREESCALE = 0</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">PROPORTIONAL = 1</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">DISTORTED = 0</span><br><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">def adjustImageToFrame(frame):</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> """Adjust bitmap image to frame."""</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> scribus.setScaleImageToFrame(SCALETOFRAME,DISTORTED,frame)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> s = <b>scribus.getImageScale(</b></span><b><span style="font-family: courier new,monospace;">frame</span><span style="font-family: courier new,monospace;">)</span></b><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> m = max(s[0],s[1])</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;"> scribus.setScaleImageToFrame(FREESCALE,PROPORTIONAL,</span><span style="font-family: courier new,monospace;">frame</span><span style="font-family: courier new,monospace;">)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> scribus.scaleImage(m,m,</span><span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;">frame</span><span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;">) # scaleImage depracated (?)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"></span><br clear="all"><br>-- <br>
<font style="font-family: Helvetica,Arial,sans-serif;" color="#888888"><hr>
<font size="1"><font size="2"><img style="width: 75px; min-height: 100px;" alt="Meira" src="http://lh4.ggpht.com/_75EesisxR5g/TENbAQVXMLI/AAAAAAAADHs/ChNQzn8eOT0/meira-75x100.jpg" hspace="8" vspace="6" align="left"></font></font></font><span style="font-family: Helvetica,Arial,sans-serif;">nome: "</span><span style="font-weight: bold; font-family: Helvetica,Arial,sans-serif;">José Antonio Meira da Rocha</span><span style="font-family: Helvetica,Arial,sans-serif;">"
tratamento: "Prof. MS."</span><br style="font-family: Helvetica,Arial,sans-serif;">
<small style="font-family: Helvetica,Arial,sans-serif;">cargo: "<span style="font-weight: bold;">Coordenador do Curso de
Relações Públicas Multimídia</span>"<br>
ies: "CESNORS/Universidade Federal de Santa Maria"<br>
googletalk: email: MSN: <a href="mailto:joseantoniorocha@gmail.com" target="_blank">joseantoniorocha@gmail.com</a><br>
ICQ: 658222 Skype: "meiradarocha_jor"<br>
veículo: [ <a href="http://meiradarocha.jor.br/" target="_blank">http://meiradarocha.jor.br</a>
] <br>fone: (55) 9651-0686<br></small>
<hr style="width: 100%; height: 2px; font-family: Helvetica,Arial,sans-serif;">
<br>