Commit Graph

3 Commits

Author SHA1 Message Date
halcanary@google.com
04b57f87ab Runtime configuration setting for suppressing JPEG decoder errors.
Add new runtime config variable, images.jpeg.suppressDecoderErrors
which defaults to false in Debug and true otherwise.  When Jpeg errors
are suppressed and an error happens, SkJPEGImageDecoder::onDecode()
will return silently false (Consequently, so will SkImageDecoder's
DecodeFile() and DecodeMemory() functions).

Also, the test_image_decoder program now respects runtime
configuration settings.

BUG=skia:1680
R=scroggo@google.com

Review URL: https://codereview.chromium.org/27230002

git-svn-id: http://skia.googlecode.com/svn/trunk@11763 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-10-14 20:08:48 +00:00
halcanary@google.com
d8854adf1c Fix iOS build of test_image_decoder
Use tool_main() function.

Review URL: https://codereview.chromium.org/26008002

git-svn-id: http://skia.googlecode.com/svn/trunk@11600 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-10-04 13:37:24 +00:00
halcanary@google.com
fed3037217 Make image decoding more fault resistant, less verbose.
This change address what happens when a jpeg is partially downloaded
before failing.  Many browsers will render it anyway: we want Skia to
do the same.  The JpegTest takes a perfectly cromulent jpeg file and
only passes into the ImageDecoder the first half of the image.  We
then verify that the image decoder returns a valid bitmap of the
correct dimensions.

We also fixed some png library errors, including issue 1691.

Also, suppressed the majority of warnings from using libpng and
libjpeg.  By default, most warnings are *not* suppressed in debug mode.
If you have a debug binary and wish to suppress warnings, set the
following environment variables to true
    skia_images_png_suppressDecoderWarnings
    skia_images_jpeg_suppressDecoderWarnings
or from within a program that links to Skia:
    #if defined(SK_DEBUG)
    #include "SkRTConf.h"
    SK_CONF_SET("images.jpeg.suppressDecoderWarnings", true);
    SK_CONF_SET("images.png.suppressDecoderWarnings", true);
    #endif

I tested this, before (control) and after these changes (test), on
364,295 skps from the cluster telemetry.
-   number of errors+warnings in control = 2804
-   number of errors+warnings fixed = 2283
-   number of PNG verbosity fixed =  2152
-   number of PNG error fixed = 4
-   number of PNG segfault fixed = 3
-   number of PNG errors changed to warnings = 62
-   number of JPG verbosity fixed =  26
-   number of JPG error fixed = 91
Not all errors and warning have been fixed.

These numbers were generated using the find_bad_images_in_skps.py
program.  This program may be useful going forward for testing
image-decoding libraries on skp files from the cluster telemetry.
find_bad_images_in_skps.py depends on the test_image_decoder program,
which simply executes the SkImageDecoder::DecodeFile function and uses
its exit status to report success or failure.

BUG=skia:1649
BUG=skia:1691
BUG=skia:1680
R=scroggo@google.com

Review URL: https://codereview.chromium.org/24449003

git-svn-id: http://skia.googlecode.com/svn/trunk@11597 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-10-04 12:46:45 +00:00