MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / TestCropGravityPriority

Method TestCropGravityPriority

processing/crop_test.go:494–514  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

492}
493
494func (s *CropTestSuite) TestCropGravityPriority() {
495 cropSize := testSize{50, 50}
496
497 r1 := s.processImage(cropTestCase{
498 gravity: processing.GravityNorth, cropSize: cropSize,
499 })
500 defer r1.Close()
501
502 r2 := s.processImage(cropTestCase{
503 cropGravity: processing.GravityNorth, cropSize: cropSize,
504 })
505 defer r2.Close()
506
507 r3 := s.processImage(cropTestCase{
508 gravity: processing.GravitySouth, cropGravity: processing.GravityNorth, cropSize: cropSize,
509 })
510 defer r3.Close()
511
512 s.Require().True(testutil.ReadersEqual(s.T(), r1.Reader(), r2.Reader()))
513 s.Require().True(testutil.ReadersEqual(s.T(), r1.Reader(), r3.Reader()))
514}
515
516func TestCrop(t *testing.T) {
517 suite.Run(t, new(CropTestSuite))

Callers

nothing calls this directly

Calls 5

ReadersEqualFunction · 0.92
TMethod · 0.80
CloseMethod · 0.65
ReaderMethod · 0.65
processImageMethod · 0.45

Tested by

no test coverage detected