MCPcopy
hub / github.com/h2non/bimg / TestImageExtract

Function TestImageExtract

image_test.go:112–124  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

110}
111
112func TestImageExtract(t *testing.T) {
113 buf, err := initImage("test.jpg").Extract(100, 100, 300, 200)
114 if err != nil {
115 t.Errorf("Cannot process the image: %s", err)
116 }
117
118 err = assertSize(buf, 300, 200)
119 if err != nil {
120 t.Error(err)
121 }
122
123 Write("testdata/test_extract_out.jpg", buf)
124}
125
126func TestImageExtractZero(t *testing.T) {
127 buf, err := initImage("test.jpg").Extract(0, 0, 300, 200)

Callers

nothing calls this directly

Calls 4

initImageFunction · 0.85
assertSizeFunction · 0.85
WriteFunction · 0.85
ExtractMethod · 0.80

Tested by

no test coverage detected