[Koha] dual cover images suport

Alvaro Cornejo cornejo.alvaro at gmail.com
Sun Aug 2 06:13:25 NZST 2020


Hi

We have seen that the cover images we have been loading into koha, in png
format, are quite big (some over 1Mb) so we are checking a way to optimise
their size.

One option is to replace those png files with one with a lower
resolution/size keeping the same png format and/or move to jpeg.

Another option would be to convert them to a better image format like webp.
The issue here is that that webp is not supported by some browsers.
Therefore, we need to have two cover image versions.

In this last case, we will either need to add a second image column in
mysql for the optimized version or store them somewhere in the network. In
addition to that, we will need to modify opac-image.pl or create another
get-webp-cover.pl script in order to have something like:

<picture>
  <source type="image/webp" srcset="/get-webp-cover.pl?biblionumber=243233">
   <img style="-webkit-user-select: none;margin: auto;cursor: zoom-in;"
src="
https://biblioteca.celacp.org/cgi-bin/koha/opac-image.pl?biblionumber=243233"

width="445" height="695">
</picture>

Instead of just
<img style="-webkit-user-select: none;margin: auto;cursor: zoom-in;"
src="
https://biblioteca.celacp.org/cgi-bin/koha/opac-image.pl?biblionumber=243233"

width="445" height="695">

And  /get-webp-cover.pl will return
  <img style="-webkit-user-select: none;margin: auto;cursor: zoom-in;"
src="/image/ 243233.webp" width="445" height="695">

Will adding an additional column to mysql break future koha upgrades?
opac-image.pl modifications for sure will be overwritten in future
uogrades, so we will need to keep track of changes and reapply them after
each upgrade.

Any thoughts on the best way to go?

Regards,

Alvaro


|----------------------------------------------------------------------------------------|
 Stay safe / Cuídate/  Reste sécurisé
*7* Switch off as you go / Apaga lo que no usas /  Débranchez au fur et à
mesure.
 *q *Recycle always / Recicla siempre / Recyclez toujours
 P Print only if absolutely necessary / Imprime solo si es necesario /
Imprimez seulement si nécessaire


More information about the Koha mailing list