<div dir="ltr"><div dir="ltr"><div>Hi 
Paul,

Jonathan,</div><div><br></div><div>Thank you both for your prompt replies and your feedback.</div><div>I have now opened a new bug report here:</div><div><a href="https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21987">https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21987</a></div><div><br></div><div>Andreas<br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, 12 Dec 2018 at 14:53, Paul Poulain <<a href="mailto:paul.poulain@biblibre.com">paul.poulain@biblibre.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Andreas,<br>
<br>
(and if you can't provide a patch, please file a bug on buzilla, this <br>
description is perfect ! )<br>
<br>
Le 12/12/2018 à 13:49, Jonathan Druart a écrit :<br>
> Hi Andreas,<br>
><br>
> This module has never been enhanced much and as you noticed there is<br>
> room for such enhancements :)<br>
> All of what you describe in your email makes sense to me, and I am<br>
> sure the changes will be accepted if a patch is provided.<br>
><br>
> Cheers,<br>
> Jonathan<br>
> Le mer. 12 déc. 2018 à 06:42, Andreas Roussos <<a href="mailto:arouss1980@gmail.com" target="_blank">arouss1980@gmail.com</a>> a écrit :<br>
>> Dear Developers,<br>
>><br>
>> We use local cover images in our setup, and also resize the covers<br>
>> we scan to a width of 160px before uploading and attaching them to<br>
>> a Koha bibliographic record (we upload one cover per biblio).<br>
>><br>
>> While using phpMyAdmin to view the contents of the 'biblioimages'<br>
>> table (relevant screenshot here: <a href="https://imgur.com/a/cSEVLBI" rel="noreferrer" target="_blank">https://imgur.com/a/cSEVLBI</a>), we<br>
>> noticed that the size of the BLOBs for the 'thumbnail' column was in<br>
>> some cases twice as big as that of the 'imagefile' column. In fact,<br>
>> this happens for more than 50% of uploaded covers as you can see<br>
>> from the output of the SQL queries below:<br>
>><br>
>> mysql> SELECT COUNT( * ) AS count<br>
>>           FROM biblioimages<br>
>>          WHERE LENGTH( thumbnail ) > ( LENGTH( imagefile ) * 2 ) ;<br>
>> +-------+<br>
>> | count |<br>
>> +-------+<br>
>> |  1356 |<br>
>> +-------+<br>
>><br>
>> mysql> SELECT COUNT( * ) AS count,<br>
>>                SUM( LENGTH( imagefile ) ) AS images_size,<br>
>>                SUM( LENGTH( thumbnail ) ) AS thumbnails_size<br>
>>           FROM biblioimages ;<br>
>> +-------+-------------+-----------------+<br>
>> | count | images_size | thumbnails_size |<br>
>> +-------+-------------+-----------------+<br>
>> |  2347 |    68323933 |       115839686 |<br>
>> +-------+-------------+-----------------+<br>
>><br>
>> It would appear that for each 160px-wide JPG with 24-bit depth that<br>
>> we have uploaded, the 'imagefile' column has been populated with an<br>
>> PNG of 8 bit depth with the same dimensions as the uploaded file,<br>
>> whereas the 'thumbnail' column contains a 24-bit PNG image with a<br>
>> width reduced to 140 pixels.<br>
>><br>
>> I've tracked down the creation of resized 24-bit PNGs to this code:<br>
>> <a href="https://github.com/Koha-Community/Koha/blob/master/C4/Images.pm#L182-L183" rel="noreferrer" target="_blank">https://github.com/Koha-Community/Koha/blob/master/C4/Images.pm#L182-L183</a><br>
>><br>
>> Do thumbnails for covers need to be true colour (24-bit) images?<br>
>><br>
>> Also, why is it that _scale_image() returns an image of 8-bit depth<br>
>> if the source image's dimensions are less than 600x800? (i.e. when<br>
>> no resizing is performed)<br>
>><br>
>> Thank you in advance for your time.<br>
>><br>
>> Kind regards,<br>
>> Andreas<br>
>> _______________________________________________<br>
>> Koha-devel mailing list<br>
>> <a href="mailto:Koha-devel@lists.koha-community.org" target="_blank">Koha-devel@lists.koha-community.org</a><br>
>> <a href="http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" rel="noreferrer" target="_blank">http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a><br>
>> website : <a href="http://www.koha-community.org/" rel="noreferrer" target="_blank">http://www.koha-community.org/</a><br>
>> git : <a href="http://git.koha-community.org/" rel="noreferrer" target="_blank">http://git.koha-community.org/</a><br>
>> bugs : <a href="http://bugs.koha-community.org/" rel="noreferrer" target="_blank">http://bugs.koha-community.org/</a><br>
> _______________________________________________<br>
> Koha-devel mailing list<br>
> <a href="mailto:Koha-devel@lists.koha-community.org" target="_blank">Koha-devel@lists.koha-community.org</a><br>
> <a href="http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" rel="noreferrer" target="_blank">http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a><br>
> website : <a href="http://www.koha-community.org/" rel="noreferrer" target="_blank">http://www.koha-community.org/</a><br>
> git : <a href="http://git.koha-community.org/" rel="noreferrer" target="_blank">http://git.koha-community.org/</a><br>
> bugs : <a href="http://bugs.koha-community.org/" rel="noreferrer" target="_blank">http://bugs.koha-community.org/</a><br>
<br>
-- <br>
Paul Poulain, Associé-gérant / co-owner<br>
BibLibre, Services en logiciels libres pour les bibliothèques<br>
BibLibre, Open Source software and services for libraries<br>
<br>
_______________________________________________<br>
Koha-devel mailing list<br>
<a href="mailto:Koha-devel@lists.koha-community.org" target="_blank">Koha-devel@lists.koha-community.org</a><br>
<a href="http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" rel="noreferrer" target="_blank">http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a><br>
website : <a href="http://www.koha-community.org/" rel="noreferrer" target="_blank">http://www.koha-community.org/</a><br>
git : <a href="http://git.koha-community.org/" rel="noreferrer" target="_blank">http://git.koha-community.org/</a><br>
bugs : <a href="http://bugs.koha-community.org/" rel="noreferrer" target="_blank">http://bugs.koha-community.org/</a></blockquote></div>