MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / calcJpegShink

Function calcJpegShink

processing/scale_on_load.go:30–41  ·  view source on GitHub ↗
(shrink float64)

Source from the content-addressed store, hash-verified

28}
29
30func 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
43func (p *Processor) scaleOnLoad(c *Context) error {
44 // Get the preshrink value based on the requested scales.

Callers 1

scaleOnLoadMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected