diff --git a/cmd/manage-pictures/main.go b/cmd/manage-pictures/main.go index d9f8b6b..0d545aa 100644 --- a/cmd/manage-pictures/main.go +++ b/cmd/manage-pictures/main.go @@ -12,6 +12,8 @@ import ( "github.com/rwcarlsen/goexif/mknote" ) +// TODO switch to https://github.com/dsoprea/go-exif + var ( flPicturePath = flag.String("p", filepath.Join(os.Getenv("HOME"), "Pictures"), "Base path for pictures to be stored") flPathFormat = flag.String("f", "2006/01", "formatting for picture path") @@ -75,6 +77,12 @@ func (ps PictureStore) Dest(path string) (string, error) { } defer fh.Close() + defer func() { + if r := recover(); r != nil { + log.Printf("WARN: panic recover in ps.Dest: %s", r) + } + }() + x, err := exif.Decode(fh) if err != nil { return "", err