Skip to content

Commit

Permalink
check seek err
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas von Dein committed Jan 6, 2025
1 parent 54980c9 commit 080ae02
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion image.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ func NewImage(buf *bytes.Reader, filename, uri string) (*Image, error) {
return nil, fmt.Errorf("failed to decode image: %w", err)
}

buf.Seek(0, 0)
_, err = buf.Seek(0, 0)
if err != nil {
return nil, fmt.Errorf("failed to seek(0) on image buffer: %w", err)
}

if imgconfig == "jpeg" {
// we're using the format as file extension, but have used
Expand Down

0 comments on commit 080ae02

Please sign in to comment.