1 /* 2 +----------------------------------------------------------------------+ 3 | PHP Version 7 | 4 +----------------------------------------------------------------------+ 5 | Copyright (c) 1997-2017 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 /* $Id$ */ 21 22 #ifndef PHP_IMAGE_H 23 #define PHP_IMAGE_H 24 25 PHP_FUNCTION(getimagesize); 26 PHP_FUNCTION(getimagesizefromstring); 27 28 PHP_FUNCTION(image_type_to_mime_type); 29 PHP_FUNCTION(image_type_to_extension); 30 31 /* {{{ enum image_filetype 32 This enum is used to have ext/standard/image.c and ext/exif/exif.c use 33 the same constants for file types. 34 */ 35 typedef enum 36 { IMAGE_FILETYPE_UNKNOWN=0, 37 IMAGE_FILETYPE_GIF=1, 38 IMAGE_FILETYPE_JPEG, 39 IMAGE_FILETYPE_PNG, 40 IMAGE_FILETYPE_SWF, 41 IMAGE_FILETYPE_PSD, 42 IMAGE_FILETYPE_BMP, 43 IMAGE_FILETYPE_TIFF_II, /* intel */ 44 IMAGE_FILETYPE_TIFF_MM, /* motorola */ 45 IMAGE_FILETYPE_JPC, 46 IMAGE_FILETYPE_JP2, 47 IMAGE_FILETYPE_JPX, 48 IMAGE_FILETYPE_JB2, 49 IMAGE_FILETYPE_SWC, 50 IMAGE_FILETYPE_IFF, 51 IMAGE_FILETYPE_WBMP, 52 /* IMAGE_FILETYPE_JPEG2000 is a userland alias for IMAGE_FILETYPE_JPC */ 53 IMAGE_FILETYPE_XBM, 54 IMAGE_FILETYPE_ICO, 55 /* WHEN EXTENDING: PLEASE ALSO REGISTER IN image.c:PHP_MINIT_FUNCTION(imagetypes) */ 56 IMAGE_FILETYPE_COUNT 57 } image_filetype; 58 /* }}} */ 59 60 PHP_MINIT_FUNCTION(imagetypes); 61 62 PHPAPI int php_getimagetype(php_stream *stream, char *filetype); 63 64 PHPAPI char * php_image_type_to_mime_type(int image_type); 65 66 #endif /* PHP_IMAGE_H */ 67