mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
minor lint fixes.
This commit is contained in:
parent
47689d5372
commit
51d061e9aa
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user