Commit Graph

3 Commits

Author SHA1 Message Date
Bill Thiede 8810b517da images/fastjpeg: reset checkAvailability in tests.
Reseting checkAvailability each run uncovered the fact that
CAMLI_DISABLE_DEBUG wasn't being properly reset, which affected later
tests.

Change-Id: I19b790ef8182b1bc2d54cbf33fa9dfe84dbe3903
2014-08-14 15:17:18 -07:00
Bill Thiede 4bcaaf82cc images/fastjpeg: use jpeg.Decode when djpeg fails.
Return error of type ErrDjpegFailed when djpeg or parsing the PNM returned
fails.
Attempt to decode image again with standard library.

Change-Id: I2a0cb7b52885732b7cbbffb8e34993d232781bc0
2014-08-12 20:20:20 -07:00
Bill Thiede bf6a89c9ad images: add support for fast jpeg down-sampling.
The new package pkg/images/fastjpeg uses djpeg(1) to quickly
down-sample images at load time as described here:

  http://jpegclub.org/djpeg/

Add benchmark comparing std lib jpeg.Decode and fastjpeg.DecodeDownsample
with a factor of 1, 2, 4, and 8.
Benchmark resizes a 4000x4000 pixel JPEG to 128x128.

Refactor in pkg/images to make images.Decode a little more readable.

Change-Id: I571db1f3c3068f99da4a01ec84fd246ef098a18c
2014-07-03 21:06:06 -07:00