php_image.h 2.4 KB

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