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