Skip to content

Commit 302baab

Browse files
committed
Move php_gd_image_reader and php_is_image_avif()
Move these from ext/gd/php_gd.h to ext/standard/php_image.h, so an optional extension depends on a standard library, not the reverse
1 parent c10268e commit 302baab

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

ext/gd/gd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <math.h>
3232
#include "SAPI.h"
3333
#include "php_gd.h"
34+
#include "ext/standard/php_image.h"
3435
#include "ext/standard/info.h"
3536
#include "php_open_temporary_file.h"
3637
#include "zend_object_handlers.h"

ext/gd/php_gd.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,6 @@ PHP_RSHUTDOWN_FUNCTION(gd);
8989

9090
PHP_GD_API struct gdImageStruct *php_gd_libgdimageptr_from_zval_p(zval* zp);
9191

92-
/* Struct and function to be used for testing whether an image is AVIF */
93-
typedef struct {
94-
php_stream * stream;
95-
zend_string * data;
96-
size_t data_pos;
97-
} php_gd_image_reader;
98-
99-
int php_is_image_avif(php_gd_image_reader * reader);
100-
10192
#else
10293

10394
#define phpext_gd_ptr NULL

ext/standard/image.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <unistd.h>
2727
#endif
2828
#include "php_image.h"
29-
#include "../gd/php_gd.h"
3029

3130
#if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB)
3231
#include "zlib.h"

ext/standard/php_image.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,13 @@ PHPAPI int php_getimagetype(php_stream *stream, const char *input, char *filetyp
5555

5656
PHPAPI char * php_image_type_to_mime_type(int image_type);
5757

58+
/* Struct and function to be used for testing whether an image is AVIF */
59+
typedef struct {
60+
php_stream * stream;
61+
zend_string * data;
62+
size_t data_pos;
63+
} php_gd_image_reader;
64+
65+
PHPAPI int php_is_image_avif(php_gd_image_reader * reader);
66+
5867
#endif /* PHP_IMAGE_H */

0 commit comments

Comments
 (0)