Skip to content

Commit 818c00e

Browse files
authored
Merge pull request #182 from wangcheng/wangcheng678-patch-1
use image naturalHeight and naturalHeight
2 parents 4858a20 + b00090f commit 818c00e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/color-thief.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ import core from './core.js';
3131
const CanvasImage = function (image) {
3232
this.canvas = document.createElement('canvas');
3333
this.context = this.canvas.getContext('2d');
34-
this.width = this.canvas.width = image.width;
35-
this.height = this.canvas.height = image.height;
34+
this.width = this.canvas.width = image.naturalWidth;
35+
this.height = this.canvas.height = image.naturalHeight;
3636
this.context.drawImage(image, 0, 0, this.width, this.height);
3737
};
3838

0 commit comments

Comments
 (0)