diff --git a/image/private/kernel.js b/image/private/kernel.js index 1b0a6d9..8fe4d12 100644 --- a/image/private/kernel.js +++ b/image/private/kernel.js @@ -619,8 +619,8 @@ var ScaleImage = function(xFactor, yFactor, img) { Math.floor((img.getHeight() * yFactor) / 2)); this.img = img; - this.width = img.getWidth() * xFactor; - this.height = img.getHeight() * yFactor; + this.width = Math.floor(img.getWidth() * xFactor); + this.height = Math.floor(img.getHeight() * yFactor); this.xFactor = xFactor; this.yFactor = yFactor; }; diff --git a/tests/clipart-test/clipart.rkt b/tests/clipart-test/clipart.rkt index f8b86e3..831a6e3 100644 --- a/tests/clipart-test/clipart.rkt +++ b/tests/clipart-test/clipart.rkt @@ -116,6 +116,9 @@ ;(define D (overlay XDOG BG)) ;(define CDOG (overlay (clipart/url DOGURL) BG)) ;D +(image-width DOG) +(image-height DOG) + (define colors (image->color-list DOG)) (displayln (length colors))