Closed Bug 1335594 Opened 7 years ago Closed 5 years ago

createImageBitmap fails when providing options object

Categories

(Core :: DOM: Core & HTML, enhancement, P3)

51 Branch
enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1367251
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.
Component: Untriaged → Canvas: 2D
Product: Firefox → Core
Supporting this options dictionary is important for developers wishing to upload ImageBitmap objects to WebGL.
Priority: -- → P3
Whiteboard: [gfx-noted]
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.
I confirm this bug, have the same problem.
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.
Status: UNCONFIRMED → NEW
Ever confirmed: true
See Also: → 1367251
We also need this call to be available at Figma.  It would be good to update the support info in the documentation also.
Keywords: dev-doc-needed
I can also confirm this problem and it prevents us from optimizing our image pipeline.
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).

I can confirm this is still an issue. Is there any way this ticket can be given a higher priority?

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!

XHR Blob not fetch?

Webcompat Priority: --- → ?

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.

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...

Type: defect → enhancement
Component: Canvas: 2D → DOM: Core & HTML
Depends on: 1044102
Flags: needinfo?(htsai)

(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.

Looks the patches in bug 1367251 is adding the options, so close as duplicate.

Status: NEW → RESOLVED
Closed: 5 years ago
Flags: needinfo?(htsai)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: