【发布时间】:2013-05-23 13:16:42
【问题描述】:
我整天都在为这个问题苦苦挣扎,并惊讶于找不到任何文档!
我正在将图像上传到网站,并且想提取每个图像 ICC 配置文件的名称并在图像描述中使用它。到目前为止,标准 PHP 没有产生任何结果。我用 Photoshop、Bridge 和 Exiftool 检查了图像,每个都识别出嵌入的配置文件。
<?php
$info = exif_read_data($image);
echo 'ICC Profile: '.$info['ICC_Profile'].'<br>';
echo 'ICC Profile: '.$info['CurrentICCProfile'].'<br>';
echo 'ICC Profile: '.$info['ColorSpace'].'<br>';
?>
Imagick 产生了最好的结果:
$imagick = new Imagick();
$imagick->readImage($image);
print_r ($imagick->getImageProfiles("icc",true));
生成一个实际提及配置文件但不是可用字符串的数组。任何帮助表示赞赏。
我正在使用这些版本:
PHP 版本 5.2.17 - imagick 模块版本 3.0.1 - ImageMagick 版本 6.7.6-8
而print_r 返回(用于“ProPhoto RGB”ICC 配置文件):
Array ([icc] => �KCMSmntrRGB XYZ �:acspMSFTKODAROMM���+KODAcprtHdesc\�wtpt�rTRC�gTRC�bTRC�rXYZgXYZbXYZ,dmnd@ndmdd��mmod�(textCopyright (c) Eastman Kodak Company, 1999 , 版权所有.desc ProPhoto RGB��ProPhoto RGB ProPhoto RGBXYZ ���,curv�XYZ �4I�XYZ "��>XYZ �-descKODAK��KODAKKODAKdesc'参考输出介质 Metric(ROMM) (��参考输出介质Metric(ROMM) '参考输出介质 Metric(ROMM) mmod...;')
全文(来自 Exiftool):
Profile CMM Type : KCMS
Profile Version : 2.1.0
Profile Class : Display Device Profile
Color Space Data : RGB
Profile Connection Space : XYZ
Profile Date Time : 1998:12:01 18:58:21
Profile File Signature : acsp
Primary Platform : Microsoft Corporation
CMM Flags : Not Embedded, Independent
Device Manufacturer : KODA
Device Model : ROMM
Device Attributes : Reflective, Glossy, Positive, Color
Rendering Intent : Perceptual
Connection Space Illuminant : 0.9642 1 0.82487
Profile Creator : KODA
Profile ID : 0
Profile Copyright : Copyright (c) Eastman Kodak Company, 1999, all rights reserved.
Profile Description : ProPhoto RGB
Media White Point : 0.9642 1 0.82489
Red Tone Reproduction Curve : (Binary data 14 bytes, use -b option to extract)
Green Tone Reproduction Curve : (Binary data 14 bytes, use -b option to extract)
Blue Tone Reproduction Curve : (Binary data 14 bytes, use -b option to extract)
Red Matrix Column : 0.79767 0.28804 0
Green Matrix Column : 0.13519 0.71188 0
Blue Matrix Column : 0.03134 9e-005 0.82491
Device Mfg Desc : KODAK
Device Model Desc : Reference Output Medium Metric(ROMM)
Make And Model : (Binary data 40 bytes, use -b option to extract)
【问题讨论】:
-
您期望返回的字符串是什么
-
我正在寻找一种方法来返回配置文件名称,所以在这个例子中:ProPhoto RGB
-
也许看看那些无法打印的字符实际上是什么,看看你是否能发现一个模式?例如,它们可能是空(零)字符。
标签: php image imagick color-profile color-management