MCPcopy Index your code
hub / github.com/docker/docker-agent / createTestJPEG

Function createTestJPEG

pkg/chat/image_test.go:83–94  ·  view source on GitHub ↗
(t *testing.T, w, h int)

Source from the content-addressed store, hash-verified

81}
82
83func createTestJPEG(t *testing.T, w, h int) []byte {
84 t.Helper()
85 img := image.NewRGBA(image.Rect(0, 0, w, h))
86 for y := range h {
87 for x := range w {
88 img.Set(x, y, color.RGBA{R: 0, G: 128, B: 255, A: 255})
89 }
90 }
91 var buf bytes.Buffer
92 require.NoError(t, jpeg.Encode(&buf, img, &jpeg.Options{Quality: 90}))
93 return buf.Bytes()
94}
95
96func TestResizeImage_NoResizeNeeded(t *testing.T) {
97 t.Parallel()

Callers 1

TestResizeImage_JPEGFunction · 0.70

Calls 2

BytesMethod · 0.95
SetMethod · 0.45

Tested by

no test coverage detected