mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-04-24 20:36:24 +02:00
rename jpegQuality to defaultQuality
Also fix a few go vet errors
This commit is contained in:
parent
e7b0a5b88c
commit
d74dd6e985
3 changed files with 9 additions and 10 deletions
|
|
@ -24,8 +24,8 @@ import (
|
|||
"github.com/disintegration/imaging"
|
||||
)
|
||||
|
||||
// compression quality of resized jpegs
|
||||
const jpegQuality = 95
|
||||
// default compression quality of resized jpegs
|
||||
const defaultQuality = 95
|
||||
|
||||
// resample filter used when resizing images
|
||||
var resampleFilter = imaging.Lanczos
|
||||
|
|
@ -54,9 +54,8 @@ func Transform(img []byte, opt Options) ([]byte, error) {
|
|||
gif.Encode(buf, m, nil)
|
||||
case "jpeg":
|
||||
quality := opt.Quality
|
||||
|
||||
if quality == 0 {
|
||||
quality = jpegQuality
|
||||
quality = defaultQuality
|
||||
}
|
||||
|
||||
jpeg.Encode(buf, m, &jpeg.Options{Quality: quality})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue