Re: Imagecopyresampled()

From: Date: Fri, 11 Apr 2003 11:58:41 +0000
Subject: Re: Imagecopyresampled()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-143484@lists.php.net to get a copy of this message
Liam Gibbs wrote:
... imagecopyresampled($destinationimage, "$LogoDirectory/$sourceimage", 0, 0, 0, 0, $logothumbnailwidth, $logothumbnailheight, $logopicwidth, $logopicheight); I get Warning: imagecopyresampled(): supplied argument is not a valid Image resource
Second parameter (i.e. source image) of imagecopyresampled() should be resource, not string. Create source image with imagecreatefromjpeg() and use it in imagecopyresampled().
... Same results. Finally, I just try simply this: $destinationimage = imagecreatefromjpeg($_FILES["logotoupload"]["tmp_name"]); and get this: Fatal error: Call to undefined function: imagecreatefromjpeg()
Just a hint from PHP manual (maybe that helps a little): "In order to read and write images in jpeg format, you will need to obtain and install jpeg-6b (available at ftp://ftp.uu.net/graphics/jpeg/), and then recompile gd to make use of jpeg-6b. You will also have to compile PHP with --with-jpeg-dir=/path/to/jpeg-6b." -- Pavel a.k.a. Papi

« previous php.general (#143484) next »