tibberous Posted August 16, 2008 Share Posted August 16, 2008 For a png, getimagesize is returning a type of 3. Shouldn't it return the type IMG_PNG, which has a value of 4? Or am I looking at the wrong constants? Quote Link to comment Share on other sites More sharing options...
discomatt Posted August 16, 2008 Share Posted August 16, 2008 php dot net at dannysauer dot com 12-Feb-2005 11:23 Note that, if you're going to be a good programmer and use named constatnts (IMAGETYPE_JPEG) rather than their values (2), you want to use the IMAGETYPE variants - IMAGETYPE_JPEG, IMAGETYPE GIF, IMAGETYPE_PNG, etc. For some reason, somebody made a horrible decision, and IMG_PNG is actually 4 in my version of PHP, while IMAGETYPE_PNG is 3. It took me a while to figure out why comparing the type against IMG_PNG was failing... Quote Link to comment Share on other sites More sharing options...
discomatt Posted August 16, 2008 Share Posted August 16, 2008 Also $types = array( 1 => 'GIF', 2 => 'JPG', 3 => 'PNG', 4 => 'SWF', 5 => 'PSD', 6 => 'BMP', 7 => 'TIFF(intel byte order)', 8 => 'TIFF(motorola byte order)', 9 => 'JPC', 10 => 'JP2', 11 => 'JPX', 12 => 'JB2', 13 => 'SWC', 14 => 'IFF', 15 => 'WBMP', 16 => 'XBM' ); Quote Link to comment Share on other sites More sharing options...
tibberous Posted August 16, 2008 Author Share Posted August 16, 2008 Thanks =) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.