[opencms-dev] Opencms webp image format

Schliemann, Kai K.Schliemann at comundus.com
Wed Sep 20 17:19:51 CEST 2023


Hi Kai,

thanks, that sounds great. I gave your comment on GitHub a Thumbs up. Maybe it makes it into the upcoming release.
Best regards
Kai

Von: opencms-dev <opencms-dev-bounces at opencms.org> Im Auftrag von Kai Widmann via opencms-dev
Gesendet: Mittwoch, 20. September 2023 17:11
An: Giuseppe Lonis <glonis at consulmedia.it>
Cc: Kai Widmann <Widmann at mediaworx.de>; The OpenCms mailing list <opencms-dev at opencms.org>
Betreff: Re: [opencms-dev] Opencms webp image format

Hey Giuseppe (an to everyone who is interested in WebP with OpenCms),

Therefore the problem cannot be solved.
I beg to differ, I solved this with the library "webp-imageio" described here:
https://genuinecoder.com/java-webp-image-read-save-tutorial/

webp-imageio adds native support for WebP to Java, so the native image methods used in OpenCms image scaling also work with WebP. It’s really as simple as dropping the jar in the lib folder (or defining a Maven/Gradle dependency).

My first tests are really promising, image sizes in the CMS are now correct (instead of -1 x -1), image scaling of WebP images is working as expected. So far so good.
It’s important to know that you have to re-upload WebP images, I guess the size is read during the initial upload, once wrong it doesn’t get corrected by using the library. But after re-uploading the image, everything seems to be fine.
If I for some reason find that this does not work as expected in the end, I’ll report.

@Alkacon: it might be a good idea to add this as a dependency for the OpenCms core, that way WebP should work as expected.

Cheers

Kai

_______________________________________________

Kai Widmann
mediaworx berlin AG

+49 30 27580-262
Digitale Visitenkarte: https://mediaworx.com/021
www.mediaworx.com<http://www.mediaworx.com>


Am 20.09.2023 um 08:59 schrieb Giuseppe Lonis <glonis at consulmedia.it<mailto:glonis at consulmedia.it>>:

Hi Kai,
unfortunately on the opencms issues they wrote that the ImageScaler library does not support that format.
Therefore the problem cannot be solved.

Greetings Giuseppe



Il giorno mar 19 set 2023 alle ore 18:13 Kai Widmann <Widmann at mediaworx.de<mailto:Widmann at mediaworx.de>> ha scritto:
Hello Giuseppe,

I’m facing similar problems in OpenCms 15. May I ask if you solved this and if so, how?

Cheers

Kai

_______________________________________________

Kai Widmann
mediaworx berlin AG

+49 30 27580-262
Digitale Visitenkarte: https://mediaworx.com/021
www.mediaworx.com<http://www.mediaworx.com/>


Am 15.08.2023 um 10:55 schrieb Giuseppe Lonis via opencms-dev <opencms-dev at opencms.org<mailto:opencms-dev at opencms.org>>:

HI,
on opencms version 14 there are problems displaying images in webp format.
In particular, in the preview inside content the image is not resized, unlike the jpg ones.

Also the scaling of the image with the command image.webp?__scale=w:1200,h:1200,t:2,c:transparent,p:0 does not work (it should become a square image instead it keeps the original format).

Finally, due to this problem the image gallery is very slow to load.


A thousand thanks
Greetings Joseph
_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
https://lists.opencms.org/mailman/listinfo/opencms-dev




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opencms.org/pipermail/opencms-dev/attachments/20230920/291cd41d/attachment.htm>


More information about the opencms-dev mailing list