findPreferredFormat finds a suitable preferred format based on image's properties.
(animated, expectTransparency bool)
| 350 | |
| 351 | // findPreferredFormat finds a suitable preferred format based on image's properties. |
| 352 | func (p *Processor) findPreferredFormat(animated, expectTransparency bool) imagetype.Type { |
| 353 | for _, t := range p.config.PreferredFormats { |
| 354 | if p.isImageTypeCompatible(t, animated, expectTransparency) { |
| 355 | return t |
| 356 | } |
| 357 | } |
| 358 | |
| 359 | return p.config.PreferredFormats[0] |
| 360 | } |
| 361 | |
| 362 | func (p *Processor) transformImage( |
| 363 | ctx context.Context, |
no test coverage detected