Re: Serving an image

From: Date: Wed, 17 Oct 2012 16:07:56 +0000
Subject: Re: Serving an image
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-319500@lists.php.net to get a copy of this message
> > What is the diference between using imagecreatefrompng() and readfile()? > Any performance improvement? > > If you don't do any image minipulation, I would recommend readfile indeed. The differences being that imagecreatefrompng load the image into memory, ready to change it (overlay, rotate, crop, colours, .. anything), and readfile just sends whatever file you point it to back to the browser (or other output). Then again, if you all you're doing is sending an image to the browser; then why not do a redirect - or simply refer to the image directly? Wouter

« previous php.general (#319500) next »