I am trying to insert IPTC data into a JPEG image using iptcembed(), but I have some problems.
I checked that it is in the final product:
$content = iptcembed($data, $path);
$iptc = iptcparse($content);
var_dump($iptc);
Returns the entered tags.
However, when I save and reload the image, the tags do not exist:
$im = imagecreatefromstring($content);
imagejpeg($im, 'phplogo-edited.jpg');
imagedestroy($im);
$image = getimagesize('./phplogo-edited.jpg');
if(isset($image['APP13']))
{
$iptc = iptcparse($image['APP13']);
print_r($iptc);
}
else
{
print_r($image);
}
So why are there no tags in the saved image?
The PHP source is available here , and the corresponding outputs are:
source
share