Skip to content

Commit

Permalink
fix bug introduced patching issue #347
Browse files Browse the repository at this point in the history
  • Loading branch information
DocSavage committed Sep 11, 2020
1 parent e7fd12b commit 0152ac3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions datatype/imageblk/imageblk.go
Original file line number Diff line number Diff line change
Expand Up @@ -1816,11 +1816,6 @@ func debugData(img image.Image, message string) {
func (d *Data) SendUnserializedBlock(w http.ResponseWriter, x, y, z int32, v []byte, compression string) error {
var data []byte
switch compression {
case "jpeg":
if d.Compression().Format() != dvid.JPEG {
return fmt.Errorf("can't encode JPEG: expected internal block data to be JPEG, was %s instead", d.Compression().Format())
}
data = v
case "uncompressed":
b := bytes.NewBuffer(v)
imgdata, err := jpeg.Decode(b)
Expand All @@ -1830,6 +1825,8 @@ func (d *Data) SendUnserializedBlock(w http.ResponseWriter, x, y, z int32, v []b

data2 := imgdata.(*image.Gray)
data = data2.Pix
default: // JPEG by default
data = v
}

// Send block coordinate and size of data.
Expand Down

0 comments on commit 0152ac3

Please sign in to comment.