Skip to content
This repository was archived by the owner on Sep 7, 2021. It is now read-only.

Commit 22f0489

Browse files
committed
Merge branch 'bugfix-10897' into release-6.0.2
2 parents ef7d249 + 9b1b1b0 commit 22f0489

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

engine/src/cmdsf.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,12 @@ Exec_stat MCExport::exec(MCExecPoint &ep)
823823
return ES_ERROR;
824824
}
825825
}
826-
826+
827+
// MW-2013-05-20: [[ Bug 10897 ]] Object snapshot returns a premultipled
828+
// bitmap, which needs to be processed before compression. This flag
829+
// indicates to do this processing later on in the method.
830+
bool t_needs_unpremultiply;
831+
t_needs_unpremultiply = false;
827832
if (sformat == EX_SNAPSHOT)
828833
{
829834
char *srect = NULL;
@@ -921,6 +926,10 @@ Exec_stat MCExport::exec(MCExecPoint &ep)
921926
MCeerror -> add(EE_EXPORT_EMPTYRECT, line, pos);
922927
return ES_ERROR;
923928
}
929+
930+
// MW-2013-05-20: [[ Bug 10897 ]] The 'snapshot' command produces a premultiplied bitmap
931+
// so mark it to be unpremultiplied for later on.
932+
t_needs_unpremultiply = true;
924933
}
925934
else
926935
{
@@ -1011,6 +1020,9 @@ Exec_stat MCExport::exec(MCExecPoint &ep)
10111020
else
10121021
{
10131022
/* UNCHECKED */ MCImageBitmapCreateWithOldBitmap(t_img, t_bitmap);
1023+
// MW-2013-05-20: [[ Bug 10897 ]] Make sure we unpremultiply if needed.
1024+
if (t_needs_unpremultiply)
1025+
MCImageBitmapUnpremultiply(t_bitmap);
10141026
MCImageBitmapCheckTransparency(t_bitmap);
10151027
MCscreen->destroyimage(t_img);
10161028
t_dither = !MCtemplateimage->getflag(F_DONT_DITHER);

0 commit comments

Comments
 (0)