用PHP将EXIF写入JPG

发布时间:2022-04-30 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了用PHP将EXIF写入JPG脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
有几天我试图使用 PHPjpg图像中编写(或更新)EXIF信息(地理标记,经度和纬度).
在咨询了许多网站但没有成功之后,我认为最好的选择是使用Imagick但是虽然看起来我可以用setImageproperty()设置纬度和经度,但是当我写图片时,EXIF没有被保存.

在这里我给出一个代码片段:

//Loading existing image
$edITed = new Imagick(dirname(__FILE__)."/mini.jpg");
//Stripping the curren EXIF info. I think is not mandatory and I try to comment but nothing...
$edited->stripImage();
//Setting the new PRoPErties
$edited->setImageProperty('exif:GPSLatitude','30/1,46/1,58605/1000');
$edited->setImageProperty('exif:GPSLongitude','63/1,57/1,35550/1000');
$propiedades = $edited->getImageProperties();
var_dump($propiedades);
VAR_dump($edited->writeimage('mini_edited.jpg'));


//reading the new image EXIF Info
$readedited = new Imagick(dirname(__FILE__)."/mini_edited.jpg");
$propiedades_edited = $readedited->getImageProperties();

图像已成功保存,但没有exif信息更新.

任何人都知道如何用这个或任何其他工具解决这个问题?
唯一的要求是使用PHP

非常感谢你提前!

解决方法

我找到的唯一方法是安装 @L_404_1@

脚本宝典总结

以上是脚本宝典为你收集整理的用PHP将EXIF写入JPG全部内容,希望文章能够帮你解决用PHP将EXIF写入JPG所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。