Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Issue 26743002: GIF decode: optional error messages and fault tolerance. (Closed)

Created:
7 years, 2 months ago by hal.canary
Modified:
7 years, 2 months ago
Reviewers:
scroggo
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

GIF 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+324 lines, -70 lines) Patch
M gyp/tests.gyp View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/images/SkImageDecoder_libgif.cpp View 1 2 3 4 14 chunks +113 lines, -70 lines 0 comments Download
A tests/GifTest.cpp View 1 2 3 4 5 6 7 1 chunk +210 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
hal.canary
7 years, 2 months ago (2013-10-09 19:09:33 UTC) #1
scroggo
I cannot see patch set 2 (upload failed) - this seems to be a spurious ...
7 years, 2 months ago (2013-10-09 20:12:03 UTC) #2
hal.canary
https://codereview.chromium.org/26743002/diff/1/src/images/SkImageDecoder_libgif.cpp File src/images/SkImageDecoder_libgif.cpp (right): https://codereview.chromium.org/26743002/diff/1/src/images/SkImageDecoder_libgif.cpp#newcode162 src/images/SkImageDecoder_libgif.cpp:162: static void gif_warning(GifFileType* gif, const SkBitmap& bm, On 2013/10/09 ...
7 years, 2 months ago (2013-10-10 16:22:10 UTC) #3
hal.canary
I've made some changes, please take a look.
7 years, 2 months ago (2013-10-10 19:45:29 UTC) #4
scroggo
LGTM at patch set 5 https://codereview.chromium.org/26743002/diff/25001/tests/GifTest.cpp File tests/GifTest.cpp (right): https://codereview.chromium.org/26743002/diff/25001/tests/GifTest.cpp#newcode53 tests/GifTest.cpp:53: static void testGifDataNoColormap(skiatest::Reporter* r, ...
7 years, 2 months ago (2013-10-10 20:02:12 UTC) #5
scroggo
On 2013/10/10 20:02:12, scroggo wrote: > LGTM at patch set 5 > > https://codereview.chromium.org/26743002/diff/25001/tests/GifTest.cpp > ...
7 years, 2 months ago (2013-10-11 14:56:33 UTC) #6
hal.canary
7 years, 2 months ago (2013-10-11 18:21:59 UTC) #7
Message was sent while issue was closed.
Committed patchset #8 manually as r11734 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698