Intermittent XmlException when decoding GIFs
Status: Alpha
Brought to you by:
sbridewell
Run GifInspector. Tick the "Create debug XML" box. Select the "Images" tab. Click the "Load GIF file" button and read in a GIF file. Repeat until you see an error message.
The error message varies, but it's always a System.Xml.XmlException in GifComponents.Components.GifComponent.WriteDebugXmlNode(XmlReader reader), indicating that the XML being written isn't well formed.
I find that the file Bug2940669-fillekermit.gif is most likely to cause this error, although it doesn't always do so. Some other files also cause it, but not always.
More investigation needed to pin down exactly when and why this error occurs.
I think this is happening because GifInspector has a Timer which refreshes the UI every so often - if it tries to do this when the user has ticked the Debug XML box and has the Frames tab selected and the GifDecoder is part way through decoding a file then this exception is thrown because the DebugXml property contains an XML document which isn't complete yet, and is therefore not (yet) valid XML.
I've added a State property to GifDecoder which indicates whether it has not started, is in progress, or has finished decoding, and changed GifInspector so that it doesn't attempt to update the PropertyGrid containing the frame properties unless the decoder has a GifDecoderState of Done.
Since making this change, I haven't managed to make the XmlException happen again.
This has been committed to the code repository as revision 90. Not in a MSI release yet though.
Fix included in MSI release 0.1.3747.32243.