Skip to content

Commit

Permalink
fix #234
Browse files Browse the repository at this point in the history
2: 5.9s - 7.6MB
4: 26s - 6.9MB
  • Loading branch information
BennyThink committed Jun 21, 2023
1 parent 5e730c7 commit c1ddabb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions encoder/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,16 @@ func webpEncoder(p1, p2 string, extraParams config.ExtraParams) error {
// If quality >= 100, we use lossless mode
if quality >= 100 {
buf, _, err = img.ExportWebp(&vips.WebpExportParams{
Lossless: true,
StripMetadata: true,
Lossless: true,
StripMetadata: true,
ReductionEffort: 2,
})
} else {
buf, _, err = img.ExportWebp(&vips.WebpExportParams{
Quality: quality,
Lossless: false,
StripMetadata: true,
Quality: quality,
Lossless: false,
StripMetadata: true,
ReductionEffort: 2,
})
}

Expand Down

0 comments on commit c1ddabb

Please sign in to comment.