|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-10-01 17:09 UTC] elmicha@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 07:00:02 2025 UTC |
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); }