douyue9704 2019-03-12 22:32
浏览 635
已采纳

使用PHP从HEIC照片中读取EXIF数据

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?

  • 写回答

1条回答 默认 最新

  • dongtanxi5676756 2019-03-16 21:44
    关注

    This is a limitation in the EXIF extension for PHP. Currently the EXIF extension will only read two file formats:

    • JPEG
    • TIFF

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 R语言卸载之后无法重装,显示电脑存在下载某些较大二进制文件行为,怎么办
  • ¥15 java 的protected权限 ,问题在注释里