Black background when cropping image #516
Unanswered
lolottetheclash
asked this question in
Q&A
Replies: 1 comment
-
I converted this to a discussion as it's not an issue directly linked to the library (as the generating the cropped image is external). It's been a while I've touched Canvas but one hypothesis that I have is that this code: ctx?.drawImage(
image,
croppedArea.x * scaleX,
croppedArea.y * scaleY,
croppedArea.width * scaleX,
croppedArea.height * scaleY,
0,
0,
canvasWidth,
canvasHeight,
) is filling the whole canvas Another lead that you can check: I've tried this example with a PNG. After changing the blob output type to png, it works as expected. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I read the same issue many times but the solution didn't work for me (saving as png instead of jpeg)
I show you my code:
the cropper:
If the crop has a minZoom of 0.1 and I crop the image or crop a png, in all cases the transparent background appears black... if anyone has a clue... thanks!
Beta Was this translation helpful? Give feedback.
All reactions