mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-10 16:00:26 -07:00
Use vips reduce when downscaling
This commit is contained in:
parent
878125c410
commit
dc3286965b
3 changed files with 22 additions and 1 deletions
|
|
@ -198,7 +198,11 @@ func transformImage(image *C.VipsImage, o Options, shrink int, residual float64)
|
|||
}
|
||||
|
||||
if o.Force || residual != 0 {
|
||||
image, err = vipsAffine(image, residualx, residualy, o.Interpolator)
|
||||
if residualx < 1 && residualy < 1 {
|
||||
image, err = vipsReduce(image, 1/residualx, 1/residualy)
|
||||
} else {
|
||||
image, err = vipsAffine(image, residualx, residualy, o.Interpolator)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue