(c *Context, shrink float64)
| 10 | ) |
| 11 | |
| 12 | func (p *Processor) canScaleOnLoad(c *Context, shrink float64) bool { |
| 13 | if c.ImgData == nil || shrink == 1 { |
| 14 | return false |
| 15 | } |
| 16 | |
| 17 | if c.ImgData.Format().IsVector() { |
| 18 | return true |
| 19 | } |
| 20 | |
| 21 | if p.config.DisableShrinkOnLoad || shrink <= 1 { |
| 22 | return false |
| 23 | } |
| 24 | |
| 25 | return c.ImgData.Format() == imagetype.JPEG || |
| 26 | c.ImgData.Format() == imagetype.WEBP || |
| 27 | c.ImgData.Format().SupportsThumbnail() |
| 28 | } |
| 29 | |
| 30 | func calcJpegShink(shrink float64) float64 { |
| 31 | switch { |
no test coverage detected