您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

使用PHP从JPG删除EXIF数据

使用PHP从JPG删除EXIF数据

使用gd重新创建图像的图形部分在一个新的,你保存 。

参见PHP gd

使用新的Imagick功能

开启图片

<?PHP
    $incoming_file = '/Users/John/Desktop/file_loco.jpg';
    $img = new Imagick(realpath($incoming_file));

确保在图像中保留所有ICC配置文件

    $profiles = $img->getImageProfiles("icc", true);

然后剥离图像,然后将配置文件放回去

    $img->stripImage();

    if(!empty($profiles)) {
       $img->profileImage("icc", $profiles['icc']);
    }

来自此PHP页面,请参见Max Eremin的注释。

php 2022/1/1 18:22:20 有472人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶