xref: /PHP-5.3/ext/standard/php_image.h (revision a2045ff3)
1 /*
2    +----------------------------------------------------------------------+
3    | PHP Version 5                                                        |
4    +----------------------------------------------------------------------+
5    | Copyright (c) 1997-2013 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 
27 PHP_FUNCTION(image_type_to_mime_type);
28 PHP_FUNCTION(image_type_to_extension);
29 
30 /* {{{ enum image_filetype
31    This enum is used to have ext/standard/image.c and ext/exif/exif.c use
32    the same constants for file types.
33 */
34 typedef enum
35 { IMAGE_FILETYPE_UNKNOWN=0,
36   IMAGE_FILETYPE_GIF=1,
37   IMAGE_FILETYPE_JPEG,
38   IMAGE_FILETYPE_PNG,
39   IMAGE_FILETYPE_SWF,
40   IMAGE_FILETYPE_PSD,
41   IMAGE_FILETYPE_BMP,
42   IMAGE_FILETYPE_TIFF_II, /* intel */
43   IMAGE_FILETYPE_TIFF_MM, /* motorola */
44   IMAGE_FILETYPE_JPC,
45   IMAGE_FILETYPE_JP2,
46   IMAGE_FILETYPE_JPX,
47   IMAGE_FILETYPE_JB2,
48   IMAGE_FILETYPE_SWC,
49   IMAGE_FILETYPE_IFF,
50   IMAGE_FILETYPE_WBMP,
51   /* IMAGE_FILETYPE_JPEG2000 is a userland alias for IMAGE_FILETYPE_JPC */
52   IMAGE_FILETYPE_XBM,
53   IMAGE_FILETYPE_ICO,
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 TSRMLS_DC);
62 
63 PHPAPI char * php_image_type_to_mime_type(int image_type);
64 
65 #endif /* PHP_IMAGE_H */
66