#25716 [Opn->Bgs]: image is broken if imagepng called from function

From: Date: Wed, 01 Oct 2003 21:09:12 +0000
Subject: #25716 [Opn->Bgs]: image is broken if imagepng called from function
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-48396@lists.php.net to get a copy of this message
ID: 25716 Updated by: elmicha@php.net Reported By: indi2000 at pisem dot net -Status: Open +Status: Bogus Bug Type: GD related Operating System: Linux PHP Version: 4.3.3 New Comment: Works fine here. Did you forget to call the function? Does your code print something (e.g. whitespace) before you call the function? Does it have whitespace before the "<?php", perhaps in an include file? If you want to reopen this bug, please provide a short, but _complete_ example script. Previous Comments: ------------------------------------------------------------------------ [2003-10-01 12:19:07] indi2000 at pisem dot net 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 this bug report at http://bugs.php.net/?id=25716&edit=1

« previous php.bugs (#48396) next »