Skip to content

Commit

Permalink
verification for jpeg format
Browse files Browse the repository at this point in the history
  • Loading branch information
wcomnisky committed Aug 27, 2023
1 parent c1b1e94 commit 5ee7ab6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion imageoptim.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ func Quality(preset string) Option {
}

func Format(name string) Option {
return Option{fmt.Sprintf("format=%s", name)}
n := strings.ToLower(name)
if n == "jpg" {
n = "jpeg"
}
return Option{fmt.Sprintf("format=%s", n)}
}

func Timeout(seconds int) Option {
Expand Down

0 comments on commit 5ee7ab6

Please sign in to comment.