KonradLinkowski / GeneticDrawer

image evolution algorithm
https://konradlinkowski.github.io/GeneticDrawer/
10 stars 10 forks source link

[#12] Downscale too big images #15

Closed ZenVega closed 4 years ago

ZenVega commented 4 years ago

Hi, quite often when I start the program on a live server it has a bug which occurs, according to the console here:

function getImageData(image) { helpCanvas.width = image.width; helpCanvas.height = image.height; helpContext.drawImage(image, 0, 0); const data = helpContext.getImageData(0, 0, image.width, image.height); helpContext.clearRect(0, 0, helpCanvas.width, helpCanvas.height); return data; }

I haven't figured it out yet but it is a little confusing to me, that you named the function "getImageData" which already is a ctx.prototype function which u actually call within that getImageData-function of yours... 🙃 can u help me out here?

KonradLinkowski commented 4 years ago

@ZenVega hello Yea, I have the same error sometimes. Probably something doesn't load up or something This function uses invisible canvas to do operations. It converts Image object to ImageData and it could be named that way

KonradLinkowski commented 3 years ago

I merged it without really looking if it works. Now I know that it wasn't used xd Refined the code a little bit so it's used now. Closes #12 now