for (x = 0; x < sx; x++) {
const unsigned char c = *(src_row + x);
if (c == src->transparent) {
- *(dst_row + x) = gdTrueColorAlpha(0, 0, 0, 127);;
+ *(dst_row + x) = gdTrueColorAlpha(0, 0, 0, 127);
} else {
*(dst_row + x) = gdTrueColorAlpha(src->red[c], src->green[c], src->blue[c], src->alpha[c]);
}
src->pixels = NULL;
src->alphaBlendingFlag = 0;
src->saveAlphaFlag = 1;
+
+ if (src->transparent >= 0) {
+ const unsigned char c = src->transparent;
+ src->transparent = gdTrueColorAlpha(src->red[c], src->green[c], src->blue[c], src->alpha[c]);
+ }
+
return 1;
clean_on_error:
unsigned int i;
gdImagePtr dst;
- /* impact perf a bit, but not that much. Implementation for palette
- images can be done at a later point.
- */
- if (src->trueColor == 0) {
- gdImagePaletteToTrueColor(src);
- }
-
dst = gdImageCreateTrueColor(new_width, new_height);
if (!dst) {
return NULL;
f_slop_x > f_slop_y ? gd_divfx(f_slop_y, f_slop_x) : gd_divfx(f_slop_x, f_slop_y)
: 0;
- /* impact perf a bit, but not that much. Implementation for palette
- images can be done at a later point.
- */
- if (src->trueColor == 0) {
- gdImagePaletteToTrueColor(src);
- }
dst = gdImageCreateTrueColor(new_width, new_height);
if (!dst) {
unsigned int src_offset_x, src_offset_y;
gdImagePtr dst;
- /* impact perf a bit, but not that much. Implementation for palette
- images can be done at a later point.
- */
- if (src->trueColor == 0) {
- gdImagePaletteToTrueColor(src);
- }
-
dst = gdImageCreateTrueColor(new_width, new_height);
if (dst == NULL) {
return NULL;
unsigned int i;
gdImagePtr dst;
- /* impact perf a bit, but not that much. Implementation for palette
- images can be done at a later point.
- */
- if (src->trueColor == 0) {
- gdImagePaletteToTrueColor(src);
- }
-
dst = gdImageCreateTrueColor(new_width, new_height);
if (dst == NULL) {
gdImagePtr gdImageRotateInterpolated(const gdImagePtr src, const float angle, int bgcolor)
{
const int angle_rounded = (int)floor(angle * 100);
-
+
if (bgcolor < 0) {
return NULL;
}
+ /* impact perf a bit, but not that much. Implementation for palette
+ images can be done at a later point.
+ */
+ if (src->trueColor == 0) {
+ if (bgcolor >= 0) {
+ bgcolor = gdTrueColorAlpha(src->red[bgcolor], src->green[bgcolor], src->blue[bgcolor], src->alpha[bgcolor]);
+ }
+ gdImagePaletteToTrueColor(src);
+ }
+
/* no interpolation needed here */
switch (angle_rounded) {
case 9000: