I am downloading from comic-growl and found an issue. If image width is not multiple of four, downloaded image will have transparent pixels on the right side. For example, if width is 1350, only Math.floor(data.width / 4) * 4 = 1348 pixels is valid, and two columns of pixels is transparent. Same could happen if height is not multiple of four. A possible solution is to draw the whole image on canvas before drawing pieces, like this (I am not familiar with js, there could be a better method):
I am downloading from comic-growl and found an issue. If image width is not multiple of four, downloaded image will have transparent pixels on the right side. For example, if width is 1350, only
Math.floor(data.width / 4) * 4
= 1348 pixels is valid, and two columns of pixels is transparent. Same could happen if height is not multiple of four. A possible solution is to draw the whole image on canvas before drawing pieces, like this (I am not familiar with js, there could be a better method):