Commit Graph

15 Commits

Author SHA1 Message Date
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