diff --git a/static/js/markdown.js b/static/js/markdown.js index 345e612..64fea6c 100644 --- a/static/js/markdown.js +++ b/static/js/markdown.js @@ -30,10 +30,12 @@ const svgChangeTheme = (mode) => { */ const extractColors = (image) => { const canvas = document.createElement("canvas"); - canvas.width = image.width; - canvas.height = image.height; + canvas.width = image.naturalWidth; + canvas.height = image.naturalHeight; const ctx = canvas.getContext("2d"); ctx.drawImage(image, 0, 0); + console.log(image); + const imageData = ctx.getImageData( 0, 0,