MCPcopy
hub / github.com/willnorris/imageproxy / TestTransform_InvalidFormat

Function TestTransform_InvalidFormat

transform_test.go:159–170  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

157}
158
159func TestTransform_InvalidFormat(t *testing.T) {
160 src := newImage(2, 2, red, green, blue, yellow)
161 buf := new(bytes.Buffer)
162 if err := png.Encode(buf, src); err != nil {
163 t.Errorf("error encoding reference image: %v", err)
164 }
165
166 _, err := Transform(buf.Bytes(), Options{Format: "invalid"})
167 if err == nil {
168 t.Errorf("Transform with invalid format did not return expected error")
169 }
170}
171
172// Test that each of the eight EXIF orientations is applied to the transformed
173// image appropriately.

Callers

nothing calls this directly

Calls 2

newImageFunction · 0.85
TransformFunction · 0.85

Tested by

no test coverage detected