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

Function SupportsLoad

vips/vips.go:143–176  ·  view source on GitHub ↗
(it imagetype.Type)

Source from the content-addressed store, hash-verified

141}
142
143func SupportsLoad(it imagetype.Type) bool {
144 if sup, ok := typeSupportLoad.Load(it); ok {
145 return sup.(bool) //nolint:forcetypeassert
146 }
147
148 sup := false
149
150 switch it {
151 case imagetype.JPEG:
152 sup = hasOperation("jpegload_source")
153 case imagetype.JXL:
154 sup = hasOperation("jxlload_source")
155 case imagetype.PNG:
156 sup = hasOperation("pngload_source")
157 case imagetype.WEBP:
158 sup = hasOperation("webpload_source")
159 case imagetype.GIF:
160 sup = hasOperation("gifload_source")
161 case imagetype.BMP:
162 sup = hasOperation("bmpload_source")
163 case imagetype.ICO:
164 sup = hasOperation("icoload_source")
165 case imagetype.SVG:
166 sup = hasOperation("svgload_source")
167 case imagetype.HEIC, imagetype.AVIF:
168 sup = hasOperation("heifload_source")
169 case imagetype.TIFF:
170 sup = hasOperation("tiffload_source")
171 }
172
173 typeSupportLoad.Store(it, sup)
174
175 return sup
176}
177
178func SupportsSave(it imagetype.Type) bool {
179 if sup, ok := typeSupportSave.Load(it); ok {

Callers 2

executeMethod · 0.92
TestMatrixMethod · 0.92

Calls 2

hasOperationFunction · 0.85
LoadMethod · 0.80

Tested by 1

TestMatrixMethod · 0.74