fix(image): tests

This commit is contained in:
Tomas Aparicio 2015-04-07 23:53:48 +02:00
parent abd6679f58
commit 4330593138
4 changed files with 36 additions and 24 deletions

View file

@ -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)