<br><br><div><span class="gmail_quote">2007/11/19, Paweł Marciniak <<a href="mailto:pave@o2.pl">pave@o2.pl</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Gilles Caulier wrote:<br><br>> Thanks to point me over this problem... but libkexiv2 is not the right<br>> place to fix it.<br>><br>> The bug is in editor... Look at this file:<br><br>You're right - That solves it. I must have missed that place.
<br><br>But don't you think it would be better to remove the preview only if it<br>really is > 64 KiB? Many of my png files (blue sky etc. ;)) have preview<br>that fits in JPEG tag and I presume it's always good to preserve it. I mean
<br>something like:<br><br><br>// Optimistically update IPTC preview<br>meta.setImagePreview(preview);<br><br>if ( mimeType.upper() == QString("JPG") || mimeType.upper() ==<br>QString("JPEG") || mimeType.upper
() == QString("JPE"))<br>{<br>    if (meta.getIptcTagData("Iptc.Application2.Preview").size() > 65536)<br>    {<br>        // JPEG file, we remove too big IPTC preview.<br>        meta.removeIptcTag
("Iptc.Application2.Preview");<br>        meta.removeIptcTag("Iptc.Application2.PreviewFormat");<br>        meta.removeIptcTag("Iptc.Application2.PreviewVersion");<br>    }<br>}<br><br><br>What do you think?
</blockquote><div><br>Pawel,<br><br>It's not necessary for JPEG because libjpeg provide a way to decode a reduced version of really image very quickly. This is not the case of PNG and TIFF library. This is why Preview is important for these formats.
<br><br>Best<br><br>Gilles</div></div><br>