I want to read the EXIF data from a HEIC photo.
If I run:
<?php
var_dump(exif_read_data("test.heic"));
I get
bool(false)
If I run the Linux tool exiftool test.heic
- then I can see all the information that I need is there (location, camera name, etc).
If I run exif_read_data("test.jpg")
- then I get data. So I know the syntax I'm using is correct.
I'm using PHP 7.1 and ImageMagick 6.9.4-10 (1684).
print_r(imagick::getVersion());
Array
(
[versionNumber] => 1684
[versionString] => ImageMagick 6.9.4-10 Q16 x86_64 2017-05-23 http://www.imagemagick.org
)
Do I need newer versions? If so, which ones work with HEIC?
This is a limitation in the EXIF extension for PHP. Currently the EXIF extension will only read two file formats:
As the extension maintainer for EXIF in PHP, I cannot say that there is a specific plan to support more formats, as only recently one report has been posted at the bug tracker in regards to supporting PNG images (starting with version 1.5 of the PNG specification).
My suggestion to you is to report it as a "Feature Request" on the PHP bug tracker so it can be tracked (and if you can provide details or even an experimental implementation, it would help push this into PHP faster). For now the only option is to convert images into JPEG or TIFF to make them readable by the EXIF extension.