(shrink float64)
| 28 | } |
| 29 | |
| 30 | func calcJpegShink(shrink float64) float64 { |
| 31 | switch { |
| 32 | case shrink >= 8: |
| 33 | return 8 |
| 34 | case shrink >= 4: |
| 35 | return 4 |
| 36 | case shrink >= 2: |
| 37 | return 2 |
| 38 | } |
| 39 | |
| 40 | return 1 |
| 41 | } |
| 42 | |
| 43 | func (p *Processor) scaleOnLoad(c *Context) error { |
| 44 | // Get the preshrink value based on the requested scales. |