1 /* 2 +----------------------------------------------------------------------+ 3 | PHP Version 7 | 4 +----------------------------------------------------------------------+ 5 | Copyright (c) 1997-2018 The PHP Group | 6 +----------------------------------------------------------------------+ 7 | This source file is subject to version 3.01 of the PHP license, | 8 | that is bundled with this package in the file LICENSE, and is | 9 | available through the world-wide-web at the following url: | 10 | http://www.php.net/license/3_01.txt | 11 | If you did not receive a copy of the PHP license and are unable to | 12 | obtain it through the world-wide-web, please send a note to | 13 | license@php.net so we can mail you a copy immediately. | 14 +----------------------------------------------------------------------+ 15 | Authors: Rasmus Lerdorf <rasmus@php.net> | 16 | Marcus Boerger <helly@php.net> | 17 +----------------------------------------------------------------------+ 18 */ 19 20 #ifndef PHP_IMAGE_H 21 #define PHP_IMAGE_H 22 23 PHP_FUNCTION(getimagesize); 24 PHP_FUNCTION(getimagesizefromstring); 25 26 PHP_FUNCTION(image_type_to_mime_type); 27 PHP_FUNCTION(image_type_to_extension); 28 29 /* {{{ enum image_filetype 30 This enum is used to have ext/standard/image.c and ext/exif/exif.c use 31 the same constants for file types. 32 */ 33 typedef enum 34 { IMAGE_FILETYPE_UNKNOWN=0, 35 IMAGE_FILETYPE_GIF=1, 36 IMAGE_FILETYPE_JPEG, 37 IMAGE_FILETYPE_PNG, 38 IMAGE_FILETYPE_SWF, 39 IMAGE_FILETYPE_PSD, 40 IMAGE_FILETYPE_BMP, 41 IMAGE_FILETYPE_TIFF_II, /* intel */ 42 IMAGE_FILETYPE_TIFF_MM, /* motorola */ 43 IMAGE_FILETYPE_JPC, 44 IMAGE_FILETYPE_JP2, 45 IMAGE_FILETYPE_JPX, 46 IMAGE_FILETYPE_JB2, 47 IMAGE_FILETYPE_SWC, 48 IMAGE_FILETYPE_IFF, 49 IMAGE_FILETYPE_WBMP, 50 /* IMAGE_FILETYPE_JPEG2000 is a userland alias for IMAGE_FILETYPE_JPC */ 51 IMAGE_FILETYPE_XBM, 52 IMAGE_FILETYPE_ICO, 53 IMAGE_FILETYPE_WEBP, 54 /* WHEN EXTENDING: PLEASE ALSO REGISTER IN image.c:PHP_MINIT_FUNCTION(imagetypes) */ 55 IMAGE_FILETYPE_COUNT 56 } image_filetype; 57 /* }}} */ 58 59 PHP_MINIT_FUNCTION(imagetypes); 60 61 PHPAPI int php_getimagetype(php_stream *stream, char *filetype); 62 63 PHPAPI char * php_image_type_to_mime_type(int image_type); 64 65 #endif /* PHP_IMAGE_H */ 66