Handle EOF markers when reading EXIF data

This commit is contained in:
Eli Ribble 2026-03-11 22:54:41 +00:00
parent 182fd7d229
commit e63646c9a1
No known key found for this signature in database

View file

@ -3,6 +3,7 @@ package rmo
import (
"bytes"
"context"
"errors"
"fmt"
"image"
_ "image/gif" // register GIF format
@ -71,6 +72,8 @@ func extractExif(content_type string, file_bytes []byte) (result *ExifCollection
if err != nil {
if err.Error() == "exif: failed to find exif intro marker" {
return nil, nil
} else if errors.Is(err, io.EOF) {
return nil, nil
}
return nil, fmt.Errorf("Failed to decode image meta: %w", err)
}