createImageBitmap fails when providing options object
Categories
(Core :: DOM: Core & HTML, enhancement, P3)
Tracking
()
Webcompat Priority | ? |
People
(Reporter: the.spite, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-needed, Whiteboard: [gfx-noted])
Attachments
(2 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36 Firefox for Android Steps to reproduce: - Open https://www.clicktorelease.com/tmp/texImage2D/ on Firefox 51 or later - Click on the option called "ImageBitmap, UNPACK_FLIP_Y_WEBGL false, imageOrientation flipY and no dimensions" Code is also on https://github.com/spite/texImage2D Actual results: This performs the call createImageBitmap( image, { imageOrientation: 'flipY' } ) Fails with "TypeError: Not enough arguments to Window.createImageBitmap." Expected results: It should work, like other versions of the code that use the signature createImageBitmap( image, x, y, w, h, options ); Chrome accepts the function signature, and MDN lists is as an accepted one.
Comment 1•7 years ago
|
||
Supporting this options dictionary is important for developers wishing to upload ImageBitmap objects to WebGL.
Updated•7 years ago
|
Reporter | ||
Comment 2•7 years ago
|
||
Any updates on this? This issue makes the method useless in Firefox if the texture needs to be flipped vertically, since it requires to know the width and height beforehand.
Comment 3•7 years ago
|
||
I confirm this bug, have the same problem.
Comment 4•7 years ago
|
||
Comment 5•7 years ago
|
||
Comment 6•7 years ago
|
||
I've modified the example from Jaime to just activate the exact behaviour described on the bug. I've also added an image with the expected result versus the current one for easy comparison.
Comment 7•7 years ago
|
||
We also need this call to be available at Figma. It would be good to update the support info in the documentation also.
Updated•7 years ago
|
Comment 8•6 years ago
|
||
I can also confirm this problem and it prevents us from optimizing our image pipeline.
Comment 9•6 years ago
|
||
Please give this issue a higher priority. When rendering with WebGL in a worker, ImageBitmap becomes even more important since loading images via HTMLImageElement does not work (because it's a DOM interface).
Comment 10•5 years ago
|
||
I can confirm this is still an issue. Is there any way this ticket can be given a higher priority?
Comment 11•5 years ago
|
||
This is much more important now that workers provide a clean separation from the DOM and Image.
We are converting all our low level code that used to use an Image promise to now use a XHR blob + createImageBitmap(blob, options). We do this mainly as an efficient data storage such as GIS tiles. By doing this, all our code works as-is in workers.
So ditto on giving this a higher priority!
Comment 12•5 years ago
|
||
XHR Blob not fetch?
Comment 15•5 years ago
|
||
It looks like this is a Firefox-specific failure in WPT:
https://wpt.fyi/results/2dcontext/imagebitmap/createImageBitmap-flipY.html?run_id=320660001&run_id=341840002&run_id=322390001&run_id=328590003
Updated•5 years ago
|
Comment 16•5 years ago
|
||
Not to pile on, but we need this to be fixed for an upcoming Adobe project also.
Specifically we need imageOrientation at minimum, but it would be very useful to have the resize options also as it would save an additional draw.
Comment 17•5 years ago
|
||
It looks like createImageBitmap was implemented in bug 1044102 by :kaku who is no longer with us. Only the 1 argument and 5 argument versions of this were ever implemented, which do not support an actual options argument at all. Punting this back over to DOM to see who can handle it there...
Comment 18•5 years ago
|
||
(In reply to Lee Salzman [:lsalzman] from comment #17)
It looks like createImageBitmap was implemented in bug 1044102 by :kaku who is no longer with us. Only the 1 argument and 5 argument versions of this were ever implemented, which do not support an actual options argument at all. Punting this back over to DOM to see who can handle it there...
Taking this to an offline discussion.
Comment 19•5 years ago
|
||
Looks the patches in bug 1367251 is adding the options, so close as duplicate.
Description
•