note 57263 deleted from function.image-type-to-extension by sobak

From: Date: Thu, 01 Dec 2016 13:09:11 +0000
Subject: note 57263 deleted from function.image-type-to-extension by sobak
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-207845@lists.php.net to get a copy of this message
Note Submitter: robe at amd dot co dot at ---- neil: your version fails to make sense for me spybreak.de guy: a) you left out BMP b) you fucked up the order of the extension in the mid of the listing. if this was changed in the getimagesize function during php versions, I'm sorry. Otherwise: WHY?! c) the include_dot stuff is the worst abuse of function arguments I've ever seen. Shame on you. Here's a unfucked, working version: <? if(!function_exists('image_type_to_extension')) { function image_type_to_extension($imagetype) { if(empty($imagetype)) return false; switch($imagetype) { case IMAGETYPE_GIF : return 'gif'; case IMAGETYPE_JPEG : return 'jpg'; case IMAGETYPE_PNG : return 'png'; case IMAGETYPE_SWF : return 'swf'; case IMAGETYPE_PSD : return 'psd'; case IMAGETYPE_BMP : return 'bmp'; case IMAGETYPE_TIFF_II : return 'tiff'; case IMAGETYPE_TIFF_MM : return 'tiff'; case IMAGETYPE_JPC : return 'jpc'; case IMAGETYPE_JP2 : return 'jp2'; case IMAGETYPE_JPX : return 'jpf'; case IMAGETYPE_JB2 : return 'jb2'; case IMAGETYPE_SWC : return 'swc'; case IMAGETYPE_IFF : return 'aiff'; case IMAGETYPE_WBMP : return 'wbmp'; case IMAGETYPE_XBM : return 'xbm'; default : return false; } } } ?>

« previous php.notes (#207845) next »