From: indi2000 at pisem dot net Operating system: Linux PHP version: 4.3.3 PHP Bug Type: GD related Bug description: image is broken if imagepng called from function
Description: ------------ Imagepng() works in sample.php but doesn't work if same code is called inside function. See reproduced code.. No errors, but it shows the broken image (like broken link to image or image doesn't exists) Reproduce code: --------------- sample.php --- header('Content-type: image/png'); $this->image = "images/1.png"; $this->im=imagecreatefrompng($this->image); $this->w=imagecolorallocate($this->im, 0, 0, 0); imagepng($this->im); imagedestroy($this->im); --- function show_image() { header('Content-type: image/png'); $this->image = "images/1.png"; $this->im=imagecreatefrompng($this->image); $this->w=imagecolorallocate($this->im, 0, 0, 0); imagepng($this->im); imagedestroy($this->im); } -- Edit bug report at http://bugs.php.net/?id=25716&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25716&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25716&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=25716&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=25716&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=25716&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=25716&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=25716&r=support Expected behavior: http://bugs.php.net/fix.php?id=25716&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=25716&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=25716&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=25716&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25716&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=25716&r=dst IIS Stability: http://bugs.php.net/fix.php?id=25716&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=25716&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=25716&r=float