| 141 | } |
| 142 | |
| 143 | func 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 | |
| 178 | func SupportsSave(it imagetype.Type) bool { |
| 179 | if sup, ok := typeSupportSave.Load(it); ok { |