Commit Graph

137 Commits (9f28c16ee08d6059c9706592e877edd693c97e91)

Author SHA1 Message Date
Christoph M. Becker b331c55f58 Fix PHP bug #64641: imagefilledpolygon doesn't draw horizontal line
As reported in <https://bugs.php.net/64641> 1-dimensional horizontal
filled polygons are not drawn at all. That is caused by the scanline
algorithm used for drawing filled polygons which skips the drawing of
horizontal edges, because that is normally not necessary. If, however,
the polygon consists of horizontal edges only, that obviously doesn't
work, so we add a special case handling.

(cherry picked from commit f9f10fa9d4)
2016-06-20 14:43:03 +02:00
Christoph M. Becker c2b91dbce5 Fix #167: Styled thick horizontal lines are scrambled
Thick lines are drawn by gdImageFilledRectangle(), which iterates over
the x ordinate first (Z order) to apply the style pattern. While this works
fine for vertical and diagonal lines, it obviously fails for horizontal
lines, which have to be iterated over in N order.

To fix this bug, we introduce the helpers  gdImageFilled(H|V)Rectangle(),
which may be reused for other purposes as well.
2016-06-15 17:43:30 +02:00
Pierre Joye 19788a221a fix #172 single line rectangle creates wriclers. Simplify test. 2016-06-09 10:50:30 +07:00
Pierre Joye 6f5c4084c1 fix #215, invalid color index, missing case for invalid border 2016-06-08 11:23:38 +07:00
Pierre Joye 77f619d482 fix #215 gdImageFillToBorder stack-overflow when invalid color is used 2016-06-04 23:09:01 +07:00
Ondřej Surý 4d29684fd4 CVE-2015-8874 2016-05-20 10:37:44 -04:00
Mike Frysinger 75c38f6b32 fix various gcc/clang warnings found with -Wall 2016-05-13 22:19:26 -04:00
sherif-elmetainy e87ec88e1c :fix and unit test for crash issue in gdImageFillTiled 2016-01-09 23:02:12 +02:00
Jitendar Kumar eaca20f1e6 Remove Deadcode in gd.c
In API gdImageLine()

if `dx == 0` Checked and return else if `dy==0` Checked and return. 

if ((dx == 0) && (dy == 0))  never TRUE , code has no impact , can be removed.
2015-04-22 11:48:39 +05:30
Pierre Joye 2b3130efe6 fix #90, actually copy src to dst 2015-01-17 08:34:07 +01:00
Pierre Joye 2f40d52ddc Fix #138, VS 2010 build error due to double semi column 2015-01-15 11:05:43 +01:00
Remi Collet 4af76c97a4 fix comment 2015-01-02 09:18:27 +01:00
Remi Collet 3c0d2203b2 Fix possible infinite loop (php bug report #68713)
- make code more legible (yy>=yy-1 seems ugly)
- fix mem leak, always free src->tpixels
2015-01-02 09:09:22 +01:00
Nathanael Jones 08eb6ee8e9 Restore support for alphaBlendingFlag value gdEffectAlphaBlend 2014-09-03 22:11:29 +00:00
Tim Toohey b39f92b195 Add overlay and multiply effects to gdImageSetPixel 2014-04-23 10:48:57 +10:00
Chris Reuter 275ac17bcc Started importing the old manual into Naturaldocs comments.
This changeset imports documention for gdImage to gdImagePng*() into
Natural Docs.  Documention is based on the text of the original
manual, version 2.0.36 but adapted to better suit the format.
Subsequent changesets will introduce docs for subsequent manual
entries.

naturaldocs, when present, is invoked by bootstrap.sh.  The completed
manual will be in docs/naturaldocs/html/index.html.  It can also be
explicitly invoked by running docs/naturaldocs/run_docs.sh.

This change also removed docs/naturaldocs/project/Menu.txt, since it
currently contains no non-generated content and is prone to introduce
noise into the changeset.
2014-01-07 15:29:06 -05:00
Chris Reuter bb1d4a044e Added documention for gdImageCreate() and type gdImage.
This change adds naturaldoc comments for the above function and type.
Text was adapted from the 2.0.36 manual.

It also fixes the formatting of the comment for gdInterpolationMethod
so that naturaldoc will extract it.
2013-11-18 18:21:28 -05:00
Remi Collet 837b73276d fix integer overflow in AAline, fixed issue #5 2013-06-10 10:15:18 +02:00
Remi Collet eca37d620a fix hangs in gdImageAALine (bug int overflow can still occur, need improvment 2013-06-10 09:30:29 +02:00
Remi Collet da6c203bb3 fix palette copy in gdimageclone 2013-06-10 08:49:31 +02:00
Ondřej Surý 130fa2277c Merge patch to fix anti-aliased line doesn't honor thickness (fixes #16) 2013-06-07 11:33:04 +02:00
Pierre Joye 1e09060f05 add gdImageClone, use gdImageClone for 0 degree rotation, fix expected images for bug00067 test 2013-06-06 08:27:32 +02:00
Ondřej Surý cea4896303 Get rid of dead assignment in _gdImageFillTiled 2013-05-22 13:18:51 +02:00
Ondřej Surý a2e76f8b2a Get rid of dead assignment in gdImageTileGet 2013-05-22 13:17:55 +02:00
Ondřej Surý a3016ad01b Make gdImageRectangle simpler and get rid of dead assignments 2013-05-22 13:16:08 +02:00
Ondřej Surý f0ddf2eccd Introduce gdReallocEx which will free the original memory when realloc
fails to circumvent lost memory when doing:

    a = gdRealloc(a, s);
    if (!a)
        return;

Thanks to Niels Thykier for catching that.
2013-05-20 21:10:28 +02:00
Ondřej Surý bc70152cd8 Cherry-pick php-libgd fixes for imagefill() doesn't work correctly for small images 2013-05-03 15:01:19 +02:00
Pierre Joye 9850b02381 - fix logic and build 2013-05-03 07:58:35 +02:00
Ondřej Surý 9d20d61bf0 Add C99 inttypes support to gd.c 2013-05-02 09:30:37 +02:00
Ondřej Surý 2498ba501a Add missing semicolon to prev commit 2013-04-26 12:35:33 +02:00
Ondřej Surý 3be2f899db Workaround double->int conversion bug in gcc on some architectures (ia64, s390 and powerpc) 2013-04-26 12:34:00 +02:00
Ondřej Surý e5dcee5ddf gdErrorMethod declaration was wrong, we need to pass rest of the arguments in va_list 2013-04-23 11:01:57 +02:00
Ondřej Surý decf4407d4 Merge PHP libgd Xbm code 2013-04-22 08:44:21 +02:00
Pierre Joye d968c5edb9 ws space to tab 2013-04-18 21:18:45 +02:00
Pierre Joye b417ec22f9 ws space to tab 2013-04-18 21:17:53 +02:00
Ondřej Surý e5d9ea1826 Rename E_{ERROR,WARNING,...} to GD_{ERROR,WARNING,...} and install the header 2013-04-18 08:28:36 +02:00
Ondřej Surý 32b1307c62 Use custom error handler instead of fprintf(stderr, ...) 2013-04-18 08:28:36 +02:00
Pierre Joye 7f910fbcc8 fixes #21, clip rectangle to image size 2013-04-16 21:40:31 +02:00
Ondřej Surý 57ad70b2cd Fix support for large images; https://bugs.php.net/bug.php?id=51128 (libgd#177) 2013-04-11 16:01:54 +02:00
Takeshi Abe aeb7fed08e suppress -Wunused-variable 2013-04-11 19:05:04 +09:00
Ondřej Surý 15ea6bc5a1 Fix several uninitialized variable reads, dereferences before NULL checks, resource leaks and some other minor errors 2013-04-08 12:53:52 +02:00
Pierre Joye 85dd7fe474 - add gdImagePaletteToTrueColor 2013-04-07 18:39:36 +02:00
Pierre Joye cb476bce94 missing declation 2013-04-05 22:53:06 +02:00
Pierre Joye d7ce3d3181 backport fix for gdImageCopyResampled created noisy image with alpha 2013-04-05 08:08:45 +02:00
Pierre Joye b63349984b missing default init for interpolation method 2013-04-05 07:45:35 +02:00
pierrejoye e20413bf6b - apply same CS everywhere 2013-04-03 14:23:11 +02:00
Takeshi Abe faad083d77 micro optimization: avoid unnecessary initialization 2013-03-13 11:52:14 +09:00
tabe 535eab566b fix -Wunused-but-set-variable 2013-02-11 12:06:21 +09:00
tabe 3aaf1ab557 fix -Wunused-parameter 2013-02-11 11:31:40 +09:00
tabe a52c979f44 fixed FS#100 2010-01-19 17:58:20 +09:00