Skip to content

Commit b077b21

Browse files
committed
Fixing shuffled image
1 parent 4394fe0 commit b077b21

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

chipper/pkg/wirepod/sdkapp/server.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"fmt"
88
"image"
99
"image/jpeg"
10-
"image/png"
1110
"io"
1211
"net/http"
1312
"os"
@@ -179,14 +178,12 @@ func SdkapiHandler(w http.ResponseWriter, r *http.Request) {
179178
// }
180179

181180
// Reads the image and handles possible errors
182-
var buf bytes.Buffer
183-
err = png.Encode(&buf, img)
181+
faceBytes, err := imageToBytes(img)
184182
if err != nil {
185183
http.Error(w, "Error reading image: "+err.Error(), http.StatusInternalServerError)
186184
return
187185
}
188186

189-
faceBytes := buf.Bytes()
190187
ctx := r.Context()
191188
ctx, cancel := context.WithTimeout(ctx, 15*time.Second)
192189
defer cancel()

0 commit comments

Comments
 (0)