mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-14 18:05:55 -07:00
fix(image): tests
This commit is contained in:
parent
abd6679f58
commit
4330593138
4 changed files with 36 additions and 24 deletions
|
|
@ -82,7 +82,10 @@ func Resize(buf []byte, o Options) ([]byte, error) {
|
|||
}
|
||||
|
||||
// Transform image if necessary
|
||||
if o.Width != inWidth || o.Height != inHeight {
|
||||
debug(">>>>> Resolution %dx%d -> %dx%d", o.Width, o.Height, inWidth, inHeight)
|
||||
|
||||
shouldExtract := o.Width != inWidth || o.Height != inHeight || o.AreaWidth > 0 || o.AreaHeight > 0
|
||||
if shouldExtract {
|
||||
// Use vips_shrink with the integral reduction
|
||||
if shrink > 1 {
|
||||
image, residual, err = shrinkImage(image, o, residual, shrink)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue