PHP exif_read_data IFD大小非法 [英] PHP exif_read_data Illegal IFD size

查看:151
本文介绍了PHP exif_read_data IFD大小非法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,该应用程序可以修复从AWS存储桶下载的jpeg文件的方向(如果存在).

I'm working on an application where I fix orientation (if it is present) of jpeg files downloaded from an AWS bucket.

此处您可以验证该图像是否具有exif旋转部分.

Here you can verify that this image has exif Rotation section.

我通过下载图像

file_put_contents('/local/path/to/file', file_get_contents('/path/to/url/image'));

然后,我尝试通过 Gregwar图像库修正方向.

And after I try to fix orientation through the Gregwar Image library.

Image::open($path)->fixOrientation()->save($dest, $type, $quality);

我尝试了几张图像,但我总是收到消息

I tried with several images and I always receive the message

Warning: exif_read_data('/local/path/to/file'): Illegal IFD size

我认为这是与如何检索图像有关的问题,但是我也尝试了cUrl和fopen的相同结果.

I thought that was a problem related with how I retrieve the images, but I tried also with cUrl and fopen with the same result.

有人有什么建议吗?

推荐答案

您可以在忽略警告之前使用"@":@Image::open($path)->fixOrientation()->save($dest, $type, $quality);

You can use a "@" before to ignore warnings: @Image::open($path)->fixOrientation()->save($dest, $type, $quality);

很多人通过互联网对此抱怨.可能是一些带有错误的exif数据.如果您的操作按照您想要的方式进行,只需对其进行记录并继续.

That is a lot of people complaining about this over the internet. Probably some exif data with error. If you operation is working the way you want, just document it and move on.

这篇关于PHP exif_read_data IFD大小非法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆