From e1c8bb1bd5381d8ade3c699a2d6b4fb373112880 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Sun, 25 Jun 2023 20:45:43 +0200 Subject: feat: Store image size Add image dimensions to exif fetch. --- pkg/fileop/exif.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'pkg/fileop') diff --git a/pkg/fileop/exif.go b/pkg/fileop/exif.go index c2449ad..79716eb 100644 --- a/pkg/fileop/exif.go +++ b/pkg/fileop/exif.go @@ -37,6 +37,17 @@ func ReadExif(path string) (*media.MediaEXIF, error) { newExif.Maker = &make } + // Get Image Size + width, err := fileInfo.GetFloat("ImageWidth") + if err == nil { + newExif.Width = &width + } + + height, err := fileInfo.GetFloat("ImageHeight") + if err == nil { + newExif.Height = &height + } + // Get lens lens, err := fileInfo.GetString("LensModel") if err == nil { -- cgit v1.2.3