[opencms-dev] Opencms webp image format
Kai Widmann
Widmann at mediaworx.de
Wed Sep 20 17:10:31 CEST 2023
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
Am 20.09.2023 um 08:59 schrieb Giuseppe Lonis <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/dbc11fa1/attachment.htm>
More information about the opencms-dev
mailing list