HashLips/hashlips_art_pixelator

Multiple files overlap and thumbnail on left corner.

mpixelz opened this issue · 3 comments

Hi,
When i have multiple files in the input directory (8000px x 8000px)
it starts overlapping them over each other so i had to do each one individually.
Even then, there is always a thumbnail of the same image when converted on the left hand side upper corner.
I dont see anything in the code which could be doing it but dont knw where it is coming from.
sample image attached.

thumbnail issue
Image

overlap issue image:
here

There was some issue with image sharing.. ive uploaded the above mentioned images on google drive and updated the links as well.. please if you can help?

overlap issue image: here

solution to this if anyone else is having the same issue:

in save image function.. add this line
ctx.clearRect(0, 0, canvas.width, canvas.height);

so the function would look something like this:

const saveImage = (_loadedImageObject) => {
  fs.writeFileSync(
    `${buildDir}/${_loadedImageObject.imgObject.filename}.png`,
    canvas.toBuffer("image/png")
  );
  ctx.clearRect(0, 0, canvas.width, canvas.height)
};