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

Black Canvas Problem in Chromium

muratgozel opened this issue · comments

Hi,

I'm not sure if this is pica's issue.

The only affected browser is Chromium Developer Version. The regular Chrome, Firefox or Safari works as expected.

When I try to resize an image to canvas:

  const offscreenCanvas = document.createElement('canvas')
  offscreenCanvas.width = width
  offscreenCanvas.height = height
  pica
    .resize(imageElement, offscreenCanvas, {
      alpha: false,
      unsharpAmount: 80,
      unsharpRadius: 0.6,
      unsharpThreshold: 2
    })
    .then(function(result) {
      document.body.appendChild(result)
    })

I get a canvas painted with just black no matter the type of the image. It can be solved by setting alpha: true. I don't know why. There is bug registered in the chromium bug tracker:
https://bugs.chromium.org/p/chromium/issues/detail?id=809065

You can close the issue :)

Let's close as "nothing to fix". Feel free to continue if new info come.