Closed
Bug 1782877
Opened 3 years ago
Closed 2 years ago
canvas.toDataURL("image/webp", 1.0); not properly implementing LOSSLESS webp
Categories
(Core :: Graphics: Canvas2D, defect)
Tracking
()
RESOLVED
FIXED
105 Branch
Tracking | Status | |
---|---|---|
firefox105 | --- | fixed |
People
(Reporter: stephen.ehlers, Assigned: tnikkel)
Details
Attachments
(2 files)
Steps to reproduce:
- Build Graphic with canvas rendering 2d context.
- Grab raw bytes from getImageData.
- Call canvas toDataUrl("image/png", 1)
- Populate an image element src with the url;
- Use the image as the source to for a drawImage call on a 2d context.
- Grab raw bytes from png sourced rendering by doing a second getImageData call on your 2d context.
- Compare original bytes to lossless png bytes (success).
Repeat 1-7 but on step 3 instead use toDataUrl("image/webp", 1) .
Actual results:
The byte comparison for PNG and the Original bytes match 100%, meaning it was truly a lossless conversion.
The byte comparison for WebP will show mismatches, meaning that the conversion had data loss.
Expected results:
Both PNG and WebP formats with a quality/precision or 1 (lossless) should result in identical bytes to the original image.
Reporter | ||
Comment 1•3 years ago
|
||
Expected results should say "of 1" not "or 1".
Comment 2•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Graphics: Canvas2D' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Component: Untriaged → Graphics: Canvas2D
Product: Firefox → Core
Assignee | ||
Comment 3•3 years ago
|
||
Chrome and Safari do, and it makes sense.
Updated•3 years ago
|
Assignee: nobody → tnikkel
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by tnikkel@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cc6e6cb510c5
Encoding webp with quality 100 should use lossless. r=aosmond
Comment 5•2 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
status-firefox105:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•