createImageBitmap() does not support resize options (resizeQuality remains)
Categories
(Core :: Graphics: Canvas2D, defect)
Tracking
()
People
(Reporter: vitaly, Unassigned)
References
Details
(Keywords: dev-doc-needed)
Updated•8 years ago
|
Comment 2•8 years ago
|
||
Reporter | ||
Comment 3•8 years ago
|
||
Updated•8 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Comment 5•4 years ago
|
||
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.
Comment 6•4 years ago
|
||
Fair enough, let's keep this open then.
Updated•4 years ago
|
Comment 7•4 years ago
|
||
Bug 1733559 added support for resizeWidth and resizeHeight.
Comment 8•4 years ago
|
||
Thanks Tom! Not sure how high priority resizeQuality
is, but if it's relatively straightforward we should probably do it.
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!
Updated•3 years ago
|
Comment 10•8 months ago
|
||
Just wanted to see if there are any updates on this one?
createImageBitmap
has been around for a while, but because of various bugs it's still hard to use (this is one of them).
A few examples of use-cases for createImageBitmap
:
- Crop images on-device
- Resize images on-device before uploading to a server
- For example a photo from
<input type="file" capture="environment">
. - On-device image resize has long been problematic, with the main workaround being the Canvas element, but every implementation I've seen has been buggy or hard to use, for example due to iOS canvas memory limits.
- For example a photo from
- Take snapshots from a video feed
- Extract sprites from a sprite sheet
- Take non-rotated image pixels with an associated EXIF tag and output rotated pixels (without any EXIF), or put differently strip EXIF and apply rotation to image data.
- This is useful since many server-side systems prefer to handle all images without accompanying exif rotation data.
Description
•