<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;"><div>
> + if (width > preview_width) or (height > preview_height):<br>
> + scale_x = float(width) / preview_width<br>
> + scale_y = float(height) / preview_height<br>
> + scale = max(scale_x, scale_y)<br>
> +<br>
> + pixbuf = pixbuf.scale_simple(float(width) / scale, height / scale,<br>
> + gtk.gdk.INTERP_BILINEAR)<br>
<br></div></blockquote><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div>
</div>I guess you meant "width / scale"? scale_simple() expects integers.<br></blockquote><div><br>Yes<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
If you use scale(), you can get rid of one pixbuf (currently you use up<br>
to three).<br>
<div><br></div></blockquote><div>Ok.<br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div>
> + width, height = pixbuf.get_width(), pixbuf.get_height()<br>
<br>
> + pixbuf2 = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, pixbuf.get_has_alpha(),<br>
> + pixbuf.get_bits_per_sample(), preview_width, preview_height)<br>
<br>
</div>This creates a border around an image that's smaller than the preview<br>
size, thus wasting disk space. Please use width and height instead.<br>
<br></blockquote></div><br>That isn't true. If the image doesn't have the right proportions, it's <span id="result_box" class="short_text"><span style="" title="">stretch when</span></span> displayed.<br><br>
<br>-- <br>Gonzalo Odiard<br>SugarLabs Argentina<br><br>