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

Function TestImageCrop

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

Source from the content-addressed store, hash-verified

166}
167
168func TestImageCrop(t *testing.T) {
169 buf, err := initImage("test.jpg").Crop(800, 600, GravityNorth)
170 if err != nil {
171 t.Errorf("Cannot process the image: %s", err)
172 }
173
174 err = assertSize(buf, 800, 600)
175 if err != nil {
176 t.Error(err)
177 }
178
179 Write("testdata/test_crop_out.jpg", buf)
180}
181
182func TestImageCropByWidth(t *testing.T) {
183 buf, err := initImage("test.jpg").CropByWidth(600)

Callers

nothing calls this directly

Calls 4

initImageFunction · 0.85
assertSizeFunction · 0.85
WriteFunction · 0.85
CropMethod · 0.80

Tested by

no test coverage detected