image: Fix preservation of alpha chanel flag in imlib_clone_image()

#17:

As per subject, the imlib_clone_image() function no longer preserves
the alpha channel value since imlib2 1.10.0.

This bug report was initially filed by Niko Tyni in Debian's bug tracker.
If you follow the subsequent link you will also find a test program that
demonstrates the regression.

https://bugs.debian.org/1041406

This upstream change is most likely the root cause of the problem

b39d33c800

It looks like an oversight where other functions were adapted
to the new alpha channel implementation, but imlib_clone_image() remains
unchanged and only copies the flags and not the new alpha byte.
This commit is contained in:
Kim Woelders 2023-07-19 18:11:08 +02:00
parent 50295779a1
commit 173edae4bf
1 changed files with 1 additions and 0 deletions

View File

@ -1014,6 +1014,7 @@ imlib_clone_image(void)
return NULL;
memcpy(im->data, im_old->data, im->w * im->h * sizeof(uint32_t));
im->has_alpha = im_old->has_alpha;
im->flags = im_old->flags;
IM_FLAG_SET(im, F_UNCACHEABLE);
im->moddate = im_old->moddate;