I'm sure there's still lots of refinement that needs to be done here, but this
seems like a good checkpoint.
Change-Id: Ida808464c0cc40c84f7f79c016d3c6a148d50a32
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
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
Previously, every time you restarted the server, it forgot about all
thumbnails previously generated. (in practice it didn't/doesn't
matter with a single user, though, since they're still cached in the
browser and we always reply to If-Modified-Since immediately without
checking the cache) But it'll matter more with the Publish handler.
Also, rename some stuff, clean up some stuff, drop an unused interface.
And then necessarily change the serverconfig low-level generator to use
a kvfile for the thumbmeta map when using local disk for blobs.
--
Change-Id: I4dcfcb21429a440aa118794c03f7abf7bd69c33b
benchmark old ns/op new ns/op delta
BenchmarkQueryRecentPermanodes 27987 27512 -1.70%
benchmark old allocs new allocs delta
BenchmarkQueryRecentPermanodes 99 87 -12.12%
benchmark old bytes new bytes delta
BenchmarkQueryRecentPermanodes 6433 6207 -3.51%
But will be better in practice with more blobs.
Change-Id: I4673702231c52864249329818145aad11da2b4fc