DescriptionSanitize bitmaps produced by libgif
Motivation: fix the bug linked to below.
Some rare GIFs in the wild have a color table of size smaller than 256
and have one or more pixels with values that index out side of the
colortable. Since it would be expensive to check the index every time
we do a color lookup, we sanitize it at the source, in
SkImageDecoder_libgif.cpp. The new function sanitize_indexed_bitmap
checks each pixel to see if the index is outside of its allowed mask,
and if so, sets that pixel to point at color 0.
The bit mask optimization in this function relies on the fact that GIF
requires the color table size to be a power of 2.
To test:
$ skia_images_gif_suppressDecoderWarnings=0 \
..../render_pictures \
--bbh grid 256 256 --clone 1 --config 8888 --mode tile 256 256 \
-r ..../http___www_cafe24_com_.skp -w /tmp
This should show verbose errors.
BUG=skia:1946
R=robertphillips@google.com
Committed: https://code.google.com/p/skia/source/detail?r=12786
Patch Set 1 #
Total comments: 2
Patch Set 2 : comments explaining function #Messages
Total messages: 5 (0 generated)
|