Handle EOF markers when reading EXIF data
This commit is contained in:
parent
182fd7d229
commit
e63646c9a1
1 changed files with 3 additions and 0 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue