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

Method processImage

processing/suite_test.go:79–102  ·  view source on GitHub ↗
(opts optsFactory)

Source from the content-addressed store, hash-verified

77}
78
79func (s *testSuite) processImage(opts optsFactory) imagedata.ImageData {
80 s.T().Helper()
81
82 reqPath := "/unsafe/" + opts.URLOptions() + "/plain/local:///" + opts.ImagePath()
83 resp := s.GET(reqPath)
84
85 resultBytes, err := io.ReadAll(resp.Body)
86 s.Require().NoError(err)
87 defer resp.Body.Close()
88
89 s.Require().Equal(
90 http.StatusOK,
91 resp.StatusCode,
92 "Expected status code 200, got %d; Path: %s; Body: %s",
93 resp.StatusCode,
94 reqPath,
95 string(resultBytes),
96 )
97
98 resultData, err := s.Imgproxy().ImageDataFactory().NewFromBytes(resultBytes)
99 s.Require().NoError(err)
100
101 return resultData
102}
103
104func (s *testSuite) processImageAndCheck(tc testCaseParams) {
105 s.T().Helper()

Callers 3

processImageAndCheckMethod · 0.95
processImgMethod · 0.45

Calls 7

TMethod · 0.80
NewFromBytesMethod · 0.80
URLOptionsMethod · 0.65
ImagePathMethod · 0.65
CloseMethod · 0.65
ImageDataFactoryMethod · 0.65
GETMethod · 0.45

Tested by

no test coverage detected