minor lint fixes.

This commit is contained in:
Miroslav Šedivý
2021-01-25 17:31:24 +01:00
parent 47689d5372
commit 51d061e9aa
2 changed files with 8 additions and 9 deletions

View File

@ -77,17 +77,17 @@ func (h *RoomHandler) screenConfigurationsList(w http.ResponseWriter, r *http.Re
}
func (h *RoomHandler) screenShotGet(w http.ResponseWriter, r *http.Request) {
var options *jpeg.Options
if quality, err := strconv.Atoi(r.URL.Query().Get("quality")); err == nil {
options = &jpeg.Options{ quality }
} else {
options = &jpeg.Options{ 90 }
quality, err := strconv.Atoi(r.URL.Query().Get("quality"))
if err != nil {
quality = 90
}
img := h.desktop.GetScreenshotImage()
out := new(bytes.Buffer)
err := jpeg.Encode(out, img, options)
if err != nil {
if err := jpeg.Encode(out, img, &jpeg.Options{
Quality: quality,
}); err != nil {
utils.HttpInternalServerError(w, err)
return
}