From 472d59600ddbdd9cabe15480361d1d363b27a7cf Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Mon, 6 Jul 2015 20:36:33 -0700 Subject: [PATCH] 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 --- pkg/images/images.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/images/images.go b/pkg/images/images.go index 10a6283a9..1b7f64383 100644 --- a/pkg/images/images.go +++ b/pkg/images/images.go @@ -30,12 +30,15 @@ import ( _ "image/gif" _ "image/png" - _ "camlistore.org/third_party/golang.org/x/image/tiff" "camlistore.org/pkg/images/fastjpeg" "camlistore.org/pkg/images/resize" "camlistore.org/third_party/github.com/nf/cr2" "camlistore.org/third_party/github.com/rwcarlsen/goexif/exif" + + // tiff package must be imported after any image packages that decode + // tiff-like formats, i.e. CR2 or DNG + _ "camlistore.org/third_party/golang.org/x/image/tiff" ) var disableThumbCache, _ = strconv.ParseBool(os.Getenv("CAMLI_DISABLE_THUMB_CACHE"))