mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-07-02 22:46:50 +02:00
Fix scale recalculation after scale-on-load
This commit is contained in:
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
### Fix
|
### Fix
|
||||||
- Fix Client Hints behavior. `Width` is physical size, so we should divide it by `DPR` value.
|
- Fix Client Hints behavior. `Width` is physical size, so we should divide it by `DPR` value.
|
||||||
|
- Fix scale-on-load in some rare cases.
|
||||||
|
|
||||||
## [3.0.0.beta1] - 2021-10-01
|
## [3.0.0.beta1] - 2021-10-01
|
||||||
### Added
|
### Added
|
||||||
|
@ -59,12 +59,12 @@ func scaleOnLoad(pctx *pipelineContext, img *vips.Image, po *options.ProcessingO
|
|||||||
newWidth, newHeight, _, _ := extractMeta(img, po.Rotate, po.AutoRotate)
|
newWidth, newHeight, _, _ := extractMeta(img, po.Rotate, po.AutoRotate)
|
||||||
|
|
||||||
pctx.wscale = float64(pctx.srcWidth) * pctx.wscale / float64(newWidth)
|
pctx.wscale = float64(pctx.srcWidth) * pctx.wscale / float64(newWidth)
|
||||||
if pctx.srcWidth == imath.Scale(pctx.srcWidth, pctx.wscale) {
|
if newWidth == imath.Scale(newWidth, pctx.wscale) {
|
||||||
pctx.wscale = 1.0
|
pctx.wscale = 1.0
|
||||||
}
|
}
|
||||||
|
|
||||||
pctx.hscale = float64(pctx.srcHeight) * pctx.hscale / float64(newHeight)
|
pctx.hscale = float64(pctx.srcHeight) * pctx.hscale / float64(newHeight)
|
||||||
if pctx.srcHeight == imath.Scale(pctx.srcHeight, pctx.hscale) {
|
if newHeight == imath.Scale(newHeight, pctx.hscale) {
|
||||||
pctx.hscale = 1.0
|
pctx.hscale = 1.0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user