<div dir="ltr"><div dir="ltr">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">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">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></div></div>