T O P I C R E V I E W |
HeartWare |
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?
|
4 L A T E S T R E P L I E S (Newest First) |
HeartWare |
Posted - Dec 21 2023 : 00:35:40 Thank you for the heads-up. I'll update my detection routine to handle this...
|
xequte |
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 |
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 |
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
|