(tc testCaseParams)
| 102 | } |
| 103 | |
| 104 | func (s *testSuite) processImageAndCheck(tc testCaseParams) { |
| 105 | s.T().Helper() |
| 106 | |
| 107 | resultData := s.processImage(tc.Options()) |
| 108 | defer resultData.Close() |
| 109 | |
| 110 | // Load the result image to check its size and interpretation |
| 111 | resultImg := new(vips.Image) |
| 112 | defer resultImg.Clear() |
| 113 | |
| 114 | err := resultImg.Load(resultData, 1.0, 0, 1) |
| 115 | s.Require().NoError(err) |
| 116 | |
| 117 | outSize := tc.OutSize() |
| 118 | outInterpretation := tc.OutInterpretation() |
| 119 | |
| 120 | s.Require().Equal(resultImg.Width(), outSize.width, "Width mismatch") |
| 121 | s.Require().Equal(resultImg.Height(), outSize.height, "Height mismatch") |
| 122 | |
| 123 | if outInterpretation != vips.InterpretationMultiBand { |
| 124 | // Check the interpretation |
| 125 | actualInterpretation := resultImg.Type() |
| 126 | s.Require().Equal(outInterpretation, actualInterpretation) |
| 127 | } |
| 128 | |
| 129 | s.ImageMatcher().ImageMatches(s.T(), resultData.Reader(), "test", 0.0005) |
| 130 | } |
no test coverage detected