Open Bug 1363861 Opened 8 years ago Updated 4 days ago

createImageBitmap() does not support resize options (resizeQuality remains)

Categories

(Core :: Graphics: Canvas2D, defect)

53 Branch
defect

Tracking

()

People

(Reporter: vitaly, Unassigned)

References

Details

(Keywords: dev-doc-needed)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0 Build ID: 20170418123818 Steps to reproduce: https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/createImageBitmap let c = document.createElement('canvas'); c.width = 100; c.height = 100; createImageBitmap(c, 0, 0, 100, 100, { resizeWidth: 10, resizeHeight: 10, resizeQuality: 'high' }) .then(bitmap => { console.log((bitmap.width === 10) ? 'supported' : 'not supported' }); // => not supported Options { resizeWidth, resizeHeight, resizeQuality } are not supported now. Actual results: createImageBitmap() does not change result size when { resizeWidth, resizeHeight } options passed. Expected results: Expect downscaled result.
Component: Untriaged → DOM
Product: Firefox → Core
Canvas:2D seems a better fit ... I guess...
Component: DOM → Canvas: 2D
What other browsers support resizeWidth etc?
Chromium with enabled chrome://flags/#enable-experimental-canvas-features flag has support, but it still has problems with quality https://bugs.chromium.org/p/chromium/issues/detail?id=712844
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: dev-doc-needed
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE

It doesn't look like this was ever resolved. The linked tickets (https://bugzilla.mozilla.org/show_bug.cgi?id=1335594, https://bugzilla.mozilla.org/show_bug.cgi?id=1367251) did add support for some createImageBitmap() options, but support for resize options (resizeWidth, resizeHeight, and resizeQuality) was never added, as far as I can tell.

Fair enough, let's keep this open then.

Status: RESOLVED → REOPENED
Keywords: dev-doc-needed
Resolution: DUPLICATE → ---
Status: REOPENED → NEW

Bug 1733559 added support for resizeWidth and resizeHeight.

Depends on: 1733559

Thanks Tom! Not sure how high priority resizeQuality is, but if it's relatively straightforward we should probably do it.

Summary: createImageBitmap() does not support resize options → createImageBitmap() does not support resize options (resizeQuality remains)

We have some real-world use-cases for this (currently using canvas + math, but would prefer to use this when it's landed).

I'd say image quality (resizeQuality) matter a lot in practice, for example to tune image size and thereby upload size / upload time. Obviously this is anecdotal, but I think it's highly useful.

Great that resizeWidth and resizeHeight is now supported!

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.