summaryrefslogtreecommitdiff
path: root/src/gd_crop.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2018-11-25 17:58:41 +0100
committerChristoph M. Becker <cmbecker69@gmx.de>2018-11-25 17:58:41 +0100
commit6613094e5d218dc4d4372757aef5e58c6462a9f7 (patch)
tree8756fd609cd5502b4c5b8a2a5fbc7b1c32a84024 /src/gd_crop.c
parentbda85aaeeb1d7467d92c892ba4c30eaa53d7a6d4 (diff)
downloadlibgd-6613094e5d218dc4d4372757aef5e58c6462a9f7.tar.gz
Fix #486: gdImageCropAuto(…, GD_CROP_SIDES) crops left but not right
`gdGuessBackgroundColorFromCorners()` is supposed to handle *all* cases where an image has exactly two equal colors in the same way.
Diffstat (limited to 'src/gd_crop.c')
-rw-r--r--src/gd_crop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gd_crop.c b/src/gd_crop.c
index 0c0ae9f..68f58c6 100644
--- a/src/gd_crop.c
+++ b/src/gd_crop.c
@@ -281,7 +281,7 @@ static int gdGuessBackgroundColorFromCorners(gdImagePtr im, int *color)
} else if (tl == tr || tl == bl || tl == br) {
*color = tl;
return 2;
- } else if (tr == bl) {
+ } else if (tr == bl || tr == br) {
*color = tr;
return 2;
} else if (br == bl) {