Re: Resize an image from URL

From: Date: Tue, 10 Dec 2002 13:23:00 +0000
Subject: Re: Resize an image from URL
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-127633@lists.php.net to get a copy of this message
On Tue, 10 Dec 2002, fragmonster wrote: > I want to resize an image from an URL if it is too large. Is there a way > to know the size (width and height) of an image from an url without > download it? > > For exemple: getWidth(http://www.toto.com/imlage.gif) Depending on the version of PHP youre using you can use either PEAR's Image_Remote class: http://pear.php.net/package-info.php?pacid=42 Or PHP's native getImageSize() http://fi.php.net/manual/en/function.getimagesize.php To remotely get the dimensions of image file. IIRC the native functions supports this since 4.0.5 and looking at the code it does not download the whole image but parses the first few bytes of the imagefile header (the same way as Image_Remote does). -- Mika Tuupola http://www.appelsiini.net/~tuupola/

« previous php.general (#127633) next »