简体   繁体   English

图像Magick问题获取色彩配置文件

[英]Image Magick issues getting colorprofile

Im trying to get the colorprofile of any image and i cant seem to do it with imageMagick. 我试图获取任何图像的颜色配置文件,我似乎无法使用imageMagick做到这一点。 I can get the profile from some images with exif_read_data but I need the profile from all images. 我可以使用exif_read_data从某些图像中获取配置exif_read_data但是我需要所有图像中的配置文件。 i found the function getImageProfile() but it does not seem to do anything. 我发现了功能getImageProfile()但它似乎没有任何作用。 When i use image magick i always run commands with exec() do I have to install something else to run normal functions like the following? 当我使用image magick时,我总是使用exec()运行命令,是否需要安装其他东西才能运行如下所示的正常功能?

here is my code that does work: 这是我的代码,可以正常工作:

$newfile="tmp_image/someimage.jpg";
$comment=GetImageProfile($newfile,"comment");
print "-".$comment."-";

When i run that code, i dont even see the dashes, so the function is crashing php 当我运行该代码时,我什至看不到破折号,因此该功能使php崩溃了

Are you using linux? 您在使用linux吗? I did this for centos.. 我这样做是为了centos。

yum install php-devel
pecl install imagick
service httpd restart

Also try .. 也尝试..

1) Turning on error reporting in the file 1)打开文件中的错误报告

ini_set(‘display_errors’,1);
error_reporting(E_ALL|E_STRICT);

2) Try using another ImageMagick function to see if it is an extension issue or if it's something else. 2)尝试使用另一个ImageMagick函数来查看它是否是扩展问题或其他问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM