IMG-13: http.Header, *ImageData -> ImageData (#1473)

* ImageData.Headers()

* *ImageData -> ImageData

* withmatt -> httpheaders of our own

* .Clone() headers, nil

* NewFromBytesWithFormat -> nil

* svg.go -> do not Clone()
This commit is contained in:
Victor Sokolov
2025-08-01 15:44:21 +02:00
committed by GitHub
parent e40851e460
commit 3d14c85de3
39 changed files with 356 additions and 258 deletions

View File

@@ -31,7 +31,7 @@ func (s *ProcessingTestSuite) SetupSuite() {
logrus.SetOutput(io.Discard)
}
func (s *ProcessingTestSuite) openFile(name string) *imagedata.ImageData {
func (s *ProcessingTestSuite) openFile(name string) imagedata.ImageData {
secopts := security.Options{
MaxSrcResolution: 10 * 1024 * 1024,
MaxSrcFileSize: 10 * 1024 * 1024,
@@ -43,13 +43,13 @@ func (s *ProcessingTestSuite) openFile(name string) *imagedata.ImageData {
s.Require().NoError(err)
path := filepath.Join(wd, "..", "testdata", name)
imagedata, err := imagedata.FromFile(path, "test image", secopts)
imagedata, err := imagedata.NewFromPath(path, secopts)
s.Require().NoError(err)
return imagedata
}
func (s *ProcessingTestSuite) checkSize(imgdata *imagedata.ImageData, width, height int) {
func (s *ProcessingTestSuite) checkSize(imgdata imagedata.ImageData, width, height int) {
img := new(vips.Image)
err := img.Load(imgdata, 1, 1, 1)
s.Require().NoError(err)