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) { func (h *RoomHandler) screenShotGet(w http.ResponseWriter, r *http.Request) {
var options *jpeg.Options quality, err := strconv.Atoi(r.URL.Query().Get("quality"))
if quality, err := strconv.Atoi(r.URL.Query().Get("quality")); err == nil { if err != nil {
options = &jpeg.Options{ quality } quality = 90
} else {
options = &jpeg.Options{ 90 }
} }
img := h.desktop.GetScreenshotImage() img := h.desktop.GetScreenshotImage()
out := new(bytes.Buffer) 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) utils.HttpInternalServerError(w, err)
return return
} }

View File

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