#49595 [NEW]: Incorrect example code

From: Date: Fri, 18 Sep 2009 22:40:16 +0000
Subject: #49595 [NEW]: Incorrect example code
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-2792@lists.php.net to get a copy of this message
From: nilesprague at gmail dot com Operating system: PHP version: Irrelevant PHP Bug Type: Documentation problem Bug description: Incorrect example code Description: ------------ Two problems with the example code on the documentation page, and as a result, the code does not work: 1) The code is incomplete. The $content variable must be written to the image file to apply the changes - that is, to write the iptc data to the image file. The following code must be added at the end of the example: $fp = fopen($path, "wb"); fwrite($fp, $content); fclose($fp); 2) The $tag variable is being "substr" twice, but this should only be done once. The existing code is this: $tag = substr($tag, 2); $data .= iptc_make_tag(2, substr($tag, 2), $string); And should be changed to this: $data .= iptc_make_tag(2, substr($tag, 2), $string); Reproduce code: --------------- --- From manual page: function.iptcembed --- -- Edit bug report at http://bugs.php.net/?id=49595&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49595&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49595&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49595&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=49595&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49595&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=49595&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=49595&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=49595&r=needscript Try newer version: http://bugs.php.net/fix.php?id=49595&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=49595&r=support Expected behavior: http://bugs.php.net/fix.php?id=49595&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=49595&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=49595&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=49595&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49595&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=49595&r=dst IIS Stability: http://bugs.php.net/fix.php?id=49595&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=49595&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=49595&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=49595&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=49595&r=mysqlcfg

« previous php.doc.bugs (#2792) next »