2
我试图将IPTC数据嵌入到使用iptcembed()
的JPEG图像中,但我有点麻烦。用PHP嵌入IPTC图像数据GD
我已经验证它是中端产品:
// Embed the IPTC data
$content = iptcembed($data, $path);
// Verify IPTC data is in the end image
$iptc = iptcparse($content);
var_dump($iptc);
它返回进入标记。
然而,当我保存并重新加载图像的标签是不存在的:
// Save the edited image
$im = imagecreatefromstring($content);
imagejpeg($im, 'phplogo-edited.jpg');
imagedestroy($im);
// Get data from the saved image
$image = getimagesize('./phplogo-edited.jpg');
// If APP13/IPTC data exists output it
if(isset($image['APP13']))
{
$iptc = iptcparse($image['APP13']);
print_r($iptc);
}
else
{
// Otherwise tell us what the image *does* contain
// SO: This is what's happening
print_r($image);
}
那么,为什么不保存的图像中的标签?
PHP源是avaliable here,和相应的输出为:
哎呀,我还以为是PARAM东西完全不同 - 对于谢谢! – Ross 2011-02-07 12:40:09