Allow the example for iptcembed to write its result to the original

.jpg file.
Addresses bug #49595.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@288470 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Torben Wilson 2009-09-20 08:50:18 +00:00
parent c57d1d20ea
commit c48205c99e

View file

@ -111,11 +111,16 @@ $data = '';
foreach($iptc as $tag => $string)
{
$tag = substr($tag, 2);
$data .= iptc_make_tag(2, substr($tag, 2), $string);
$data .= iptc_make_tag(2, $tag, $string);
}
// Embed the IPTC data
$content = iptcembed($data, $path);
// Write the new image data out to the file.
$fp = fopen($path, "wb");
fwrite($fp, $content);
fclose($fp);
?>
]]>
</programlisting>