Donaldcwl / browser-image-compression

Image compression in web browser
MIT License
1.29k stars 160 forks source link

Image reference error in Webworker #194

Open Jungho-Cheon opened 1 year ago

Jungho-Cheon commented 1 year ago

When I compress a particular image into a webworker, it seems that the loadImage function that calls while it compresses does not reference the image. Could it be related to using different images for each test but not being able to refer to the image?

스크린샷 2023-05-18 오전 11 38 51

Jungho-Cheon commented 1 year ago

I think I know why. If the image is corrupted, an error occurs in the createImageBitmap(). This makes to excute loadImage() seems to refer to the Image.

If I compress a corrupted image from a Chrome browser, sometimes it prints a white image from canvas, is there a way to notice this as an error?