Skip to content

Commit

Permalink
Revert "fix failing encode image test (viamrobotics#1995)"
Browse files Browse the repository at this point in the history
This reverts commit 723e4ca.
  • Loading branch information
bhaney committed Mar 7, 2023
1 parent 7ccb3ea commit 57ee5d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions rimage/image_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"strings"

"github.com/lmittmann/ppm"
libjpeg "github.com/pixiv/go-libjpeg/jpeg"
"github.com/pkg/errors"
"github.com/xfmoulet/qoi"
"go.opencensus.io/trace"
Expand All @@ -36,8 +35,6 @@ var RGBABitmapMagicNumber = []byte("RGBA")
// for raw DEPTH data.
var DepthMapMagicNumber = []byte("DEPTHMAP")

var jpegEncoderOptions = &libjpeg.EncoderOptions{Quality: 75, DCTMethod: libjpeg.DCTIFast}

// RawRGBAHeaderLength is the length of our custom header for raw RGBA data
// in bytes. See above as to why.
const RawRGBAHeaderLength = 12
Expand Down
4 changes: 2 additions & 2 deletions rimage/image_file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"bytes"
"context"
"image"
"image/jpeg"
"image/png"
"os"
"testing"

libjpeg "github.com/viam-labs/go-libjpeg/jpeg"
"go.viam.com/test"
"go.viam.com/utils/artifact"

Expand Down Expand Up @@ -57,7 +57,7 @@ func TestEncodeImage(t *testing.T) {
test.That(t, png.Encode(&buf, img), test.ShouldBeNil)

var bufJPEG bytes.Buffer
test.That(t, libjpeg.Encode(&bufJPEG, img, jpegEncoderOptions), test.ShouldBeNil)
test.That(t, jpeg.Encode(&bufJPEG, img, nil), test.ShouldBeNil)

t.Run("lazy", func(t *testing.T) {
// fast
Expand Down

0 comments on commit 57ee5d9

Please sign in to comment.