From 9b138c2af3e22300f1d7d5e181a5c8437fa05cb2 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 28 Aug 2024 21:55:42 -0400 Subject: [PATCH] manage-pictures: add note to switch EXIF libraries Signed-off-by: Vincent Batts --- cmd/manage-pictures/main.go | 8 ++++++++ 1 file changed, 8 insertions(+) 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