Bug 182424
Summary: | Complete ImageBitmap implementation | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ms2ger (he/him; ⌚ UTC+1/+2) <Ms2ger> |
Component: | Canvas | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED CONFIGURATION CHANGED | ||
Severity: | Normal | CC: | ashley, daytonlowell, dcasorran, dino, ik, kkinnunen, oconnorct1, ranbuch, tomac |
Priority: | P2 | ||
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | 149990, 182335, 182388, 183131, 183247, 183438, 183439, 183440, 184449, 211484, 227140, 237082 | ||
Bug Blocks: |
Ms2ger (he/him; ⌚ UTC+1/+2)
At the very least:
* Cannot create ImageBitmap with a negative width or height
-> should be a minor fix
* createImageBitmap with HTMLVideoElement is not implemented
-> bug 182388
* createImageBitmap with OffscreenCanvas is not implemented
-> should be a minor fix; OffscreenCanvas::transferToImageBitmap() does something similar
* createImageBitmap with SVGImageElement is not implemented
* createImageBitmap with ImageData is not implemented
-> needs to integrate mime sniffing code somehow
* createImageBitmap with Blob is not implemented
-> needs to integrate mime sniffing code somehow
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Dayton Lowell
spec: https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#dom-createimagebitmap
ik
+1
Ashley Gullen
Is the "premultiplyAlpha" option supported? It looks like WebGL gets unpremultiplied data when specifying that option, it's hard to find up-to-date documentation, and it's difficult to feature detect the supported ImageBitmapOptions.
MrMartian
The image is still getting mutated a little when createImageBitmap is used in Safari. I store data in an RGBA encoded image, so any changes causes errors. It seems like the default setting is not entirely "premultiply", nor is it "none". For now, if browser detects it's safari, I have to use a polyfill to avoid image manipulation:
if (!('createImageBitmap' in window) || isSafari) {
window.createImageBitmap = async function (blob) {
return new Promise((resolve, reject) => {
const img = document.createElement('img')
img.addEventListener('load', function () { resolve(this) })
img.src = URL.createObjectURL(blob)
img.deleteURL = function () { URL.revokeObjectURL(this.src) }
})
}
}
Ran Buchnik
+1
Kimmo Kinnunen
Thank you for the reports.
ashley@scirra.com: would you have a reproduction testcase for your problem?
oconnorct1@gmail.com: would you have a reproduction for your problem?
Ashley Gullen
It's been so long it's difficult to remember what the original situation was. But I think I filed issue 237082 in the end, which was fixed eventually.
Kimmo Kinnunen
Thank you, seems probable.
MrMartian
Sorry for the delay.
I checked ticket 237082 with the example and it was identical to my problem. Seems it is resolved now. Thanks for your effort!
Kimmo Kinnunen
Seems fixed in the bugs listed in depends on section.