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

Function NewFromBytesWithFormat

imagedata/factory.go:44–50  ·  view source on GitHub ↗

NewFromBytesWithFormat creates a new ImageData instance from the provided format and byte slice.

(format imagetype.Type, b []byte)

Source from the content-addressed store, hash-verified

42// NewFromBytesWithFormat creates a new ImageData instance from the provided format
43// and byte slice.
44func NewFromBytesWithFormat(format imagetype.Type, b []byte) ImageData {
45 return &imageDataBytes{
46 data: b,
47 format: format,
48 cancel: nil,
49 }
50}
51
52// NewFromBytes creates a new ImageData instance from the provided byte slice.
53func (f *Factory) NewFromBytes(b []byte) (ImageData, error) {

Callers 7

SaveMethod · 0.92
TestSkipProcessingSVGMethod · 0.92
sanitizeMethod · 0.92
readTestFileMethod · 0.92
BenchmarkSvgProcessingFunction · 0.92
NewFromBytesMethod · 0.85
DownloadSyncMethod · 0.85

Calls

no outgoing calls

Tested by 3

TestSkipProcessingSVGMethod · 0.74
readTestFileMethod · 0.74
BenchmarkSvgProcessingFunction · 0.74