Home
Features
Demos
Store
Forum
Support
ImageEn Forum
Profile
Join
Active Topics
Forum FAQ
Search
Forum membership is Free! Click
Join
to sign-up
Username:
Password:
Save Password
Forgot your Password?
All Forums
ImageEn Library for Delphi, C++ and .Net
ImageEn and IEvolution Support Forum
WebP files
New Topic
Reply to Topic
Author
Topic
HeartWare
Denmark
50 Posts
Posted - Dec 18 2023 : 12:37:51
Is it possible - and if so, how? - to detect if a .webp file is saved as lossy or lossless format, using standard ImageEn components?
If not using ImageEn, does anyone know how to detect it?
xequte
38611 Posts
Posted - Dec 18 2023 : 18:36:21
Hi
ImageEn supports WebP via WIC, ImageMagick and Skia (>= Delphi 12). Unfortunately none of these methods output a valid compression property.
Nigel
Xequte Software
www.imageen.com
HeartWare
Denmark
50 Posts
Posted - Dec 19 2023 : 00:38:53
Okay.
I found another way - if the bytes at offset 12 in the file is "VP8L" then it is a lossless compression (after checking bytes at offset 0 ="RIFF" and at offset 8 = "WEBP"). Lossy compression is "VP8 " (notice the trailing space) at offset 12.
xequte
38611 Posts
Posted - Dec 19 2023 : 21:23:59
Hi
Yes, unfortunately though, you may find that there are other "chunks" before the image chunk.
https://developers.google.com/speed/webp/docs/riff_container
Most commonly is a VP8X chunk. You would have to skip that and locate the "VP8L"/"VP8 " FourCC.
E.g.
attach/xequte/20231219212424_4_webp_LossyAlpha.webp
Nigel
Xequte Software
www.imageen.com
HeartWare
Denmark
50 Posts
Posted - Dec 21 2023 : 00:35:40
Thank you for the heads-up. I'll update my detection routine to handle this...
Topic
New Topic
Reply to Topic
Jump To:
Select Forum
ImageEn Library for Delphi, C++ and .Net
ImageEn and IEvolution Support Forum
--------------------
Home
Active Topics
Frequently Asked Questions
Member Information
Search Page