This repository was archived by the owner on Sep 7, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff 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);
You can’t perform that action at this time.
0 commit comments