Skip to content

Commit 83e6dbc

Browse files
committed
Let getimagesize() and read_exif_data() share the same constants to
promote a little bit of code reuse here on two very similar problems.
1 parent 9c8ad66 commit 83e6dbc

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

ext/exif/exif.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -78,22 +78,6 @@ typedef unsigned char uchar;
7878
/* EXIF standard defines Copyright as "<Photographer> [ '\0' <Editor> ] ['\0']" */
7979
#define EXIF_MAX_COPYRIGHT 2
8080

81-
/* {{{ enum image_filetype
82-
This enum is used to have ext/standard/image.c and ext/exif/exif.c use
83-
the same constants for file types.
84-
*/
85-
typedef enum
86-
{ IMAGE_FILETYPE_UNKNOWN=0,
87-
IMAGE_FILETYPE_GIF=1,
88-
IMAGE_FILETYPE_JPEG,
89-
IMAGE_FILETYPE_PNG,
90-
IMAGE_FILETYPE_SWF,
91-
IMAGE_FILETYPE_PSD,
92-
IMAGE_FILETYPE_BMP,
93-
IMAGE_FILETYPE_TIFF
94-
} image_filetype;
95-
/* }}} */
96-
9781
/* {{{ structs
9882
This structure stores Exif header image elements in a simple manner
9983
Used to store camera data as extracted from the various ways that it can be

ext/standard/php_image.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,20 @@
2323

2424
PHP_FUNCTION(getimagesize);
2525

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
39+
} image_filetype;
40+
/* }}} */
41+
2642
#endif /* PHP_IMAGE_H */

0 commit comments

Comments
 (0)