mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 13:07:36 +03:00
Add option to set jpeg quality level. Closes #371
This commit is contained in:
parent
f0ee52a98e
commit
2371e9b943
2 changed files with 2 additions and 1 deletions
|
@ -34,6 +34,7 @@ type nd struct {
|
||||||
ProbeCommand string `default:"ffmpeg %s -f ffmetadata"`
|
ProbeCommand string `default:"ffmpeg %s -f ffmetadata"`
|
||||||
|
|
||||||
CoverArtPriority string `default:"embedded, cover.*, folder.*, front.*"`
|
CoverArtPriority string `default:"embedded, cover.*, folder.*, front.*"`
|
||||||
|
CoverJpegQuality int `default:"75"`
|
||||||
|
|
||||||
// DevFlags. These are used to enable/disable debugging and incomplete features
|
// DevFlags. These are used to enable/disable debugging and incomplete features
|
||||||
DevLogSourceLine bool `default:"false"`
|
DevLogSourceLine bool `default:"false"`
|
||||||
|
|
|
@ -163,7 +163,7 @@ func resizeImage(reader io.Reader, size int) ([]byte, error) {
|
||||||
}
|
}
|
||||||
m := imaging.Resize(img, size, size, imaging.Lanczos)
|
m := imaging.Resize(img, size, size, imaging.Lanczos)
|
||||||
buf := new(bytes.Buffer)
|
buf := new(bytes.Buffer)
|
||||||
err = jpeg.Encode(buf, m, &jpeg.Options{Quality: 75})
|
err = jpeg.Encode(buf, m, &jpeg.Options{Quality: conf.Server.CoverJpegQuality})
|
||||||
return buf.Bytes(), err
|
return buf.Bytes(), err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue