• Resolved fhuesser

    (@fhuesser)


    sorry for my bad English. I have activated the great plugin. The Exif information is displayed correctly from JPG files. However, I get no display for webP files. I edited these WebP files with exiftool and they are displayed correctly in other Exif tools. I think I understand that this plugin also supports webp? What am I possibly doing wrong?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Arno Welzel

    (@awelzel)

    Exiftool added support for WebP around 2022. Unfortunately, this is not the case for PHP. PHP itself does not support reading EXIF data from WebP using the function exif_read_data() yet. This is the reason why neither WordPress nor my plugin is able to get EXIF data from WebP images. At least up to PHP 8.3 this is the case. I did not check PHP 8.4 yet – but as soon PHP itself supports reading EXIF data from WebP, my plugin will automatically use that as well since it already uses the PHP function for all images with the extensions “.jpg”, “.jpeg”, “.jpe”, “.tiff” and “.webp”.

    In the past I implemented an experimental EXIF parser completely in PHP which does not require native EXIF support (https://github.com/arnowelzel/lightbox-photoswipe/blob/48a64b9648fc4caafd109eb9afad0de21c75a8bb/src/LightboxPhotoSwipe/ExifParser.php). However this is really very slow and I decided against using that in my plugin, because it is about 10x slower than the exif_read_data() which uses native C++ based code in a Linux libary instead of interpreted PHP source code. For example an image gallery with 20 webp would take about 10-15 seconds to load instead of only 1-2 seconds, because the PHP based parser would have to read every single image using PHP and then parse the EXIF data block in the header using PHP as well.

    I did not want people complaining about my plugin slowing down their website and I don’t have the time to maintain an EXIF parser and keep it up to date with all existing EXIF implementations by different vendors. Maybe I will add support using exiftool as external tool for this in the future. But for the time being you have to live with the situation as it is.

    Thread Starter fhuesser

    (@fhuesser)

    Thank you very much for the detailed explanation! Now I can use my time for something else instead of looking for the error myself 😉 Then I’m hoping for the PHP implementation….

    Plugin Author Arno Welzel

    (@awelzel)

    Maybe I’ll add at least an option to use the experimental EXIF parser with a clear warning, that this can slow down the website and that the parser may not work for all images.

    Thread Starter fhuesser

    (@fhuesser)

    That’s nice, but I’m already struggling with the performance anyway 😉

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘exif for webp files’ is closed to new replies.