nodeca / pica

Resize image in browser with high quality and high speed

Home Page:http://nodeca.github.io/pica/demo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

image corruption on Chrome when not using alpha (jpeg)

gregorymaertens opened this issue · comments

Hello,

the following image is corrupted when using Chrome (Version 86.0.4240.183 (Official Build) (x86_64)). Ok on Safari (Version 14.0 (15610.1.28.1.9, 15610)) and Firefox too (82.0.3 (64-bit)).

Arte-primitiva-el-1-950x701

While investigating this issue I have noticed that setting alpha: true in the options fixes the issue.
Is it expected?

You can see with the demo app the pica resize is all black (only in Chrome, ok in Safari, Firefox).

Screen Shot 2020-11-20 at 16 01 00

Sometime the image is corrupted like so:
Screen Shot 2020-11-20 at 16 07 15

I can not reproduce. Can you attach image as zip? Is it PNG?

IMO that's something Chrome version or hardware specific. I tried demo with Chrome 87.0.4280.66 on Ubuntu, and still could not reproduce problem (but i belive you have it).

They break something from time to time, and problem self-fix in next versions. Pica does no use anything special in js api.

I'd suggest try Chrome 87 & different PC to localize problem.

I experienced this same issue - setting alpha:true seems to fix it.

The issue is only present for very specific versions of Chrome.

Same issue on MacOS Chrome Canary version 93.0.4567.0, used via the image-blob-reduce wrapper.

When alpha is set to false I get random black rectangular splats. Attached example input file was JPG so no alpha channel.

They appear randomly on different images but always in the same spot for the same image. Seen here on the right side:

a1aa16e3-f7e6-4ba5-afa8-d1364c0b3d58

@boberbober Same problem. Setting alpha to true seems to fix it.

Try v9. It has fixes for transparency and does not use .alpha option anymore.