Skip to content

Commit

Permalink
Keep adjusting quality for AVIF
Browse files Browse the repository at this point in the history
  • Loading branch information
dooman87 committed Sep 17, 2020
1 parent d770d60 commit d3f2dcf
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions img/processor/imagemagick.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,14 @@ func getQualityOptions(inf *ImageInfo, outputMimeType string) []string {
return []string{"-quality", "82"}
}

if outputMimeType == "image/avif" && inf.quality > 85 {
return []string{"-quality", "70"}
}

if outputMimeType == "image/avif" && inf.quality <= 85 {
return []string{"-quality", "60"}
if outputMimeType == "image/avif" {
if inf.quality > 85 {
return []string{"-quality", "70"}
} else if inf.quality > 75 {
return []string{"-quality", "60"}
} else {
return []string{"-quality", "50"}
}
}

return []string{}
Expand Down

0 comments on commit d3f2dcf

Please sign in to comment.