diff options
author | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-06-25 20:45:43 +0200 |
---|---|---|
committer | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-06-25 20:45:43 +0200 |
commit | e1c8bb1bd5381d8ade3c699a2d6b4fb373112880 (patch) | |
tree | 924317fecd5f55c29c287d89dc5627bbbd73327c /pkg/fileop | |
parent | 249ee195ce52ee4a4defeb67a33ef353919d3a11 (diff) | |
download | lens-e1c8bb1bd5381d8ade3c699a2d6b4fb373112880.tar.gz lens-e1c8bb1bd5381d8ade3c699a2d6b4fb373112880.tar.bz2 lens-e1c8bb1bd5381d8ade3c699a2d6b4fb373112880.zip |
feat: Store image size
Add image dimensions to exif fetch.
Diffstat (limited to 'pkg/fileop')
-rw-r--r-- | pkg/fileop/exif.go | 11 |
1 files changed, 11 insertions, 0 deletions
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 { |