Re: Re: how to detect type of image

From: Date: Sat, 28 Apr 2007 21:46:58 +0000
Subject: Re: Re: how to detect type of image
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-254081@lists.php.net to get a copy of this message
On Apr 28, 2007, at 12:21 PM, tedd wrote:
At 9:22 AM -0500 4/28/07, Edward Vermillion wrote:
It should, but instead try this: $image_size = getimagesize($filename); echo $image_size['mime'];
$image_size['mime'] ? Where did that come from?
I duno, maybe the manual. http://us2.php.net/getimagesize <-- 5th or 6th example down.
Ahhh... that's for sending a mime type to the browser. I'd always just used $image[2] since I usually check against the image constants in a switch... switch ($image[2]) { case IMAGETYPE_JPEG: // do something with a jpeg... blah...blah...blah... } But it's good to know that the 'mime' bit is there too. Ed

« previous php.general (#254081) next »