From e32a369e76a08012d0f54db41f245146e480fad9 Mon Sep 17 00:00:00 2001 From: F4310sp Date: Sat, 21 Sep 2024 22:28:16 -0300 Subject: [PATCH] Fixing shuffled image --- chipper/pkg/wirepod/sdkapp/server.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/chipper/pkg/wirepod/sdkapp/server.go b/chipper/pkg/wirepod/sdkapp/server.go index 2f05dfdd..827014a1 100755 --- a/chipper/pkg/wirepod/sdkapp/server.go +++ b/chipper/pkg/wirepod/sdkapp/server.go @@ -147,13 +147,6 @@ func SdkapiHandler(w http.ResponseWriter, r *http.Request) { defer imgPath.Close() - solidFaceBytes := make([]byte, 17664*10) // 17664 pixels, 3 bytes por pixel - for i := 0; i < len(solidFaceBytes); i += 3 { - solidFaceBytes[i] = 255 // R - solidFaceBytes[i+1] = 0 // G - solidFaceBytes[i+2] = 0 // B - } - img, _, err := image.Decode(imgPath) if err != nil { http.Error(w, "Error reading image: "+err.Error(), http.StatusInternalServerError) @@ -185,7 +178,7 @@ func SdkapiHandler(w http.ResponseWriter, r *http.Request) { } // Reads the image and handles possible errors - //faceBytes, err := rgbToBytes(rgbValues) + faceBytes, err := rgbToBytes(rgbValues) if err != nil { http.Error(w, "Error reading image: "+err.Error(), http.StatusInternalServerError) return @@ -199,7 +192,7 @@ func SdkapiHandler(w http.ResponseWriter, r *http.Request) { // call DisplayFaceImageRGB e handle error resp, err := robot.Conn.DisplayFaceImageRGB(ctx, &vectorpb.DisplayFaceImageRGBRequest{ - FaceData: solidFaceBytes, + FaceData: faceBytes, DurationMs: uint32(duration), InterruptRunning: true, })