Closed Bug 139176 Opened 23 years ago Closed 23 years ago

Animated gif with no global palette puts garbage in transparent area on first loop

Categories

(Core :: Graphics: ImageLib, defect, P4)

x86
Windows 98
defect

Tracking

()

RESOLVED FIXED
mozilla1.1beta

People

(Reporter: kazhik, Assigned: pavlov)

References

Details

Attachments

(1 file, 1 obsolete file)

Transparent animated gif without loop parameter doesn't become transparent. Animated gif without loop parameter: http://bugzilla.mozilla.gr.jp/showattachment.cgi?attach_id=726 Animated gif with loop parameter: http://bugzilla.mozilla.gr.jp/showattachment.cgi?attach_id=727
This is Windows specific bug. There is no problem on FreeBSD and Mac OS 9. Since the transparent color of these GIFs is #FFFFFF, please see on dark background color.
Whiteboard: DUPEME
Looks like a dup of bug 22607
The problem was we were only clearing the composite frame (before drawing to it) if the gif had a background color set. http://bugzilla.mozilla.gr.jp/showattachment.cgi?attach_id=726 does not have a global palette, and thus does not have a background color (since bgcolor is chosen from the global palette) This patch clears the composite frame before drawing on it no matter what.
Changing Summary from "Transparent animated gif without loop parameter doesn't become transparent" to "Animated gif with no global palette puts garbage in transparent area on first loop" What happened when you turned on the loop is that in the first loop the image was garbage, but on the second loop, it fixed itself. The time between the two loops was set to a minumum so you have to be quick to catch it.
Keywords: patch, review
Summary: Transparent animated gif without loop parameter doesn't become transparent → Animated gif with no global palette puts garbage in transparent area on first loop
Whiteboard: DUPEME
Attached image Another testcase with loop=1 (obsolete) —
This has a global color palette(table), and background color is black, transparent color is white. In the first loop, background of the image is broken, and in the second loop, it's ok. I think this problem is "Animated GIF with background-color different from transparent-color puts garbage in transparent area on first loop".
Attachment 82458 [details], WFM. Win2k Build 2002050807 Are you getting the same type of garbage as with http://bugzilla.mozilla.gr.jp/showattachment.cgi?attach_id=726 ? Could you provide a screenshot?
Attachment 82458 [details] is OK on Windows NT, but on Win98SE(2002051004), there is similar garbage in the first loop. This may be another problem.
Confirming Attachment 82458 [details] displays garbage on Windows 98 (non SE) Build 20020511xx and RC2. I'll look into it.
Attachment #82458 - Attachment is obsolete: true
I've created Bug 143830 to deal with Attachment 82458 [details]. It's a seperate issue from this one. (Fixing one won't fix the other). This bug is displayed on all Windows platforms as far as I know.
Priority: -- → P4
Target Milestone: --- → mozilla1.1beta
Blocks: 119597
Comment on attachment 82436 [details] [diff] [review] Clear compositing frame even if there's no bg color set. sr=tor
Attachment #82436 - Flags: superreview+
Comment on attachment 82436 [details] [diff] [review] Clear compositing frame even if there's no bg color set. looks correct. r=biesi
Attachment #82436 - Flags: review+
really marking fixed this time
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Using 2002081706-1.0branch/Win98SE, http://bugzilla.mozilla.gr.jp/showattachment.cgi?attach_id=726 causes garbage. The patch isn't checked in 1.0 branch?
http://lxr.mozilla.org/seamonkey/source/modules/libpr0n/src/imgContainer.cpp shows as follows: --- 169 if (NS_SUCCEEDED(firstFrame->GetBackgroundColor(&backgroundColor))) { 170 mCompositingFrame->SetBackgroundColor(backgroundColor); 171 } 172 173 PRInt32 x; 179 firstFrame->GetWidth(&width); 180 firstFrame->GetHeight(&height); 181 182 BlackenFrame(mCompositingFrame); 183 firstFrame->DrawTo(mCompositingFrame, x, y, width, height); 184 ZeroMask(mCompositingFrame); 185 BuildCompositeMask(mCompositingFrame, firstFrame); --- http://lxr.mozilla.org/mozilla1.0/source/modules/libpr0n/src/imgContainer.cpp shows as follows: --- 169 if (NS_SUCCEEDED(firstFrame->GetBackgroundColor(&backgroundColor))) { 170 mCompositingFrame->SetBackgroundColor(backgroundColor); 171 BlackenFrame(mCompositingFrame); 172 } 173 174 PRInt32 x; 180 firstFrame->GetWidth(&width); 181 firstFrame->GetHeight(&height); 182 183 firstFrame->DrawTo(mCompositingFrame, x, y, width, height); 184 ZeroMask(mCompositingFrame); 185 BuildCompositeMask(mCompositingFrame, firstFrame); --- I think this patch isn't checked in 1.0 branch.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: