DescriptionGIF decode: optional error messages and fault tolerance.
Add new runtime configuration variable,
images.gif.suppressDecoderWarnings, which suppresses warning and
errors from the GIF library. It defaults to "true", which is current
behavior.
(This setting can be changed by setting the environment variable
skia_images_gif_suppressDecoderWarnings="false".)
Some conditions which were errors before are now warnings:
- If the image width or height is greater than the GIF screen width or
height (respectively) we expand the screen to hold the image.
- If the offset of the image inside the screen would place the
image outside of the screen, we shift the image to fix this.
- If the image lacks a color table, we create a default color table.
- If the image is truncated, then the rest of the image is filled with
the fill color.
In all four cases, if images.gif.suppressDecoderWarnings is set to
false, then a warning message is printed via SkDebugf.
In the event of another kind of error, SkGIFImageDecoder::onDecode()
will still return false. But with this change, if
images.gif.suppressDecoderWarnings is set to false, a description of
the error is printed via SkDebugf.
Also, added a new unit test GifTest, which tests the deconing of both
good GIf files and corrupted files that should now work with this
change. This unit test is disabled on Win32, iOS, and Mac.
BUG=skia:1689
R=scroggo@google.com
Committed: https://code.google.com/p/skia/source/detail?r=11734
Patch Set 1 #
Total comments: 24
Patch Set 2 : whitespace lint changes #Patch Set 3 : #Patch Set 4 : unit test; scroggo's suggestions #Patch Set 5 : whitespace lint changes #
Total comments: 1
Patch Set 6 : static funtion name style change #Patch Set 7 : rebase #Patch Set 8 : disable on some platforms #
Messages
Total messages: 7 (0 generated)
|