54#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED)
78#if defined(HAVE_GD_FREETYPE) && defined(HAVE_GD_BUNDLED)
80# include FT_FREETYPE_H
83#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED)
88#define M_PI 3.14159265358979323846
92#define PHP_GD_FLIP_HORIZONTAL 1
93#define PHP_GD_FLIP_VERTICAL 2
94#define PHP_GD_FLIP_BOTH 3
96#ifdef HAVE_GD_FREETYPE
145 zend_throw_error(
NULL,
"You cannot initialize a GdImage object except through helper functions");
164 return php_gd_exgdimage_from_zobj_p(
Z_OBJ_P(zp))->image;
172 memset(intern, 0, block_len);
180static void php_gd_image_object_free(
zend_object *intern)
183 if (img_obj_ptr->
image) {
198 php_gd_exgdimage_from_zobj_p(
Z_OBJ_P(
val))->image = image;
201static void php_gd_object_minit_helper(
void)
205 gd_image_ce->default_object_handlers = &php_gd_image_object_handlers;
209 php_gd_image_object_handlers.clone_obj =
NULL;
210 php_gd_image_object_handlers.free_obj = php_gd_image_object_free;
211 php_gd_image_object_handlers.get_constructor = php_gd_image_object_get_constructor;
242 zobj->handlers = &php_gd_font_object_handlers;
264 zend_throw_error(
NULL,
"You cannot initialize a GdFont object except through helper functions");
268static void php_gd_font_minit_helper(
void)
270 gd_font_ce = register_class_GdFont();
271 gd_font_ce->create_object = php_gd_font_object_create;
275 php_gd_font_object_handlers.clone_obj =
NULL;
276 php_gd_font_object_handlers.free_obj = php_gd_font_object_free;
277 php_gd_font_object_handlers.get_constructor = php_gd_font_object_get_constructor;
334 php_gd_object_minit_helper();
335 php_gd_font_minit_helper();
337#if defined(HAVE_GD_FREETYPE) && defined(HAVE_GD_BUNDLED)
344 register_gd_symbols(module_number);
353#if defined(HAVE_GD_FREETYPE) && defined(HAVE_GD_BUNDLED)
364#ifdef HAVE_GD_FREETYPE
371#ifdef HAVE_GD_BUNDLED
372#define PHP_GD_VERSION_STRING "bundled (2.1.0 compatible)"
374# define PHP_GD_VERSION_STRING GD_VERSION_STRING
385#ifdef HAVE_GD_BUNDLED
389#ifdef HAVE_GD_LIBVERSION
394#ifdef HAVE_GD_FREETYPE
397#ifdef HAVE_GD_BUNDLED
402 snprintf(tmp,
sizeof(tmp),
"%d.%d.%d", FREETYPE_MAJOR, FREETYPE_MINOR, FREETYPE_PATCH);
403#elif defined(FREETYPE_MAJOR)
404 snprintf(tmp,
sizeof(tmp),
"%d.%d", FREETYPE_MAJOR, FREETYPE_MINOR);
419#ifdef HAVE_GD_BUNDLED
427#ifdef HAVE_GD_BUNDLED
434#ifdef HAVE_GD_BUNDLED
437 snprintf(tmp,
sizeof(tmp),
"%d", XpmLibraryVersion());
443#ifdef USE_GD_JISX0208
472#ifdef HAVE_GD_FREETYPE
474 add_assoc_string(
return_value,
"FreeType Linkage",
"with freetype");
517#ifdef USE_GD_JISX0208
518 add_assoc_bool(
return_value,
"JIS-mapped Japanese Font Support", 1);
520 add_assoc_bool(
return_value,
"JIS-mapped Japanese Font Support", 0);
525#define FLIPWORD(a) (((a & 0xff000000) >> 24) | ((a & 0x00ff0000) >> 8) | ((a & 0x0000ff00) << 8) | ((a & 0x000000ff) << 24))
531 int hdr_size =
sizeof(
gdFont) -
sizeof(
char *);
532 int body_size,
n = 0, b, i, body_size_check;
541 if (stream ==
NULL) {
559 while (b < hdr_size && (
n =
php_stream_read(stream, (
char*)&font[b], hdr_size - b)) > 0) {
585 body_size = font->
w * font->
h * font->
nchars;
586 if (body_size != body_size_check) {
596 body_size = font->
w * font->
h * font->
nchars;
599 if (body_size != body_size_check) {
634 zval *IM, *styles, *item;
647 num_styles = zend_hash_num_elements(
Z_ARRVAL_P(styles));
648 if (num_styles == 0) {
657 stylearr[index++] = zval_get_long(item);
679 if (x_size <= 0 || x_size >=
INT_MAX) {
684 if (y_size <= 0 || y_size >=
INT_MAX) {
851 zend_long cx, cy, w, h, ST, E, col, style;
945#define CHECK_RGBA_RANGE(component, name, argument_number) \
946 if (component < 0 || component > gd##name##Max) { \
947 zend_argument_value_error(argument_number, "must be between 0 and %d (inclusive)", gd##name##Max); \
1066 int srcH, srcW, dstH, dstW, srcY, srcX, dstY, dstX;
1104 bool client_area =
false;
1120 window = (HWND) lwindow_handle;
1122 if (!IsWindow(window)) {
1130 GetClientRect(window, &rc);
1134 GetWindowRect(window, &rc);
1135 Width = rc.right - rc.left;
1136 Height = rc.bottom - rc.top;
1139 Width = (Width/4)*4;
1141 memDC = CreateCompatibleDC(hdc);
1142 memBM = CreateCompatibleBitmap(hdc, Width, Height);
1143 hOld = (HBITMAP) SelectObject (memDC, memBM);
1145 PrintWindow(window, memDC, (UINT) client_area);
1150 for (y=0; y <= Height; y++) {
1151 for (x=0; x <= Width; x++) {
1152 int c = GetPixel(memDC, x,y);
1158 SelectObject(memDC,hOld);
1159 DeleteObject(memBM);
1161 ReleaseDC( 0, hdc );
1174 HWND window = GetDesktopWindow();
1190 GetWindowRect(window, &rc);
1191 Width = rc.right - rc.left;
1192 Height = rc.bottom - rc.top;
1194 Width = (Width/4)*4;
1196 memDC = CreateCompatibleDC(hdc);
1197 memBM = CreateCompatibleBitmap(hdc, Width, Height);
1198 hOld = (HBITMAP) SelectObject (memDC, memBM);
1199 BitBlt( memDC, 0, 0, Width, Height , hdc, rc.left, rc.top , SRCCOPY );
1204 for (y=0; y <= Height; y++) {
1205 for (x=0; x <= Width; x++) {
1206 int c = GetPixel(memDC, x,y);
1212 SelectObject(memDC,hOld);
1213 DeleteObject(memBM);
1215 ReleaseDC( 0, hdc );
1240 if (degrees < (
double)(
INT_MIN / 100) || degrees > (
double)(
INT_MAX / 100)) {
1248 if (im_dst ==
NULL) {
1307 if (x_size <= 0 || x_size >=
INT_MAX) {
1312 if (y_size <= 0 || y_size >=
INT_MAX) {
1338 ret |= PHP_IMG_WBMP;
1343 ret |= PHP_IMG_WEBP;
1352 ret |= PHP_IMG_AVIF;
1363static int _php_ctx_getmbi(
gdIOCtx *ctx)
1368 i = (ctx->
getC)(ctx);
1369 if (i < 0 || mbi > (
INT_MAX >> 7)) {
1372 mbi = (mbi << 7) | (i & 0x7f);
1382static const char php_sig_gd2[3] = {
'g',
'd',
'2'};
1391 if (!memcmp(
ZSTR_VAL(
data), php_sig_gd2,
sizeof(php_sig_gd2))) {
1392 return PHP_GDIMG_TYPE_GD2;
1394 return PHP_GDIMG_TYPE_JPG;
1396 return PHP_GDIMG_TYPE_PNG;
1398 return PHP_GDIMG_TYPE_GIF;
1400 return PHP_GDIMG_TYPE_BMP;
1402 return PHP_GDIMG_TYPE_WEBP;
1407 if (image_stream !=
NULL) {
1412 return PHP_GDIMG_TYPE_AVIF;
1419 if (_php_ctx_getmbi(io_ctx) == 0 && _php_ctx_getmbi(io_ctx) >= 0) {
1421 return PHP_GDIMG_TYPE_WBM;
1443 im = (*ioctx_func_p)(io_ctx);
1467 imtype = _php_image_type(
data);
1470 case PHP_GDIMG_TYPE_JPG:
1479 case PHP_GDIMG_TYPE_PNG:
1488 case PHP_GDIMG_TYPE_GIF:
1492 case PHP_GDIMG_TYPE_WBM:
1496 case PHP_GDIMG_TYPE_GD2:
1500 case PHP_GDIMG_TYPE_BMP:
1504 case PHP_GDIMG_TYPE_WEBP:
1513 case PHP_GDIMG_TYPE_AVIF:
1546 long ignore_warning;
1549 if (image_type == PHP_GDIMG_TYPE_GD2PART) {
1572 if (stream ==
NULL) {
1581 }
else if (ioctx_func_p || image_type == PHP_GDIMG_TYPE_GD2PART) {
1604 if (image_type == PHP_GDIMG_TYPE_GD2PART) {
1607 im = (*ioctx_func_p)(io_ctx);
1621 switch (image_type) {
1622 case PHP_GDIMG_TYPE_GD2PART:
1626 case PHP_GDIMG_TYPE_XPM:
1632 case PHP_GDIMG_TYPE_JPG:
1633 ignore_warning =
INI_INT(
"gd.jpeg_ignore_warning");
1774 size_t file_len = 0;
1778 switch (image_type) {
1779 case PHP_GDIMG_TYPE_GD:
1784 case PHP_GDIMG_TYPE_GD2:
1793 if (quality < INT_MIN || quality >
INT_MAX) {
1801 PHP_GD_CHECK_OPEN_BASEDIR(
file,
"Invalid filename");
1809 switch (image_type) {
1810 case PHP_GDIMG_TYPE_GD:
1813 case PHP_GDIMG_TYPE_GD2:
1814 if (quality == -1) {
1835 switch (image_type) {
1836 case PHP_GDIMG_TYPE_GD:
1839 case PHP_GDIMG_TYPE_GD2:
1840 if (quality == -1) {
1850 while ((b =
fread(
buf, 1,
sizeof(
buf), tmp)) > 0) {
1867 size_t file_len = 0;
1869 bool foreground_color_is_null =
true;
1886 if (stream ==
NULL) {
1890 ctx = create_stream_context(stream, 1);
1892 ctx = create_output_context(
NULL, 0);
1895 if (foreground_color_is_null) {
1902 foreground_color = i;
1927 ctx = create_output_context(to_zval, 2);
1945 zend_long quality = -1, basefilter = -1;
1956 ctx = create_output_context(to_zval, 2);
1961 if (quality < -1 || quality > 9) {
1967#ifdef HAVE_GD_BUNDLED
1996 ctx = create_output_context(to_zval, 2);
2032 ctx = create_output_context(to_zval, 2);
2037 if (quality < -1 || quality > 100) {
2043 if (speed < -1 || speed > 10) {
2047 }
else if (speed == -1) {
2076 ctx = create_output_context(to_zval, 2);
2081 if (quality < -1 || quality > 100) {
2101 bool foreground_color_is_null =
true;
2116 ctx = create_output_context(to_zval, 2);
2121 if (foreground_color_is_null) {
2128 foreground_color = i;
2158 bool compressed =
true;
2172 ctx = create_output_context(to_zval, 2);
2232 zval *dstim, *srcim;
2437 im->
green[col] = green;
2438 im->
blue[col] = blue;
2439 im->
alpha[col] = alpha;
2483 double input, output, gamma;
2496 if (output <= 0.0) {
2501 gamma = input / output;
2525 im->
red[i] = (int)((
pow((im->
red[i] / 255.0), gamma) * 255) + .5);
2526 im->
green[i] = (int)((
pow((im->
green[i] / 255.0), gamma) * 255) + .5);
2527 im->
blue[i] = (int)((
pow((im->
blue[i] / 255.0), gamma) * 255) + .5);
2774 bool COL_IS_NULL =
true;
2798 bool INT_IS_NULL =
true;
2826 bool COL_IS_NULL =
true;
2830 int npoints, col, nelem, i;
2842 NPOINTS = zend_hash_num_elements(
Z_ARRVAL_P(POINTS));
2843 if (NPOINTS % 2 != 0) {
2857 nelem = zend_hash_num_elements(
Z_ARRVAL_P(POINTS));
2863 if (nelem < npoints * 2) {
2864 zend_value_error(
"Trying to use %d points in array with only %d points", npoints, nelem/2);
2870 for (i = 0; i < npoints; i++) {
2872 points[i].
x = zval_get_long(var);
2875 points[i].
y = zval_get_long(var);
2925 return php_gd_font_object_from_zend_object(font_obj)->font;
2954 font = php_find_gd_font(font_obj, font_int);
2977 int cx, cy, px, py, fline;
2985 fline = (c - f->
offset) * f->
h * f->
w;
2986 for (py = y; (py > (y - f->
w)); py--) {
2987 for (px = x; (px < (x + f->
h)); px++) {
2988 if (f->
data[fline + cy * f->
w + cx]) {
3011 int ch = 0, col, x, y, i, l = 0;
3012 unsigned char *str =
NULL;
3039 gdFontPtr font = php_find_gd_font(font_obj, font_int);
3046 php_gdimagecharup(im, font, x, y,
ch, col);
3049 for (i = 0; (i < l); i++) {
3050 gdImageChar(im, font, x, y, (
int) ((
unsigned char) str[i]), col);
3055 for (i = 0; (i < l); i++) {
3104 int srcH, srcW, srcY, srcX, dstY, dstX;
3127 gdImageCopy(im_dst, im_src, dstX, dstY, srcX, srcY, srcW, srcH);
3138 int srcH, srcW, srcY, srcX, dstY, dstX, pct;
3174 int srcH, srcW, srcY, srcX, dstY, dstX, pct;
3210 int srcH, srcW, dstH, dstW, srcY, srcX, dstY, dstX;
3339#define TTFTEXT_DRAW 0
3340#define TTFTEXT_BBOX 1
3342#ifdef HAVE_GD_FREETYPE
3363 size_t str_len, fontname_len;
3365 double ptsize, angle;
3366 char *str =
NULL, *fontname =
NULL;
3375 if (
zend_parse_parameters(
ZEND_NUM_ARGS(),
"Oddlllss|a", &IM,
gd_image_ce, &ptsize, &angle, &x, &y, &col, &fontname, &fontname_len, &str, &str_len, &EXT) ==
FAILURE) {
3393 angle = angle * (
M_PI/180);
3423 PHP_GD_CHECK_OPEN_BASEDIR(fontname,
"Invalid font filename");
3440 for (i = 0; i < 8; i++) {
3448#define PHP_GD_SINGLE_RES \
3450 gdImagePtr im_src; \
3451 if (zend_parse_parameters(1, "O", &SIM, gd_image_ce) == FAILURE) { \
3454 im_src = php_gd_libgdimageptr_from_zval_p(SIM);
3678 uint32_t num_colors = zend_hash_num_elements(
Z_ARRVAL_P(hash_colors));
3682 if (num_colors == 0) {
3707 image_filter filters[] =
3709 php_image_filter_negate ,
3710 php_image_filter_grayscale,
3711 php_image_filter_brightness,
3712 php_image_filter_contrast,
3713 php_image_filter_colorize,
3714 php_image_filter_edgedetect,
3715 php_image_filter_emboss,
3716 php_image_filter_gaussian_blur,
3717 php_image_filter_selective_blur,
3718 php_image_filter_mean_removal,
3719 php_image_filter_smooth,
3720 php_image_filter_pixelate,
3721 php_image_filter_scatter
3730 if (filtertype >= 0 && filtertype <= IMAGE_FILTER_MAX) {
3739 zval *SIM, *hash_matrix;
3743 int nelem, i,
j,
res;
3744 float matrix[3][3] = {{0,0,0}, {0,0,0}, {0,0,0}};
3755 nelem = zend_hash_num_elements(
Z_ARRVAL_P(hash_matrix));
3761 for (i=0; i<3; i++) {
3763 if (zend_hash_num_elements(
Z_ARRVAL_P(var)) != 3 ) {
3768 for (
j=0;
j<3;
j++) {
3770 matrix[i][
j] = (float) zval_get_double(var2);
3784 float div_float = (float) div;
3881 rect.
x = zval_get_long(tmp);
3888 rect.
y = zval_get_long(tmp);
3895 rect.
width = zval_get_long(tmp);
3902 rect.
height = zval_get_long(tmp);
3930 if (im_crop ==
NULL) {
3944 double threshold = 0.5f;
3980 if (im_crop ==
NULL) {
3994 int new_width, new_height;
4015 if (tmp_h < 0 && tmp_w < 0) {
4016 zend_value_error(
"Argument #2 ($width) and argument #3 ($height) cannot be both negative");
4020 if (tmp_h < 0 || tmp_w < 0) {
4027 if (src_x && tmp_h < 0) {
4028 tmp_h = tmp_w * src_y / src_x;
4030 if (src_y && tmp_w < 0) {
4031 tmp_w = tmp_h * src_x / src_y;
4056 if (im_scaled ==
NULL) {
4089 if ((nelems = zend_hash_num_elements(
Z_ARRVAL_P(z_affine))) != 6) {
4094 for (i = 0; i < nelems; i++) {
4095 if ((zval_affine_elem = zend_hash_index_find_deref(
Z_ARRVAL_P(z_affine), i)) !=
NULL) {
4096 switch (
Z_TYPE_P(zval_affine_elem)) {
4098 affine[i] =
Z_LVAL_P(zval_affine_elem);
4105 affine[i] =
Z_DVAL_P(zval_affine_elem);
4112 affine[i] = zval_get_double(zval_affine_elem);
4125 if (z_rect !=
NULL) {
4127 rect.
x = zval_get_long(tmp);
4134 rect.
y = zval_get_long(tmp);
4141 rect.
width = zval_get_long(tmp);
4148 rect.
height = zval_get_long(tmp);
4192 x = zval_get_double(tmp);
4199 y = zval_get_double(tmp);
4218 angle = zval_get_double(
options);
4239 for (i = 0; i < 6; i++) {
4262 if (zend_hash_num_elements(
Z_ARRVAL_P(z_m1)) != 6) {
4267 if (zend_hash_num_elements(
Z_ARRVAL_P(z_m2)) != 6) {
4272 for (i = 0; i < 6; i++) {
4273 if ((tmp = zend_hash_index_find_deref(
Z_ARRVAL_P(z_m1), i)) !=
NULL) {
4282 m1[i] = zval_get_double(tmp);
4290 if ((tmp = zend_hash_index_find_deref(
Z_ARRVAL_P(z_m2), i)) !=
NULL) {
4299 m2[i] = zval_get_double(tmp);
4313 for (i = 0; i < 6; i++) {
4330#ifdef HAVE_GD_GET_INTERPOLATION
4366 bool res_x_is_null =
true, res_y_is_null =
true;
4377 if (!res_x_is_null && !res_y_is_null) {
4388 }
else if (!res_x_is_null && res_y_is_null) {
4395 }
else if (res_x_is_null && !res_y_is_null) {
4419#define CTX_PUTC(c,ctx) ctx->putC(ctx, c)
4421static void _php_image_output_putc(
struct gdIOCtx *ctx,
int c)
4427 unsigned char ch = (
unsigned char) c;
4431static int _php_image_output_putbuf(
struct gdIOCtx *ctx,
const void*
buf,
int l)
4436static void _php_image_output_ctxfree(
struct gdIOCtx *ctx)
4441static void _php_image_stream_putc(
struct gdIOCtx *ctx,
int c) {
4447static int _php_image_stream_putbuf(
struct gdIOCtx *ctx,
const void*
buf,
int l)
4453static void _php_image_stream_ctxfree(
struct gdIOCtx *ctx)
4461static void _php_image_stream_ctxfreeandclose(
struct gdIOCtx *ctx)
4473 ctx->
putC = _php_image_stream_putc;
4474 ctx->
putBuf = _php_image_stream_putbuf;
4476 ctx->
gd_free = _php_image_stream_ctxfreeandclose;
4478 ctx->
gd_free = _php_image_stream_ctxfree;
4480 ctx->
data = (
void *)stream;
4488 if (to_zval !=
NULL) {
4490 int close_stream = 1;
4496 if (stream ==
NULL) {
4507 if (stream ==
NULL) {
4515 ctx = create_stream_context(stream, close_stream);
4519 ctx->
putC = _php_image_output_putc;
4520 ctx->
putBuf = _php_image_output_putbuf;
4521 ctx->
gd_free = _php_image_output_ctxfree;
file(string $filename, int $flags=0, $context=null)
fseek($stream, int $offset, int $whence=SEEK_SET)
fread($stream, int $length)
pow(mixed $num, mixed $exponent)
memset(ptr, 0, type->size)
zend_ffi_ctype_name_buf buf
#define CHECK_RGBA_RANGE(component, name, argument_number)
#define PHP_GD_SINGLE_RES
void php_gd_assign_libgdimageptr_as_extgdimage(zval *val, gdImagePtr image)
struct _php_gd_font_object php_gd_font_object
zend_module_entry gd_module_entry
struct _gd_ext_image_object php_gd_image_object
zend_class_entry * gd_image_ce
void php_gd_error_method(int type, const char *format, va_list args)
zend_object * php_gd_image_object_create(zend_class_entry *class_type)
#define PHP_GD_FLIP_HORIZONTAL
#define PHP_GD_FLIP_VERTICAL
#define PHP_GD_VERSION_STRING
int overflow2(int a, int b)
PHP_GD_API gdImagePtr php_gd_libgdimageptr_from_zval_p(zval *zp)
#define gdImageBlue(im, c)
char * gdImageStringFTEx(gdImage *im, int *brect, int fg, char *fontlist, double ptsize, double angle, int x, int y, char *string, gdFTStringExtraPtr strex)
#define gdTrueColorGetBlue(c)
int gdImageScatterColor(gdImagePtr im, int sub, int plus, int colors[], unsigned int num_colors)
void gdImageJpegCtx(gdImagePtr im, gdIOCtx *out, int quality)
#define gdImageResolutionX(im)
void gdFontCacheMutexShutdown(void)
gdImagePtr gdImageCreateFromGifCtx(gdIOCtxPtr in)
int gdTransformAffineGetImage(gdImagePtr *dst, const gdImagePtr src, gdRectPtr src_area, const double affine[6])
int gdImageSetInterpolationMethod(gdImagePtr im, gdInterpolationMethod id)
int gdAffineShearVertical(double dst[6], const double angle)
int gdImageEdgeDetectQuick(gdImagePtr src)
gdImagePtr gdImageCreateFromBmpCtx(gdIOCtxPtr infile)
gdImagePtr gdImageCreateFromPngCtx(gdIOCtxPtr in)
struct gdRect * gdRectPtr
gdImagePtr gdImageCreateFromGd2Ctx(gdIOCtxPtr in)
#define gdTrueColorGetGreen(c)
#define gdImageTrueColor(im)
gdImagePtr gdImageCreateFromGif(FILE *fd)
int gdImageNegate(gdImagePtr src)
#define gdImageTrueColorPixel(im, x, y)
int gdImageTrueColorToPalette(gdImagePtr im, int ditherFlag, int colorsWanted)
gdImagePtr gdImageCreateFromXbm(FILE *fd)
gdImagePtr gdImageCreateFromTgaCtx(gdIOCtx *ctx)
gdImagePtr gdImageScale(const gdImagePtr src, const unsigned int new_width, const unsigned int new_height)
gdImagePtr gdImageCreateFromWebp(FILE *fd)
#define gdTrueColorGetAlpha(c)
void gdFontCacheMutexSetup(void)
#define gdImageGetTransparent(im)
gdImagePtr gdImageCreateFromGd2Part(FILE *in, int srcx, int srcy, int w, int h)
gdImagePtr gdImageCreateFromAvifCtx(gdIOCtx *infile)
int gdImageGaussianBlur(gdImagePtr im)
int gdAffineConcat(double dst[6], const double m1[6], const double m2[6])
gdImagePtr gdImageCreateFromWBMPCtx(gdIOCtx *infile)
int gdAffineRotate(double dst[6], const double angle)
void gdImageAvifCtx(gdImagePtr im, gdIOCtx *outfile, int quality, int speed)
void gdFontCacheShutdown(void)
gdInterpolationMethod gdImageGetInterpolationMethod(gdImagePtr im)
gdImagePtr gdImageCreateFromJpegCtx(gdIOCtx *infile)
gdImagePtr gdImageCreateFromTga(FILE *fp)
const char * gdJpegGetVersionString(void)
gdImagePtr gdImageCreateFromJpeg(FILE *infile)
int gdImageEmboss(gdImagePtr im)
void gdImageFlipVertical(gdImagePtr im)
gdImagePtr gdImageRotateInterpolated(const gdImagePtr src, const float angle, int bgcolor)
int gdImageConvolution(gdImagePtr src, float ft[3][3], float filter_div, float offset)
#define gdTrueColorGetRed(c)
gdImagePtr gdImageCreateFromXpm(char *filename)
int gdAffineTranslate(double dst[6], const double offset_x, const double offset_y)
char * gdImageStringFT(gdImage *im, int *brect, int fg, char *fontlist, double ptsize, double angle, int x, int y, char *string)
void gdImageGd(gdImagePtr im, FILE *out)
gdImagePtr gdImageCropAuto(gdImagePtr im, const unsigned int mode)
int gdAffineShearHorizontal(double dst[6], const double angle)
gdImagePtr gdImageCrop(gdImagePtr src, const gdRectPtr crop)
void gdImagePngCtxEx(gdImagePtr im, gdIOCtx *out, int level, int basefilter)
gdImagePtr gdImageCreateFromGd2PartCtx(gdIOCtxPtr in, int srcx, int srcy, int w, int h)
void gdImageWBMPCtx(gdImagePtr image, int fg, gdIOCtx *out)
#define gdImageColorsTotal(im)
gdImagePtr gdImageCreateFromAvif(FILE *infile)
int gdImagePixelate(gdImagePtr im, int block_size, const unsigned int mode)
int gdImageColor(gdImagePtr src, const int red, const int green, const int blue, const int alpha)
void gdImageFlipBoth(gdImagePtr im)
@ GD_AFFINE_SHEAR_HORIZONTAL
@ GD_AFFINE_SHEAR_VERTICAL
gdImagePtr gdImageCreateFromBmp(FILE *inFile)
gdImagePtr gdImageCreateFromWBMP(FILE *inFile)
int gdImageColorMatch(gdImagePtr im1, gdImagePtr im2)
#define gdTrueColorAlpha(r, g, b, a)
void gdImageGifCtx(gdImagePtr im, gdIOCtx *out)
int gdImageMeanRemoval(gdImagePtr im)
gdImagePtr gdImageCreateFromJpegEx(FILE *infile, int ignore_warning)
gdImagePtr gdImageCropThreshold(gdImagePtr im, const unsigned int color, const float threshold)
#define gdImageGreen(im, c)
void gdImageWebpCtx(gdImagePtr im, gdIOCtx *outfile, int quality)
void gdImageFlipHorizontal(gdImagePtr im)
#define gdImageResolutionY(im)
struct gdPoint * gdPointPtr
gdImagePtr gdImageCreateFromGdCtx(gdIOCtxPtr in)
int gdImageContrast(gdImagePtr src, double contrast)
const char * gdPngGetVersionString(void)
#define gdTrueColor(r, g, b)
int gdImageBrightness(gdImagePtr src, int brightness)
int gdImageSmooth(gdImagePtr im, float weight)
int gdAffineScale(double dst[6], const double scale_x, const double scale_y)
gdIOCtx * gdNewDynamicCtxEx(int size, void *data, int freeFlag)
int gdImageGrayScale(gdImagePtr src)
gdImagePtr gdImageCreateFromGd(FILE *in)
void gdImageBmpCtx(gdImagePtr im, gdIOCtxPtr out, int compression)
void gdImageGd2(gdImagePtr im, FILE *out, int cs, int fmt)
#define gdImageGetInterlaced(im)
gdImagePtr gdImageCreateFromGd2(FILE *in)
#define gdImageAlpha(im, c)
#define gdImageBoundsSafe(im, x, y)
gdImagePtr gdImageCreateFromWebpCtx(gdIOCtxPtr in)
gdImagePtr gdImageCreateFromPng(FILE *fd)
int gdImageSelectiveBlur(gdImagePtr src)
int gdImageScatter(gdImagePtr im, int sub, int plus)
#define gdImageRed(im, c)
void gdImageXbmCtx(gdImagePtr image, char *file_name, int fg, gdIOCtx *out)
imagecharup(GdImage $image, GdFont|int $font, int $x, int $y, string $char, int $color)
imagebmp(GdImage $image, $file=null, bool $compressed=true)
imagecreatefromgif(string $filename)
imagefilledpolygon(GdImage $image, array $points, int $num_points_or_color, ?int $color=null)
imagecreatefromgd2(string $filename)
imagecreatetruecolor(int $width, int $height)
imagepalettecopy(GdImage $dst, GdImage $src)
imagefilledrectangle(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color)
imageaffinematrixconcat(array $matrix1, array $matrix2)
imagetruecolortopalette(GdImage $image, bool $dither, int $num_colors)
imageflip(GdImage $image, int $mode)
imagefontwidth(GdFont|int $font)
imagecreatefromwbmp(string $filename)
imagecreate(int $width, int $height)
imagerotate(GdImage $image, float $angle, int $background_color)
imagecolorset(GdImage $image, int $color, int $red, int $green, int $blue, int $alpha=0)
imagefontheight(GdFont|int $font)
imageopenpolygon(GdImage $image, array $points, int $num_points_or_color, ?int $color=null)
imageantialias(GdImage $image, bool $enable)
imagecopy(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height)
imagejpeg(GdImage $image, $file=null, int $quality=-1)
imagesetstyle(GdImage $image, array $style)
imagecreatefromgd(string $filename)
imagecopyresized(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height)
imagecolortransparent(GdImage $image, ?int $color=null)
imagecropauto(GdImage $image, int $mode=IMG_CROP_DEFAULT, float $threshold=0.5, int $color=-1)
imagepng(GdImage $image, $file=null, int $quality=-1, int $filters=-1)
imagecolorstotal(GdImage $image)
imagearc(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color)
imagedashedline(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color)
imagecreatefromgd2part(string $filename, int $x, int $y, int $width, int $height)
imagecopyresampled(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height)
imageaffine(GdImage $image, array $affine, ?array $clip=null)
imagecolorresolve(GdImage $image, int $red, int $green, int $blue)
imagelayereffect(GdImage $image, int $effect)
imagecolormatch(GdImage $image1, GdImage $image2)
imagestringup(GdImage $image, GdFont|int $font, int $x, int $y, string $string, int $color)
imagecolorclosesthwb(GdImage $image, int $red, int $green, int $blue)
imagefttext(GdImage $image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options=[])
imagexbm(GdImage $image, ?string $filename, ?int $foreground_color=null)
imagesetinterpolation(GdImage $image, int $method=IMG_BILINEAR_FIXED)
imagecreatefromavif(string $filename)
imagesetclip(GdImage $image, int $x1, int $y1, int $x2, int $y2)
imagegif(GdImage $image, $file=null)
imageloadfont(string $filename)
imagescale(GdImage $image, int $width, int $height=-1, int $mode=IMG_BILINEAR_FIXED)
imageellipse(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $color)
imagecolorexact(GdImage $image, int $red, int $green, int $blue)
imagecolorsforindex(GdImage $image, int $color)
imagedestroy(GdImage $image)
imageavif(GdImage $image, $file=null, int $quality=-1, int $speed=-1)
imageftbbox(float $size, float $angle, string $font_filename, string $string, array $options=[])
imagecreatefrompng(string $filename)
imageinterlace(GdImage $image, ?bool $enable=null)
imagecreatefromwebp(string $filename)
imagerectangle(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color)
imagecolorallocatealpha(GdImage $image, int $red, int $green, int $blue, int $alpha)
imagepolygon(GdImage $image, array $points, int $num_points_or_color, ?int $color=null)
imagecopymerge(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct)
imagecolorallocate(GdImage $image, int $red, int $green, int $blue)
imagesetpixel(GdImage $image, int $x, int $y, int $color)
imagecreatefromxbm(string $filename)
imagealphablending(GdImage $image, bool $enable)
imagefilter(GdImage $image, int $filter,... $args)
imagecolordeallocate(GdImage $image, int $color)
imagewbmp(GdImage $image, $file=null, ?int $foreground_color=null)
imagesetthickness(GdImage $image, int $thickness)
imagesettile(GdImage $image, GdImage $tile)
imagecreatefromjpeg(string $filename)
imagefill(GdImage $image, int $x, int $y, int $color)
imagecreatefromstring(string $data)
imagegrabwindow(int $handle, bool $client_area=false)
imagegd2(GdImage $image, ?string $file=null, int $chunk_size=128, int $mode=IMG_GD2_RAW)
imagechar(GdImage $image, GdFont|int $font, int $x, int $y, string $char, int $color)
imagecreatefromtga(string $filename)
imagecolorexactalpha(GdImage $image, int $red, int $green, int $blue, int $alpha)
imagegd(GdImage $image, ?string $file=null)
imagecolorat(GdImage $image, int $x, int $y)
imageresolution(GdImage $image, ?int $resolution_x=null, ?int $resolution_y=null)
imagegetclip(GdImage $image)
imagepalettetotruecolor(GdImage $image)
imagecolorresolvealpha(GdImage $image, int $red, int $green, int $blue, int $alpha)
imageistruecolor(GdImage $image)
imagecolorclosestalpha(GdImage $image, int $red, int $green, int $blue, int $alpha)
imagegetinterpolation(GdImage $image)
imagecreatefrombmp(string $filename)
imageline(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color)
imagegammacorrect(GdImage $image, float $input_gamma, float $output_gamma)
imagesavealpha(GdImage $image, bool $enable)
imagewebp(GdImage $image, $file=null, int $quality=-1)
imagesetbrush(GdImage $image, GdImage $brush)
imagefilledarc(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color, int $style)
imagestring(GdImage $image, GdFont|int $font, int $x, int $y, string $string, int $color)
imageaffinematrixget(int $type, $options)
imageconvolution(GdImage $image, array $matrix, float $divisor, float $offset)
imagecolorclosest(GdImage $image, int $red, int $green, int $blue)
imagefilledellipse(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $color)
imagecrop(GdImage $image, array $rectangle)
imagecreatefromxpm(string $filename)
imagecopymergegray(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct)
imagefilltoborder(GdImage $image, int $x, int $y, int $border_color, int $color)
struct gdIOCtx * gdIOCtxPtr
gdFontPtr gdFontMediumBold
foreach($dp as $el) foreach( $dp as $el) if( $pass2< 2) echo ""
PHPAPI const char php_sig_bmp[2]
PHPAPI const char php_sig_png[8]
bool php_is_image_avif(php_stream *stream)
PHPAPI const char php_sig_gif[3]
PHPAPI const char php_sig_riff[4]
PHPAPI const char php_sig_jpg[3]
PHPAPI const char php_sig_webp[4]
void gdImageSetTile(gdImagePtr im, gdImagePtr tile)
void gdImageFilledPolygon(gdImagePtr im, gdPointPtr p, int n, int c)
void gdImageRectangle(gdImagePtr im, int x1, int y1, int x2, int y2, int color)
void gdImageCopyResized(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH)
int gdImageColorAllocateAlpha(gdImagePtr im, int r, int g, int b, int a)
gdImagePtr gdImageCreate(int sx, int sy)
void gdImageAlphaBlending(gdImagePtr im, int alphaBlendingArg)
void gdImageFilledRectangle(gdImagePtr im, int x1, int y1, int x2, int y2, int color)
void gdImageSetBrush(gdImagePtr im, gdImagePtr brush)
void gdImageLine(gdImagePtr im, int x1, int y1, int x2, int y2, int color)
void gdImageFilledArc(gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color, int style)
void gdImageColorDeallocate(gdImagePtr im, int color)
void gdImageCharUp(gdImagePtr im, gdFontPtr f, int x, int y, int c, int color)
int gdImageColorResolveAlpha(gdImagePtr im, int r, int g, int b, int a)
void gdImageOpenPolygon(gdImagePtr im, gdPointPtr p, int n, int c)
int gdImageGetPixel(gdImagePtr im, int x, int y)
void gdImageSetAntiAliased(gdImagePtr im, int c)
void gdImageDestroy(gdImagePtr im)
void gdImageSetClip(gdImagePtr im, int x1, int y1, int x2, int y2)
void gdSetErrorMethod(gdErrorMethod error_method)
void gdImageFilledEllipse(gdImagePtr im, int mx, int my, int w, int h, int c)
void gdImageFillToBorder(gdImagePtr im, int x, int y, int border, int color)
int gdImageColorExact(gdImagePtr im, int r, int g, int b)
void gdImageArc(gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color)
void gdImageSetThickness(gdImagePtr im, int thickness)
int gdImageColorClosest(gdImagePtr im, int r, int g, int b)
void gdImageGetClip(gdImagePtr im, int *x1P, int *y1P, int *x2P, int *y2P)
void gdImageSetResolution(gdImagePtr im, const unsigned int res_x, const unsigned int res_y)
void gdImagePolygon(gdImagePtr im, gdPointPtr p, int n, int c)
void gdImageEllipse(gdImagePtr im, int mx, int my, int w, int h, int c)
void gdImageDashedLine(gdImagePtr im, int x1, int y1, int x2, int y2, int color)
void gdImageCopyResampled(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH)
int gdImageColorExactAlpha(gdImagePtr im, int r, int g, int b, int a)
void gdImageSetStyle(gdImagePtr im, int *style, int noOfPixels)
int gdImageColorResolve(gdImagePtr im, int r, int g, int b)
int gdImagePaletteToTrueColor(gdImagePtr src)
int gdImageColorAllocate(gdImagePtr im, int r, int g, int b)
void gdImageCopyMerge(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct)
void gdImageCopyMergeGray(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct)
void gdImageFill(gdImagePtr im, int x, int y, int nc)
void gdImageCopy(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h)
void gdImagePaletteCopy(gdImagePtr to, gdImagePtr from)
void gdImageInterlace(gdImagePtr im, int interlaceArg)
gdImagePtr gdImageCreateTrueColor(int sx, int sy)
int gdImageColorClosestAlpha(gdImagePtr im, int r, int g, int b, int a)
void gdImageColorTransparent(gdImagePtr im, int color)
void gdImageChar(gdImagePtr im, gdFontPtr f, int x, int y, int c, int color)
void gdImageSetPixel(gdImagePtr im, int x, int y, int color)
int gdImageColorClosestHWB(gdImagePtr im, int r, int g, int b)
void gdImageSaveAlpha(gdImagePtr im, int saveAlphaArg)
PHPAPI ZEND_COLD void php_error_docref(const char *docref, int type, const char *format,...)
PHPAPI size_t php_write(void *buf, size_t size)
PHPAPI ZEND_COLD void php_verror(const char *docref, const char *params, int type, const char *format, va_list args)
php_info_print_table_start()
php_info_print_table_row(2, "PDO Driver for Firebird", "enabled")
php_info_print_table_end()
#define PHP_MSHUTDOWN_FUNCTION
#define PHP_MINIT_FUNCTION
#define PHP_MINFO_FUNCTION
#define PHP_RSHUTDOWN_FUNCTION
PHP_JSON_API size_t int options
#define php_stream_memory_open(mode, str)
#define TEMP_STREAM_READONLY
PHPAPI FILE * php_open_temporary_file(const char *dir, const char *pfx, zend_string **opened_path_p)
unsigned char key[REFLECTION_KEY_LEN]
#define php_stream_cast(stream, as, ret, show_err)
#define PHP_STREAM_IS_STDIO
struct _php_stream php_stream
#define php_stream_read(stream, buf, count)
#define PHP_STREAM_CAST_TRY_HARD
#define PHP_STREAM_COPY_ALL
#define php_stream_seek(stream, offset, whence)
#define php_stream_can_cast(stream, as)
#define php_stream_eof(stream)
#define php_stream_close(stream)
#define php_stream_is(stream, anops)
#define php_stream_tell(stream)
#define php_stream_copy_to_mem(src, maxlen, persistent)
#define php_stream_open_wrapper(path, mode, options, opened)
#define php_stream_from_zval_no_verify(xstr, pzval)
#define PHP_STREAM_AS_STDIO
#define php_stream_write(stream, buf, count)
const phpdbg_color_t * colors[PHPDBG_COLORS]
void(* putC)(struct gdIOCtx *, int)
int(* getC)(struct gdIOCtx *)
int(* putBuf)(struct gdIOCtx *, const void *, int)
void(* gd_free)(struct gdIOCtx *)
gdInterpolationMethod interpolation_id
ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format,...)
ZEND_API ZEND_COLD void zend_value_error(const char *format,...)
#define INTERNAL_FUNCTION_PARAMETERS
#define INTERNAL_FUNCTION_PARAM_PASSTHRU
ZEND_API const char * zend_zval_value_name(const zval *arg)
ZEND_API zend_result add_next_index_long(zval *arg, zend_long n)
ZEND_API zend_result object_init_ex(zval *arg, zend_class_entry *class_type)
ZEND_API void add_index_double(zval *arg, zend_ulong index, double d)
ZEND_API zend_result zend_parse_parameters(uint32_t num_args, const char *type_spec,...)
ZEND_API void object_properties_init(zend_object *object, zend_class_entry *class_type)
ZEND_API ZEND_COLD void zend_argument_must_not_be_empty_error(uint32_t arg_num)
ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *format,...)
ZEND_API ZEND_COLD void zend_argument_type_error(uint32_t arg_num, const char *format,...)
#define Z_PARAM_PATH_STR(dest)
#define Z_PARAM_PATH_OR_NULL(dest, dest_len)
#define Z_PARAM_ARRAY_OR_NULL(dest)
#define ZEND_PARSE_PARAMETERS_END()
#define ZEND_PARSE_PARAMETERS_NONE()
#define ZEND_GET_MODULE(name)
#define Z_PARAM_STR(dest)
#define ZEND_PARSE_PARAMETERS_START(min_num_args, max_num_args)
#define Z_PARAM_BOOL_OR_NULL(dest, is_null)
#define Z_PARAM_LONG(dest)
#define Z_PARAM_DOUBLE(dest)
#define CHECK_ZVAL_NULL_PATH(p)
#define Z_PARAM_LONG_OR_NULL(dest, is_null)
#define Z_PARAM_BOOL(dest)
#define Z_PARAM_OBJECT_OF_CLASS(dest, _ce)
#define Z_PARAM_ARRAY(dest)
#define Z_PARAM_ZVAL_OR_NULL(dest)
#define Z_PARAM_ZVAL(dest)
#define Z_PARAM_OBJ_OF_CLASS_OR_LONG(dest_obj, _ce, dest_long)
#define WRONG_PARAM_COUNT
#define estrndup(s, length)
#define ecalloc(nmemb, size)
#define pestrndup(s, length, persistent)
#define pefree(ptr, persistent)
#define safe_emalloc(nmemb, size, offset)
zend_string_release_ex(func->internal_function.function_name, 0)
ZEND_API void(ZEND_FASTCALL *zend_touch_vm_stack_data)(void *vm_stack_data)
union _zend_function zend_function
ZEND_API zval *ZEND_FASTCALL zend_hash_str_find(const HashTable *ht, const char *str, size_t len)
ZEND_API zval *ZEND_FASTCALL zend_hash_index_find(const HashTable *ht, zend_ulong h)
#define ZEND_HASH_FOREACH_END()
#define ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(ht, _key, _val)
#define ZEND_HASH_FOREACH_VAL(ht, _val)
#define UNREGISTER_INI_ENTRIES()
#define REGISTER_INI_ENTRIES()
#define DISPLAY_INI_ENTRIES()
struct _zend_string zend_string
#define STANDARD_MODULE_HEADER
struct _zend_module_entry zend_module_entry
#define STANDARD_MODULE_PROPERTIES
ZEND_API int zend_objects_not_comparable(zval *o1, zval *o2)
ZEND_API const zend_object_handlers std_object_handlers
ZEND_API void ZEND_FASTCALL zend_object_std_init(zend_object *object, zend_class_entry *ce)
ZEND_API void zend_object_std_dtor(zend_object *object)
#define zend_always_inline
#define XtOffsetOf(s_type, field)
#define EMPTY_SWITCH_DEFAULT_CASE()
#define UNEXPECTED(condition)
struct _zend_class_entry zend_class_entry
struct _zend_object zend_object
#define ZEND_SIZE_T_UINT_OVFL(size)
#define ZEND_LONG_INT_OVFL(zlong)
#define ZEND_SIZE_T_INT_OVFL(size)
#define zend_string_equals_literal(str, literal)
#define Z_STRVAL_P(zval_p)
#define Z_ARRVAL_P(zval_p)
struct _zend_object_handlers zend_object_handlers
#define VCWD_FOPEN(path, mode)
#define VCWD_UNLINK(path)
#define VCWD_REALPATH(path, real_path)