[php-src] Issue #19904: WebP format is not supported by exif

From: Date: Sun, 21 Sep 2025 13:52:39 +0000
Subject: [php-src] Issue #19904: WebP format is not supported by exif
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-250868@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/19904 Author: balping ### Description The following code contains a sample webp image with exif metadata embedded. I can read out this data with exiv2 under linux: ``` $ exiv2 -pe sample.webp Exif.Image.ImageWidth Long 1 100 Exif.Image.ImageLength Long 1 100 Exif.Image.BitsPerSample Short 3 8 8 8 Exif.Image.ImageDescription Ascii 18 Created with GIMP Exif.Image.XResolution Rational 1 300/1 Exif.Image.YResolution Rational 1 300/1 Exif.Image.ResolutionUnit Short 1 2 Exif.Image.Software Ascii 11 GIMP 3.0.4 Exif.Image.DateTime Ascii 20 2025:09:21 15:30:30 Exif.Image.ExifTag Long 1 250 Exif.Photo.DateTimeOriginal Ascii 20 2025:09:21 15:29:27 Exif.Photo.DateTimeDigitized Ascii 20 2025:09:21 15:29:27 Exif.Photo.OffsetTime Ascii 7 +02:00 Exif.Photo.OffsetTimeOriginal Ascii 7 +02:00 Exif.Photo.OffsetTimeDigitized Ascii 7 +02:00 Exif.Photo.UserComment Undefined 25 Created with GIMP Exif.Photo.ColorSpace Short 1 1 Exif.Image.GPSTag Long 1 430 Exif.GPSInfo.GPSAltitude Rational 1 0/100 Exif.Image.DateTimeOriginal Ascii 20 2025:09:21 15:29:27 ``` However the php exif extension does not support webp images: ```php <?php // $exif = exif_read_data('sample.webp'); $exif = exif_read_data('data://text/plain;base64,UklGRgYCAABXRUJQVlA4WAoAAAAIAAAAYwAAYwAAVlA4TBcAAAAvY8AYAAdQ/vKXv/9hABLC//1SRP9TiQBFWElGyAEAAElJKgAIAAAADAAAAQQAAQAAAGQAAAABAQQAAQAAAGQAAAACAQMAAwAAAJ4AAAAOAQIAEgAAAKQAAAAaAQUAAQAAALYAAAAbAQUAAQAAAL4AAAAoAQMAAQAAAAIAAAAxAQIACwAAAMYAAAAyAQIAFAAAANIAAABphwQAAQAAAPoAAAAliAQAAQAAAK4BAAADkAIAFAAAAOYAAAAAAAAACAAIAAgAQ3JlYXRlZCB3aXRoIEdJTVAALAEAAAEAAAAsAQAAAQAAAEdJTVAgMy4wLjQAADIwMjU6MDk6MjEgMTU6MzA6MzAAMjAyNTowOToyMSAxNToyOToyNwAHAAOQAgAUAAAAVAEAAASQAgAUAAAAaAEAABCQAgAHAAAAfAEAABGQAgAHAAAAhAEAABKQAgAHAAAAjAEAAIaSBwAZAAAAlAEAAAGgAwABAAAAAQAAAAAAAAAyMDI1OjA5OjIxIDE1OjI5OjI3ADIwMjU6MDk6MjEgMTU6Mjk6MjcAKzAyOjAwAAArMDI6MDAAACswMjowMAAAAAAAAAAAAABDcmVhdGVkIHdpdGggR0lNUAABAAYABQABAAAAwAEAAAAAAAAAAAAAZAAAAA=='); var_dump($exif); ``` Resulted in this output: ``` PHP Warning: exif_read_data(): File not supported in exiftest.php on line 5 bool(false) ``` But I expected this output instead: Full EXIF data, similar to the output produced by exiv2. ### PHP Version ```plain PHP 8.4.12 (cli) (built: Aug 28 2025 15:30:21) (NTS) Copyright (c) The PHP Group Zend Engine v4.4.12, Copyright (c) Zend Technologies with Xdebug v3.4.5, Copyright (c) 2002-2025, by Derick Rethans ``` ### Operating System _No response_

« previous php.bugs (#250868) next »