/usr/share/php/PHP/Compat/Function/image_type_to_mime_type.php is in php-compat 1.6.0a3-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | <?php
if (!defined('IMAGETYPE_GIF')) {
define('IMAGETYPE_GIF', 1);
}
if (!defined('IMAGETYPE_JPEG')) {
define('IMAGETYPE_JPEG', 2);
}
if (!defined('IMAGETYPE_PNG')) {
define('IMAGETYPE_PNG', 3);
}
if (!defined('IMAGETYPE_SWF')) {
define('IMAGETYPE_SWF', 4);
}
if (!defined('IMAGETYPE_PSD')) {
define('IMAGETYPE_PSD', 5);
}
if (!defined('IMAGETYPE_BMP')) {
define('IMAGETYPE_BMP', 6);
}
if (!defined('IMAGETYPE_TIFF_II')) {
define('IMAGETYPE_TIFF_II', 7);
}
if (!defined('IMAGETYPE_TIFF_MM')) {
define('IMAGETYPE_TIFF_MM', 8);
}
if (!defined('IMAGETYPE_JPC')) {
define('IMAGETYPE_JPC', 9);
}
if (!defined('IMAGETYPE_JP2')) {
define('IMAGETYPE_JP2', 10);
}
if (!defined('IMAGETYPE_JPX')) {
define('IMAGETYPE_JPX', 11);
}
if (!defined('IMAGETYPE_JB2')) {
define('IMAGETYPE_JB2', 12);
}
if (!defined('IMAGETYPE_SWC')) {
define('IMAGETYPE_SWC', 13);
}
if (!defined('IMAGETYPE_IFF')) {
define('IMAGETYPE_IFF', 14);
}
if (!defined('IMAGETYPE_WBMP')) {
define('IMAGETYPE_WBMP', 15);
}
if (!defined('IMAGETYPE_XBM')) {
define('IMAGETYPE_XBM', 16);
}
/**
* Replace image_type_to_mime_type()
*
* @category PHP
* @package PHP_Compat
* @license LGPL - http://www.gnu.org/licenses/lgpl.html
* @copyright 2004-2007 Aidan Lister <aidan@php.net>, Arpad Ray <arpad@php.net>
* @link http://php.net/function.image_type_to_mime_type
* @author Aidan Lister <aidan@php.net>
* @version $Revision: 269597 $
* @since PHP 4.3.0
* @require PHP 4.0.0 (user_error)
*/
function php_compat_image_type_to_mime_type($imagetype)
{
switch ($imagetype):
case IMAGETYPE_GIF:
return 'image/gif';
break;
case IMAGETYPE_JPEG:
return 'image/jpeg';
break;
case IMAGETYPE_PNG:
return 'image/png';
break;
case IMAGETYPE_SWF:
case IMAGETYPE_SWC:
return 'application/x-shockwave-flash';
break;
case IMAGETYPE_PSD:
return 'image/psd';
break;
case IMAGETYPE_BMP:
return 'image/bmp';
break;
case IMAGETYPE_TIFF_MM:
case IMAGETYPE_TIFF_II:
return 'image/tiff';
break;
case IMAGETYPE_JP2:
return 'image/jp2';
break;
case IMAGETYPE_IFF:
return 'image/iff';
break;
case IMAGETYPE_WBMP:
return 'image/vnd.wap.wbmp';
break;
case IMAGETYPE_XBM:
return 'image/xbm';
break;
case IMAGETYPE_JPX:
case IMAGETYPE_JB2:
case IMAGETYPE_JPC:
default:
return 'application/octet-stream';
break;
endswitch;
}
// Define
if (!function_exists('image_type_to_mime_type')) {
function image_type_to_mime_type($imagetype)
{
return php_compat_image_type_to_mime_type($imagetype);
}
}
|