From b00090f1a8f87c7c6e29ff72097861e20b30eed3 Mon Sep 17 00:00:00 2001 From: Cheng Wang <1688764+wangcheng678@users.noreply.github.com> Date: Thu, 12 Dec 2019 22:45:50 +0800 Subject: [PATCH] use image naturalHeightnaturalHeight --- src/color-thief.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/color-thief.js b/src/color-thief.js index 3b882f3..46d2fa3 100644 --- a/src/color-thief.js +++ b/src/color-thief.js @@ -31,8 +31,8 @@ import core from './core.js'; const CanvasImage = function (image) { this.canvas = document.createElement('canvas'); this.context = this.canvas.getContext('2d'); - this.width = this.canvas.width = image.width; - this.height = this.canvas.height = image.height; + this.width = this.canvas.width = image.naturalWidth; + this.height = this.canvas.height = image.naturalHeight; this.context.drawImage(image, 0, 0, this.width, this.height); };