SecBSD's official ports repository
This commit is contained in:
commit
2c0afcbbf3
64331 changed files with 5339189 additions and 0 deletions
54
lang/php/7.4/patches/patch-ext_gd_gd_c
Normal file
54
lang/php/7.4/patches/patch-ext_gd_gd_c
Normal file
|
@ -0,0 +1,54 @@
|
|||
based on
|
||||
|
||||
From b3646440b1808abf0874b6f89027ce53ec5da03f Mon Sep 17 00:00:00 2001
|
||||
From: Remi Collet <remi@php.net>
|
||||
Date: Mon, 13 Sep 2021 14:48:13 +0200
|
||||
Subject: [PATCH] Don't rely on libgd unused constants
|
||||
|
||||
Index: ext/gd/gd.c
|
||||
--- ext/gd/gd.c.orig
|
||||
+++ ext/gd/gd.c
|
||||
@@ -91,6 +91,11 @@ static int le_gd, le_gd_font;
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
+/* don't used libgd constants, not used, so going to be removed */
|
||||
+#define PHP_GD_FLIP_HORIZONTAL 1
|
||||
+#define PHP_GD_FLIP_VERTICAL 2
|
||||
+#define PHP_GD_FLIP_BOTH 3
|
||||
+
|
||||
#ifdef HAVE_GD_FREETYPE
|
||||
static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int, int);
|
||||
#endif
|
||||
@@ -1137,9 +1142,9 @@ PHP_MINIT_FUNCTION(gd)
|
||||
/* GD2 image format types */
|
||||
REGISTER_LONG_CONSTANT("IMG_GD2_RAW", GD2_FMT_RAW, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("IMG_GD2_COMPRESSED", GD2_FMT_COMPRESSED, CONST_CS | CONST_PERSISTENT);
|
||||
- REGISTER_LONG_CONSTANT("IMG_FLIP_HORIZONTAL", GD_FLIP_HORINZONTAL, CONST_CS | CONST_PERSISTENT);
|
||||
- REGISTER_LONG_CONSTANT("IMG_FLIP_VERTICAL", GD_FLIP_VERTICAL, CONST_CS | CONST_PERSISTENT);
|
||||
- REGISTER_LONG_CONSTANT("IMG_FLIP_BOTH", GD_FLIP_BOTH, CONST_CS | CONST_PERSISTENT);
|
||||
+ REGISTER_LONG_CONSTANT("IMG_FLIP_HORIZONTAL", PHP_GD_FLIP_HORIZONTAL, CONST_CS | CONST_PERSISTENT);
|
||||
+ REGISTER_LONG_CONSTANT("IMG_FLIP_VERTICAL", PHP_GD_FLIP_VERTICAL, CONST_CS | CONST_PERSISTENT);
|
||||
+ REGISTER_LONG_CONSTANT("IMG_FLIP_BOTH", PHP_GD_FLIP_BOTH, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("IMG_EFFECT_REPLACE", gdEffectReplace, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("IMG_EFFECT_ALPHABLEND", gdEffectAlphaBlend, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("IMG_EFFECT_NORMAL", gdEffectNormal, CONST_CS | CONST_PERSISTENT);
|
||||
@@ -4703,15 +4708,15 @@ PHP_FUNCTION(imageflip)
|
||||
}
|
||||
|
||||
switch (mode) {
|
||||
- case GD_FLIP_VERTICAL:
|
||||
+ case PHP_GD_FLIP_VERTICAL:
|
||||
gdImageFlipVertical(im);
|
||||
break;
|
||||
|
||||
- case GD_FLIP_HORINZONTAL:
|
||||
+ case PHP_GD_FLIP_HORIZONTAL:
|
||||
gdImageFlipHorizontal(im);
|
||||
break;
|
||||
|
||||
- case GD_FLIP_BOTH:
|
||||
+ case PHP_GD_FLIP_BOTH:
|
||||
gdImageFlipBoth(im);
|
||||
break;
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue