Go to file
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
animations first cut at a checkbox 2009-10-21 19:41:10 +00:00
bench Add an option on SkImageDecoder to skip writing 0s. 2013-10-01 17:27:15 +00:00
debugger Allow creating a picture from skp to fail. 2013-10-01 15:30:46 +00:00
expectations Allow gradient optimization with perspective 2013-10-04 01:20:09 +00:00
experimental pdfviewer: do not submit, uploaded for backup, and will be done actually after I refactor the params for functions, to put the char* params in a structure: report errors and warnings in pdf, infrastructure 2013-09-13 19:33:42 +00:00
forth Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
gm Use SkPicture::ExtractBitmap callback in pdf too, there is no need for a specialized function pointer for pdf only only to pass a rectangle, when we can use subseted bitmaps. 2013-10-03 19:29:21 +00:00
gyp Make image decoding more fault resistant, less verbose. 2013-10-04 12:46:45 +00:00
include Allow gradient optimization with perspective 2013-10-04 01:20:09 +00:00
platform_tools Fix ninja build on Android 2013-10-01 15:31:54 +00:00
resources Bench baseline for mostly 0 image. 2013-09-25 21:42:12 +00:00
samplecode Change SkImageDecoders to take an SkStreamRewindable. 2013-09-25 21:34:24 +00:00
src Make image decoding more fault resistant, less verbose. 2013-10-04 12:46:45 +00:00
tests Make image decoding more fault resistant, less verbose. 2013-10-04 12:46:45 +00:00
third_party Add libpoppler for PDF rendering, take 2 2013-08-20 18:57:01 +00:00
tools Make image decoding more fault resistant, less verbose. 2013-10-04 12:46:45 +00:00
trybots_to_run/chrome Deleting the hardcoded list of compile bots in trybots_to_run. 2013-04-09 11:59:42 +00:00
.gitignore leading slash confuses non-git tools that read .gitignore, like ag 2013-07-30 17:23:01 +00:00
codereview.settings Removing blank lines from codereview.settings. 2013-02-26 16:01:21 +00:00
DEPS Adds poppler and dependencies to DEPS. This is a pre-CL for 20220002, and getting DEPS committed first is necessary to get the trybots to run on the larger CL (since the trybots do 'gclient sync' before patching). 2013-08-02 19:10:06 +00:00
Doxyfile Pointing to http://skia-autogen.googlecode.com/svn/docs/html/index.html in Doxyfile 2012-07-03 11:35:07 +00:00
gyp_skia Fix ninja build on Android 2013-10-01 15:31:54 +00:00
LICENSE Manually update copyright notices in files that defied the automated process 2011-07-28 14:24:55 +00:00
make.bat Make make.bat and gyp_skia work with VS 2012. 2013-05-07 19:31:20 +00:00
make.py Use SKIA_OUT variable in make.py 2013-07-23 15:45:50 +00:00
Makefile Update Skia Android tools. 2013-08-12 12:30:04 +00:00
Makefile.old Replace GR_*_BUILD by their SK_BUILD_FOR_* equivalents. 2013-09-25 20:57:51 +00:00
OWNERS add root files from chrome 2013-08-13 19:11:15 +00:00
PRESUBMIT.py If any change is made to the public API then make sure there is an LGTM from an owner. 2013-08-12 14:51:20 +00:00
README whitespace commit to trigger buildbot 2011-07-15 14:11:58 +00:00
README.chromium add root files from chrome 2013-08-13 19:11:15 +00:00
skia.gyp gyp: generate "everything" and "most" targets instead of "all" 2012-10-25 16:32:07 +00:00
whitespace.txt Whitespace change to test CQ emails. 2013-10-02 12:16:25 +00:00

Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.

See full details, and build instructions, at http://code.google.com/p/skia/wiki/DocRoot