Skip to content

Commit

Permalink
Add option to set jpeg quality level. Closes #371
Browse files Browse the repository at this point in the history
  • Loading branch information
deluan committed Jun 29, 2020
1 parent f0ee52a commit 2371e9b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions conf/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type nd struct {
ProbeCommand string `default:"ffmpeg %s -f ffmetadata"`

CoverArtPriority string `default:"embedded, cover.*, folder.*, front.*"`
CoverJpegQuality int `default:"75"`

// DevFlags. These are used to enable/disable debugging and incomplete features
DevLogSourceLine bool `default:"false"`
Expand Down
2 changes: 1 addition & 1 deletion engine/cover.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func resizeImage(reader io.Reader, size int) ([]byte, error) {
}
m := imaging.Resize(img, size, size, imaging.Lanczos)
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
}

Expand Down

0 comments on commit 2371e9b

Please sign in to comment.