From c48205c99ef2f4a4a520ce44105bf7061aa89802 Mon Sep 17 00:00:00 2001 From: Torben Wilson Date: Sun, 20 Sep 2009 08:50:18 +0000 Subject: [PATCH] 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 --- reference/image/functions/iptcembed.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/reference/image/functions/iptcembed.xml b/reference/image/functions/iptcembed.xml index fd22484bf1..e52992cd68 100644 --- a/reference/image/functions/iptcembed.xml +++ b/reference/image/functions/iptcembed.xml @@ -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); ?> ]]>