From a468db2585fd902ca2eaeaeeb14a58c7d9263b32 Mon Sep 17 00:00:00 2001 From: "Stephen McQuay (smcquay)" Date: Tue, 17 May 2016 19:38:08 -0700 Subject: [PATCH] deal with bad exif --- main.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 051727d..8a975bd 100644 --- a/main.go +++ b/main.go @@ -184,7 +184,7 @@ func parse(in <-chan string) <-chan file { case notMedia: log.Printf("%+v", err) default: - log.Printf("%+v", err) + log.Printf("parse error: %+v", err) } continue } else { @@ -222,8 +222,10 @@ func _parse(path string) (file, error) { defer f.Close() x, err := exif.Decode(f) if err != nil { - // TODO: sometimes valid jpgs have bad exif data (issue #1) - return nil, notMedia{path} + if exif.IsCriticalError(err) { + return nil, notMedia{path} + } + log.Printf("%q: exif.Decode, warning: %v", path, err) } tm, err := x.DateTime() if err != nil {