isImageTypeCompatible checks if the given image type is compatible with the image properties.
( imgtype imagetype.Type, animated, expectTransparency bool, )
| 334 | |
| 335 | // isImageTypeCompatible checks if the given image type is compatible with the image properties. |
| 336 | func (p *Processor) isImageTypeCompatible( |
| 337 | imgtype imagetype.Type, |
| 338 | animated, expectTransparency bool, |
| 339 | ) bool { |
| 340 | if animated && !imgtype.SupportsAnimationSave() { |
| 341 | return false |
| 342 | } |
| 343 | |
| 344 | if expectTransparency && !imgtype.SupportsAlpha() { |
| 345 | return false |
| 346 | } |
| 347 | |
| 348 | return true |
| 349 | } |
| 350 | |
| 351 | // findPreferredFormat finds a suitable preferred format based on image's properties. |
| 352 | func (p *Processor) findPreferredFormat(animated, expectTransparency bool) imagetype.Type { |
no test coverage detected