Jump to content

getimagesize is returning the wrong type?


tibberous

Recommended Posts

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...

Link to comment
Share on other sites

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'

    );

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.