Re: PHP Image Help

From: Date: Wed, 07 Jun 2000 07:24:08 +0000
Subject: Re: PHP Image Help
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-1166@lists.php.net to get a copy of this message
"Nathan Purciful" <php-win@access2inter.net> wrote... > I get this error: > Warning: Unable to find image pointer in > /home/groups/phpPhotoAlbum/htdocs/babeweek/index.php on line 5 > > <?php > $imagesize = getimagesize("src.jpg"); > $sizeX = $imagesize[0]; > $sizeY = $imagesize[1]; > imagecopyresized("dst.jpg", "src.jpg", 100, 100, $sizeX, $sizeY, 100, 100, $sizeX, $sizeY); > ?> The first two arguments to the ImageCopyResized() function should not be filenames. They are handles to image objects that you have previously created with one of the ImageCreate*() functions. The ImageCreate*() functions create the image object and return the handle, which you then pass to other image functions like ImageCopyResized() as required. It seems that you might want to create dst_im with ImageCreate() and src_im with ImageCreateFromJPEG(). As noted at http://www.php.net/manual/ref.image.php , you need the GD library for any of the Image functions to be available.

« previous php.general (#1166) next »