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
}

View File

@ -229,8 +229,7 @@ func GetCursorImage() *types.CursorImage {
mu.Lock()
defer mu.Unlock()
var cur *C.XFixesCursorImage
cur = C.XGetCursorImage()
cur := C.XGetCursorImage()
defer C.XFree(unsafe.Pointer(cur))
width := uint16(cur.width)