1
0
Fork 0
mirror of https://github.com/vbatts/freezing-octo-hipster.git synced 2024-11-24 07:55:39 +00:00

manage-pictures: add note to switch EXIF libraries

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2024-08-28 21:55:42 -04:00
parent 06d43c4356
commit 9b138c2af3
Signed by: vbatts
GPG key ID: E30EFAA812C6E5ED

View file

@ -12,6 +12,8 @@ import (
"github.com/rwcarlsen/goexif/mknote" "github.com/rwcarlsen/goexif/mknote"
) )
// TODO switch to https://github.com/dsoprea/go-exif
var ( var (
flPicturePath = flag.String("p", filepath.Join(os.Getenv("HOME"), "Pictures"), "Base path for pictures to be stored") 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") 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 fh.Close()
defer func() {
if r := recover(); r != nil {
log.Printf("WARN: panic recover in ps.Dest: %s", r)
}
}()
x, err := exif.Decode(fh) x, err := exif.Decode(fh)
if err != nil { if err != nil {
return "", err return "", err