如何在PHP中删除EXIF(图像文件)数据?
我已安装imagick库并使用以下命令进行检查:如何在PHP中删除EXIF(图像文件)数据?,php,exif,Php,Exif,我已安装imagick库并使用以下命令进行检查: php-m | grep imagick。它正在工作。 但当我引用同一引用时,它给了我一个空白数组。 这是我的密码: error_reporting(E_ALL); $incoming_file = '/var/www/html/demos/exif/tim.jpg'; $img = new Imagick(realpath($incoming_file)); $profiles = $img->getIma
php-m | grep imagick
。它正在工作。
但当我引用同一引用时,它给了我一个空白数组。
这是我的密码:
error_reporting(E_ALL);
$incoming_file = '/var/www/html/demos/exif/tim.jpg';
$img = new Imagick(realpath($incoming_file));
$profiles = $img->getImageProfiles("icc", true);
echo '<pre>';
print_r($profiles);
错误报告(E_ALL);
$incoming_file='/var/www/html/demos/exif/tim.jpg';
$img=new Imagick(realpath($incoming_file));
$profiles=$img->getImageProfiles(“icc”,true);
回声';
打印(配置文件);
当我尝试打印$profiles
时,不会返回任何内容。它给了我一个空数组
这将用PHP显示JPEG文件中的EXIF信息。尝试使用相对路径并检查脚本是否可以从此目录读取(权限) 您可以在这里尝试:
所有图像都没有嵌入icc配置文件。如果你得到的回答是空的,跳过这一步。但我没有工作
$uploadfile = "uploaded/pic.jpg";
$exif = exif_read_data($uploadfile, 0, true);
echo "<b>Your file</b><br />\n";
foreach ($exif as $key => $section) {
foreach ($section as $name => $val) {
echo "$key.$name: $val<br />\n";
}
}
$img = new Imagick($uploadfile);
$img->stripImage();
$img->writeImage($uploadfile);