1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-12-23 22:11:10 +02:00
Files
imgproxy/processing/scale.go

16 lines
276 B
Go
Raw Permalink Normal View History

2021-04-26 17:52:50 +06:00
package processing
func (p *Processor) scale(c *Context) error {
2025-09-18 10:29:42 +02:00
if c.WScale == 1 && c.HScale == 1 {
return nil
}
2025-09-18 10:29:42 +02:00
wscale, hscale := c.WScale, c.HScale
2025-09-23 20:16:36 +03:00
if (c.Angle+c.PO.Rotate())%180 == 90 {
wscale, hscale = hscale, wscale
}
2022-01-17 18:41:53 +06:00
2025-09-18 10:29:42 +02:00
return c.Img.Resize(wscale, hscale)
2021-04-26 17:52:50 +06:00
}