diff --git a/ext/gd/libgd/gd_rotate.c b/ext/gd/libgd/gd_rotate.c index e9a393d9436..e94809ae770 100644 --- a/ext/gd/libgd/gd_rotate.c +++ b/ext/gd/libgd/gd_rotate.c @@ -216,12 +216,13 @@ gdImagePtr gdImageRotate90 (gdImagePtr src, int ignoretransparent) f = gdImageGetPixel; } dst = gdImageCreateTrueColor(src->sy, src->sx); - dst->transparent = src->transparent; if (dst != NULL) { int old_blendmode = dst->alphaBlendingFlag; dst->alphaBlendingFlag = 0; + dst->transparent = src->transparent; + gdImagePaletteCopy (dst, src); for (uY = 0; uYsy; uY++) { @@ -310,12 +311,13 @@ gdImagePtr gdImageRotate270 (gdImagePtr src, int ignoretransparent) f = gdImageGetPixel; } dst = gdImageCreateTrueColor (src->sy, src->sx); - dst->transparent = src->transparent; if (dst != NULL) { int old_blendmode = dst->alphaBlendingFlag; dst->alphaBlendingFlag = 0; + dst->transparent = src->transparent; + gdImagePaletteCopy (dst, src); for (uY = 0; uYsy; uY++) {