Commit Graph

50 Commits

Author SHA1 Message Date
mpl 8e2867a3e1 fastjpeg: remove work-around for os/exec bug
Because that was a hack for isssue #550 , which has been properly fixed
in Go 1.5

Issue #621

Change-Id: I5def4b0ea2f4887a052985997249d9e71a0b93c9
2016-01-04 22:10:34 +01:00
mpl 6af01f6c71 vendor: move pkg/images dependencies from third_party
This change is in anticipation of moving pkg/images to go4.org, where it
should not depend on packages in third_party.

So:
third_party/github.com/nf/cr2 -> vendor/github.com/nf/cr2
third_party/github.com/rwcarlsen/goexif -> vendor/github.com/rwcarlsen/goexif
third_party/golang.org/x/image/tiff -> vendor/golang.org/x/image/tiff

Note that third_party/go/pkg/image/jpeg was also a dependency of
pkg/images. We had vendored image/jpeg from tip at the time because it
offered advantages over the version from Go1.3
(https://github.com/camlistore/camlistore/issues/463).
Since we now depend on Go1.5, we can go back to depend on the stdlib
version, so we simply remove third_party/go/pkg/image/jpeg and adjust
the imports accordingly.

Change-Id: Ifc8ffae0551102e644a0a0c67f3ff89e04df15c7
2015-12-18 22:15:33 +01:00
mpl 997d400cbd pkg/images/resize: disable TestCompareResizeToHalveInplace for now
It's more important for now to be able to monitor for other failures in
the Camlistore repo than leaving this test on.

After having looked into the issue, I know a little more but not enough
for a definitive conclusion or fix.
It's all added as comments so we don't start from scratch again later.

Also, to make up for the loss of this test, I'm adding two other tests,
TestCompareOriginalToHalveInPlace, and TestCompareOriginalToResized,
that are similar enough to catch other problems in the same context I
believe.

Context: issue #635

Change-Id: I80a30f544fb9ab2e7c69118ef8509d3d687c2d27
2015-11-26 16:59:52 +01:00
mpl be155b4503 pkg/images/resize: fix filenames in tests
Setting the filename from the type, after resizing, does not work anymore
after fc890a65cd , because resized images
are now always RGBA, since we're using xdraw.

Change-Id: I561f43a3ebe9cb3e1d7404295635899ab6b62e7a
2015-11-20 21:43:12 +01:00
mpl fc890a65cd pkg/images/resize: use golang.org/x/image/draw for YCbCr
Later, we should look into using it for more cases. First, to see if we
can phase "halving in place" out, and also to see the gains with other
image types (non YCbCr).

Change-Id: I4b95e2039407f1a91e04cb502674819f17680e02
2015-09-05 01:07:43 +02:00
mpl 710a4236ee pkg/images/resize: show that golang.org/x/image/draw is a win
While investigating issue #635 I remembered that golang.org/x/image/draw
might offer some interesting features. It indeed happens to have some
rescaling routines that seem to work better in the YCbCr case than our
custom code, which is illustrated by these benchmarks:

% go test -v -bench Benchmark.*YCrCb.* -run Bench* -benchmem
% ./pkg/images/resize/
PASS
BenchmarkResizeYCrCb-4   	      20	  79213653 ns/op
9437475 B/op	       5 allocs/op
BenchmarkNewResizeYCrCb-4	     100	  15711294 ns/op
1048668 B/op	       2 allocs/op
BenchmarkHalveYCrCb-4    	     100	  17328467 ns/op
128 B/op	       1 allocs/op
ok  	camlistore.org/pkg/images/resize	5.889s

One can see that not only the new resize is faster, and uses less memory
than the old one, but it is also about as fast as "resizing by halving
in place". And this is with the ApproxBiLinear algorithm; some quick
additional tests seemed to indicate that NearestNeighbor was twice as
fast, with about the same memory usage. I chose ApproxBiLinear as it
seemed the most conservative choice for now.

I think it is also worth investigating whether we can be rid of "halving
in place", since it would make for simpler code overall, and since
ApproxBiLinear might be faster in most cases. It would have the nice
side-effect of solving issue #635 too. However, "halving in place" will
always win when it comes to memory usage, so it depends on our
priorities.

Finally, these other new benchmarks show that using the new resize does
not make the #635 mystery much worse (going from ~16% to ~18%), and that
interestingly the results of the old resize and the new resize are
pretty different by themselves.

% go test -v -run TestCompare ./pkg/images/resize/
=== RUN   TestCompareOldResizeToHalveInplace
--- FAIL: TestCompareOldResizeToHalveInplace (2.49s)
	resize_test.go:377: *image.Gray PSNR 63.7793
	resize_test.go:377: *image.Gray16 PSNR 59.9547
	resize_test.go:377: *image.NRGBA PSNR 62.8252
	resize_test.go:377: *image.NRGBA64 PSNR 62.8252
	resize_test.go:377: *image.Paletted PSNR 51.4949
	resize_test.go:377: *image.RGBA PSNR 62.8252
	resize_test.go:377: *image.RGBA64 PSNR 62.8252
	resize_test.go:377: *image.YCbCr PSNR 61.9664
	resize_test.go:382: *image.YCbCr not the same 18077 pixels
different 16.35%
	resize_test.go:377: *image.YCbCr PSNR 52.4121
	resize_test.go:382: *image.YCbCr not the same 18139 pixels
different 16.40%
	resize_test.go:377: *image.YCbCr PSNR 51.4972
	resize_test.go:382: *image.YCbCr not the same 17932 pixels
different 16.21%
	resize_test.go:377: *image.YCbCr PSNR 51.6399
	resize_test.go:382: *image.YCbCr not the same 17881 pixels
different 16.17%
	resize_test.go:377: *image.YCbCr PSNR 50.7736
	resize_test.go:382: *image.YCbCr not the same 17976 pixels
different 16.25%
	resize_test.go:377: *image.YCbCr PSNR 52.4536
	resize_test.go:382: *image.YCbCr not the same 18180 pixels
different 16.44%
=== RUN   TestCompareNewResizeToHalveInplace
--- FAIL: TestCompareNewResizeToHalveInplace (2.27s)
	resize_test.go:377: *image.Gray PSNR 63.7793
	resize_test.go:377: *image.Gray16 PSNR 59.9547
	resize_test.go:377: *image.NRGBA PSNR 62.8252
	resize_test.go:377: *image.NRGBA64 PSNR 62.8252
	resize_test.go:377: *image.Paletted PSNR 51.4949
	resize_test.go:377: *image.RGBA PSNR 62.8252
	resize_test.go:377: *image.RGBA64 PSNR 62.8252
	resize_test.go:377: *image.YCbCr PSNR 59.5902
	resize_test.go:382: *image.YCbCr not the same 20757 pixels
different 18.77%
	resize_test.go:377: *image.YCbCr PSNR 52.0962
	resize_test.go:382: *image.YCbCr not the same 20811 pixels
different 18.82%
	resize_test.go:377: *image.YCbCr PSNR 51.3374
	resize_test.go:382: *image.YCbCr not the same 20671 pixels
different 18.69%
	resize_test.go:377: *image.YCbCr PSNR 51.3586
	resize_test.go:382: *image.YCbCr not the same 20618 pixels
different 18.64%
	resize_test.go:377: *image.YCbCr PSNR 57.2346
	resize_test.go:382: *image.YCbCr not the same 20705 pixels
different 18.72%
	resize_test.go:377: *image.YCbCr PSNR 50.7504
	resize_test.go:382: *image.YCbCr not the same 20847 pixels
different 18.85%
=== RUN   TestCompareOldResizeToNewResize
--- FAIL: TestCompareOldResizeToNewResize (2.54s)
	resize_test.go:377: *image.Gray PSNR +Inf
	resize_test.go:377: *image.Gray16 PSNR +Inf
	resize_test.go:377: *image.NRGBA PSNR +Inf
	resize_test.go:377: *image.NRGBA64 PSNR +Inf
	resize_test.go:377: *image.Paletted PSNR +Inf
	resize_test.go:377: *image.RGBA PSNR +Inf
	resize_test.go:377: *image.RGBA64 PSNR +Inf
	resize_test.go:377: *image.YCbCr PSNR 59.1024
	resize_test.go:382: *image.YCbCr not the same 16350 pixels
different 14.78%
	resize_test.go:377: *image.YCbCr PSNR 62.6523
	resize_test.go:377: *image.YCbCr PSNR 62.7010
	resize_test.go:377: *image.YCbCr PSNR 59.1396
	resize_test.go:382: *image.YCbCr not the same 16225 pixels
different 14.67%
	resize_test.go:377: *image.YCbCr PSNR 59.0844
	resize_test.go:382: *image.YCbCr not the same 16294 pixels
different 14.73%
	resize_test.go:377: *image.YCbCr PSNR 59.0534
	resize_test.go:382: *image.YCbCr not the same 16413 pixels
different 14.84%

Change-Id: Ia8c578a53416ec0f1cac1477a1a68acfede84b24
2015-09-05 00:59:50 +02:00
mpl be3ea3fe01 images/resize: add YCbCr 4:1:1 and 4:1:0 samples
Also fixed a typo and left TODOs.

Related: issue #635

Change-Id: I6797094c3eaeb26a2d9397c1174c2548fad7d312
2015-08-21 18:17:01 +02:00
mpl a7cf3d3911 pkg/images: TODO for tiff and cr2 test
Change-Id: I4cbabca9a14c943220b878bd077bff04c7e267b2
2015-07-21 16:39:36 +02:00
Bill Thiede 472d59600d images: make cr2 and tiff decoding work together.
https://camlistore.org/r/4936 broke cr2 decoding.  If the tiff library
registers with the standard library's image package before the cr2 library
does, the tiff library will fail to decode cr2 images properly.

Fixes error message:

  tiff: unsupported feature: compression value 6

Seen when generating thumbnails for CR2 files.

Change-Id: I6e5f77fbbf2b5b6615ece46525e33e0bfab9b0cd
2015-07-06 20:46:53 -07:00
Felix Geller f4ff53bbac pkg/index: Retry whole file when EXIF data can't be read
When reading EXIF data from larger TIFF files, we might fail
to read the EXIF data when we only pass in the in-memory
prefix. This change identifies when the third-party library
encounters a short read on a tag/EXIF data and triggers a
retry with the whole file by returning an ErrUnexpectedEOF.

Change-Id: Ie5cdc1613db6ccac49d91a69827f11ca3406a74b
2015-05-25 07:52:50 +12:00
Felix Geller 3b5b5495f9 Adds golang.org/x/image version 76b4869e5a for decoding tiff
source: https://github.com/golang/image/commit/76b4869e5a

Change-Id: I098f1cdc512c1fd15737867acab7630953ec56ea
2015-04-27 21:02:17 +12:00
Brad Fitzpatrick 58035c4c1b pkg/server: richer /status/ page
Shows Camlistore version, Go version, GOOS/GOARCH/cgo support, djpeg availability.

Fixes #594

Change-Id: I9ae8e16bc78765382d8b33e7a69bb9fc56618585
2015-04-02 18:17:18 +02:00
mpl b2cdca7f11 docker/camlistored: use djpeg-static
Issue #564

Change-Id: I4efcbadcedff8f120497869e11784f372d93188e
2015-02-16 19:00:39 +01:00
mpl 9f93493b0b images/fastjpeg: add check for missing loader induced panic
Change-Id: I137945869aa6983a466326338270cbe8331c8ba0
2015-02-10 23:56:18 +01:00
mpl 6819477c6f docker: build djpeg, squash it, use it as base for camlistored
Issue #564

Change-Id: I78e3a7a286dedc413299de7ad4f7a99c6c889fa8
2015-02-10 17:22:51 +01:00
mpl 009e63ea77 images: double-check djpeg's failure with process state, to avoid false
alarm

http://camlistore.org/issue/550

Also fix confusing error msg

Change-Id: I68dd3c5a11f5b32028d21c006d73c55da950a58c
2014-11-27 00:14:30 +01:00
Brad Fitzpatrick a82f603dbc fastjpeg: add a seemingly-missing availability check
Change-Id: I5ab44c1442790e4cceb3f6671f33c57d0c6a4035
2014-10-19 16:44:14 +02:00
Mathieu Lonjaret 312f7a2aa6 Merge "Merge upstream goexif" 2014-09-17 13:49:35 +00:00
Fabian Wickborn 59a451c2dc Merge upstream goexif
This pulls the changes from the current HEAD of
https://github.com/rwcarlsen/goexif
(eb2943811adc24a1a40d6dc0525995d4f8563d08)

Notable changes:
- Removed explicit panics in favor of error returns
- renamed TypeCategory to Format and made format calculated upon
  decoding rather than repeatedly for every format call
- Merged contributions from Camlistore (exif.LatLong(), exif.DateTime()
  etc.)
- Change String method to just return the string value - and don't have
  square brackets if only a single value
- add separate Int and Int64 retrieval methods
- Doc updates

Minor changes in camlistore.org/pkg/* were neccessary to reflect
changes in the API (handling of returned errors) and in names of
exported fields and methods.

Change-Id: I50412b5e68d2c9ca766ff2ad1a4ac26926baccab
2014-09-17 10:40:38 +02:00
kortschak 4ac944c09c images: ensure image value is decoded in all cases
Fixes issue 513.

Change-Id: Icce41e583891a1b581f9d67b211be5a969786155
2014-09-11 06:45:18 +09:30
Fabian Wickborn 2aed1b8241 Renamed goexif folder to match upstream URL
In the advent of github.com/camlistore/goexif to be closed, this
commit renames the goexif folder in third_party to match the
upstream on GitHub.

The affected import paths have been rewritten accordingly.

Change-Id: I5a8871efd01987944b7f5e93979307857ae16fe7
2014-09-05 17:27:59 +02:00
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
Brad Fitzpatrick deb743d1ec Merge "images: add support for fast jpeg down-sampling." 2014-07-21 17:34:27 +00:00
Brad Fitzpatrick a68f8df380 images: fix broken test
Exif.DateTime now always returns a time.Local location when zone is unknown.

Change-Id: I898516398a88bc8dcd8daf26f87c801a24cc1d7a
2014-07-14 09:36:48 -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
Bill Thiede eb7f66fe28 jpeg: enable images/jpeg imported from Go tip.
Addresses https://camlistore.org/issue/463

Change-Id: Ie7b8f937ded78d95875f4cd13b024d0429136981
2014-07-02 21:22:15 -07:00
Brad Fitzpatrick bfe51f3ad5 gofmt
Change-Id: Ie6be315d02a439cbfdd870a0b0b7f16cba12a168
2014-03-20 12:29:45 -07:00
Brad Fitzpatrick 44d8772feb images: minor doc comment update
Change-Id: If7c6ad470c9f3ccb152777225ee955b1f7c28e9c
2014-01-17 16:47:29 -08:00
Bill Thiede cdde1c8803 images/resize: remove commented-out code.
Accidentally snuck in as part of the giant CL
https://camlistore.org/r/1556

Change-Id: I379c613360c4f4c7ca9f3cc67a3b0a570308fa51
2013-12-22 21:22:41 -08:00
Brad Fitzpatrick 30c7d8859a thumbnails: add a cache-busting URL component, support ETag
And quiet noisy logging on normal write failures.

We can now stress test the thumbnail generation by setting
CAMLI_DISABLE_THUMB_CACHE=1 which will make all the thumbnails in the
browsers be unique, and not write them to cache on the server.

Then, when we're happy with the thumbnails, we just increment the
thumbnailVersion string and that busts all the browser- and
server-side caches.

Change-Id: I3cda8e85ab8b1b0b2c9113f6dff613dfbf736028
2013-12-16 20:27:49 -08:00
Brad Fitzpatrick 0d36539f81 Add CAMLI_DISABLE_THUMB_CACHE option for when working on thumbnailer
Change-Id: Ifa99a57c82c67a83fe0b89abaeee407058b00af8
2013-12-16 18:11:52 -08:00
Brad Fitzpatrick 9366723666 Rename pkg/misc/resize to pkg/images/resize
Change-Id: I9b8105cbae0c6dc66ccbb1dd15a48363ee2f1e85
2013-12-16 17:49:28 -08:00
Bill Thiede 2d4fb25c34 images: fix Decode when resize + rotate + max W/H.
Adds more tests to cover rotations with resize when used with
MaxWidth/MaxHeight, previously only ScaledWidth/ScaledHeight were
tested.

Improve tests to compare bounds when determining equality, otherwise
an image sized 0x0 is equal to all other images.

Sort test image filenames so test order is stable and obvious.

Keep more data in memory when indexing images upon receive.  Some
largish CR2 files need more data or the EXIF parsing will fail.

Should address some or all of https://camlistore.org/issue/274

Change-Id: I80d90c33538c9d62ce4480ccb58c003e18ee6629
2013-12-16 10:01:07 -08:00
Bill Thiede 036e35a258 images: performance and memory improvements.
Makes the assumption that our old image logic was 'If the image is
huge (>2400px) shrink it to twice the target thumbnail size with
resample (which is quick) then box filter the image in half (which is
slow)'.  There was a bug there that was causing large intermediary
images to be allocated when the source image was just the right size
and in portrait orientation (mainly trigger by photos from my Nexus 4).

Generalizes resize code to always resample to 2 times the thumbnail
size and then smooth down.  Throws more pixels away faster.

Add downsizing routines that operate inplace.  This greatly reduces
our peak memory usage when generating thumbnails.

Add version optimized for our particular resize case (halving);
providing a speed boost over the generalized versions.

Add tests and benchmarks comparing new resize to old.

Test for pkg/misc/resize can be run with --output=output_dir/ to see
the images generated by the old and new resize routines along with
mask of their differences.

Addresses some of the concerns in https://camlistore.org/issue/237

Change-Id: I6464fa637da9db371f15761bb699c045604b6cb8
2013-12-14 16:28:49 -08:00
Bill Thiede 59ab7e0075 pkg/images: add benchmark for resizing images.
Sample run on my computer:
$ go test -bench . -benchmem
PASS
BenchmarkRescale1000To50              50          45211076 ns/op           92224 B/op          3 allocs/op
BenchmarkRescale1000To100             50          45182185 ns/op          364608 B/op          3 allocs/op
BenchmarkRescale1000To200             50          46602272 ns/op         1445952 B/op          3 allocs/op
BenchmarkRescale1000To400             50          61513579 ns/op         5763136 B/op          3 allocs/op
BenchmarkRescale1000To800             20         104372086 ns/op        23040064 B/op          3 allocs/op
BenchmarkRescale2000To50              10         179838094 ns/op           92224 B/op          3 allocs/op
BenchmarkRescale2000To100             10         180684898 ns/op          364608 B/op          3 allocs/op
BenchmarkRescale2000To200             10         181488279 ns/op         1445952 B/op          3 allocs/op
BenchmarkRescale2000To400             10         186902466 ns/op         5763136 B/op          3 allocs/op
BenchmarkRescale2000To800             10         246418484 ns/op        23040064 B/op          3 allocs/op
BenchmarkRescale4000To50            2000           1305587 ns/op          133251 B/op          5 allocs/op
BenchmarkRescale4000To100            500           5179999 ns/op          528512 B/op          5 allocs/op
BenchmarkRescale4000To200            100          20733512 ns/op         2089088 B/op          5 allocs/op
BenchmarkRescale4000To400             20          82820323 ns/op         8323200 B/op          5 allocs/op
BenchmarkRescale4000To800              5         333289471 ns/op        33280128 B/op          5 allocs/op
BenchmarkRescale8000To50            2000           1397384 ns/op          133251 B/op          5 allocs/op
BenchmarkRescale8000To100            500           5219709 ns/op          528515 B/op          5 allocs/op
BenchmarkRescale8000To200            100          20863617 ns/op         2089089 B/op          5 allocs/op
BenchmarkRescale8000To400             20          83260367 ns/op         8323200 B/op          5 allocs/op
BenchmarkRescale8000To800              5         331035176 ns/op        33280128 B/op          5 allocs/op
ok      camlistore.org/pkg/images       46.780s

Change-Id: Iab21f28f06681faf44b01a75c3bb8b23fb508a81
2013-12-08 22:39:49 -08:00
Bill Thiede 630f6ca61f Document environment variables usage.
Running 'go run dev/envvardoc/envvardoc.go' now shows:
'All environment variables are documented'

I also took the liberty of cleaning-up our mishmash of logic for handling
boolean environment variables, and cleaned up a couple other spots that didn't
seem right.

This change adds docmentation for all variables starting with (CAM|DEV|AWS).
This leaves some variables still undocumented.  If there are variables worth
documenting in the following list, maybe we should rename them to have a
CAM{LI} prefix for consistency's sake:

APPDATA                  pkg/osutil/paths.go:86
APPDATA                  pkg/osutil/paths.go:102
DISPLAY                  pkg/misc/gpgagent/gpgagent.go:126
GOPATH                   pkg/fileembed/genfileembed/genfileembed.go:321
GOPATH                   pkg/osutil/paths.go:168
GOPATH                   pkg/test/world.go:54
GOPATH                   server/appengine/build_test.go:77
GPGKEY                   cmd/camput/init.go:77
GPG_AGENT_INFO           cmd/camput/init.go:153
GPG_AGENT_INFO           pkg/misc/gpgagent/gpgagent.go:50
HOME                     pkg/jsonsign/keys.go:79
HOME                     pkg/jsonsign/signhandler/sig.go:64
HOME                     pkg/osutil/paths.go:36
HOMEPATH                 pkg/osutil/paths.go:34
PKG_CONFIG_PATH          pkg/index/sqlite/dbschema.go:59
RUN_BROKEN_TESTS         pkg/fs/fs_test.go:67
SKIP_DEP_TESTS           pkg/test/testdep.go:29
TERM                     pkg/misc/gpgagent/gpgagent.go:133
TERM                     pkg/misc/pinentry/pinentry.go:99
TESTING_PORT_WRITE_FD    pkg/webserver/webserver.go:135
TEST_GPGAGENT_LIB        pkg/misc/gpgagent/gpgagent_test.go:27
USER                     pkg/netutil/ident.go:135
USER                     pkg/osutil/paths.go:45
USERNAME                 pkg/jsonconfig/eval.go:228
USERNAME                 pkg/osutil/paths.go:43
VERBOSE_FUSE             pkg/fs/fs_test.go:133
VERBOSE_FUSE_STDERR      pkg/fs/fs_test.go:137
XDG_CONFIG_HOME          pkg/osutil/paths.go:104

Change-Id: Ief28710d3deefd1e65247cb5d3b1d8dde73e1f2d
2013-09-06 21:54:03 -07:00
mpl 0dfd84a7d8 search handler: return correct thumbnail dimensions
images: DecodeConfig to get the predicted width
and height after EXIF correction
search&index: add GetImageInfo and use it in search
to predict the thumbnail dimensions

http://camlistore.org/issue/115

Change-Id: I358136a2ab03ea09c8f8fd2fa0dc574921c819c5
2013-03-25 17:06:15 +01:00
mpl fbcb4411df images: move rescaling from server/image to pkg/images
Fixes http://code.google.com/p/camlistore/issues/detail?id=94

Change-Id: Ifa73e0a3ccbbcaef31ae8870d39f63b8a90aad26
2013-02-18 16:44:41 +01:00
mpl 932c13acb7 exif: use DateTimeOriginal if present. Added test for it.
Change-Id: Idfd75b15d7302b5c3a6fbe3464917b16bce56558
2013-01-31 22:06:45 +01:00
mpl d36d5c60d4 images: use the goexif api properly to get orientation tag
Change-Id: Ibcc3880bf93faf5deacded75e2e3b5b44187e0cb
2013-01-21 00:53:29 +01:00
Brad Fitzpatrick d4e4653ae3 images: fix potential crash after decode failure
Change-Id: Ifcf2a09af5a50728bc0b7a9d2208c2580c7c4271
2013-01-19 11:11:59 -08:00
mpl 717dc05fcc images: Decode now returns a Config with a Modified field
This allows to know after a call to images.Decode if the image
was actually rotated or flipped.
Without knowing this, when making a thumbnail, it could happen
(if there was no rescaling required) that an image that needed
being rotated/flipped would not get rotated, because
useBytesUnchanged would still be true.

Change-Id: Ifc5e1e1f5a8543e6754102e3b3a685b736ae8673
2013-01-19 00:19:06 +01:00
Brad Fitzpatrick e16153306a Quiet some image log spam; behind a flag now
Change-Id: Ib43ae05cd98d156e2755536136a991c540d9c97c
2012-12-06 18:01:47 -08:00
mpl f26cd134de Do not error out when "Orientation" tag is absent
Change-Id: I76cfc8066986614c5690f0e27b217fb96b52ae36
2012-11-19 23:40:26 +01:00
mpl fa1269da45 import github.com/camlistore/goexif as a third party
Change-Id: I34842677f4d9335df2478692e0b0d169d00d0942
2012-11-19 23:04:04 +01:00
mpl fbead58f92 fix tests for images and netutil
Change-Id: I89d978ce25cc8748ffab54aa3112e6b854f73b85
2012-11-19 19:52:06 +01:00
mpl 94541905ff use pkg/images (EXIF help) for thumbnails in ui
Change-Id: I60f0102efd1eb5b1c9ca070fe959b499ed8f7c5a
2012-11-15 01:53:58 +01:00
mpl 858326fec1 images: exif, rotation, flipping
This change implements rotation and flipping on images.
It can be done automatically, using the EXIF Orientation as a hint,
or optionally forced.

Change-Id: I97e887599d6a191964344e81cf8e90922313d958
2012-11-12 21:26:53 +01:00
Brad Fitzpatrick a2e01c513b Start of images package and EXIF test files.
Change-Id: Ie623ddc7f6df5cbde890a7c0a47affe91780534b
2012-11-04 16:16:02 +01:00