Skip to content

Commit

Permalink
Merge 77b020b into adad71c
Browse files Browse the repository at this point in the history
  • Loading branch information
bgilbert committed Jan 24, 2015
2 parents adad71c + 77b020b commit 0ea8020
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libImaging/Unpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,12 @@ unpackRGBa(UINT8* out, const UINT8* in, int pixels)
int a = in[3];
if (!a)
out[R] = out[G] = out[B] = out[A] = 0;
else {
else if (a == 255) {
out[R] = in[0];
out[G] = in[1];
out[B] = in[2];
out[A] = a;
} else {
out[R] = CLIP(in[0] * 255 / a);
out[G] = CLIP(in[1] * 255 / a);
out[B] = CLIP(in[2] * 255 / a);
Expand Down

0 comments on commit 0ea8020

Please sign in to comment.