Closed Bug 1709814 Opened 5 years ago Closed 3 months ago

Support color profiles for JPEG XL

Categories

(Core :: Graphics: ImageLib, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
150 Branch
Tracking Status
firefox150 --- fixed

People

(Reporter: saschanaz, Assigned: zondolfin)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

A JXL file can include an ICC profile in it. Without the proper support such images will look in unexpected way.

Is this the reason why https://res.cloudinary.com/demo/sample.jxl looks very different from https://res.cloudinary.com/demo/image/fetch/f_png/https://res.cloudinary.com/demo/sample.jxl , or should I file a separate bug about that issue?

I suspect yes, but haven't actually investigated yet. Let's see whether fixing this also fixes that issue.

Severity: -- → N/A
Assignee: nobody → wvvwvvvvwvvw
Status: NEW → ASSIGNED

The bug assignee didn't login in Bugzilla in the last 7 months, so the assignee is being reset.

Assignee: wvvwvvvvwvvw → nobody
Status: ASSIGNED → NEW

Some API of libjxl have changed. FWIW, here is the patch for the patch:

diff --git a/image/decoders/nsJXLDecoder.cpp b/image/decoders/nsJXLDecoder.cpp
index 78bb1c81e63e..a984d06df7ab 100644
--- a/image/decoders/nsJXLDecoder.cpp
+++ b/image/decoders/nsJXLDecoder.cpp
@@ -189,9 +189,9 @@ LexerTransition<nsJXLDecoder::State> nsJXLDecoder::ReadJXLData(
       case JXL_DEC_COLOR_ENCODING: {
         size_t size = 0;
         JXL_TRY(JxlDecoderGetICCProfileSize(
-            mDecoder.get(), &mFormat, JXL_COLOR_PROFILE_TARGET_DATA, &size))
+            mDecoder.get(), JXL_COLOR_PROFILE_TARGET_DATA, &size))
         std::vector<uint8_t> icc_profile(size);
-        JXL_TRY(JxlDecoderGetColorAsICCProfile(mDecoder.get(), &mFormat,
+        JXL_TRY(JxlDecoderGetColorAsICCProfile(mDecoder.get(),
                                                JXL_COLOR_PROFILE_TARGET_DATA,
                                                icc_profile.data(), size))
 
Assignee: nobody → wvvwvvvvwvvw
Status: NEW → ASSIGNED

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: wvvwvvvvwvvw → nobody
Status: ASSIGNED → NEW
Duplicate of this bug: 1993906
No longer duplicate of this bug: 1993906
Duplicate of this bug: 1993906
Attachment #9230850 - Attachment is obsolete: true
Assignee: nobody → tnikkel
Attachment #9230850 - Attachment is obsolete: false
Status: NEW → ASSIGNED
Attachment #9230850 - Attachment is obsolete: true
Assignee: tnikkel → zondolfin

How is the progress on this issue? It is getting annoying that some JXL images are darker then they should be.

People have been recently discussing what would be the best step. Firefox is receiving 8bit value for each color channel, which is raised as a potential issue. But I don't have much details about that, either Martin or Timothy can provide better details.

We just landed the rust migration and then animation support, so I expect this will be one of the next work item to prioritize.

This is suitable to land modulo a few more comments and fixes in my opinion.

I know there is a plan to enable using floats instead of chars to call qcms, and I'm not clear on whether we want to wait for that, or land and then patch. Timothy can answer that part I think.

Did we agree that we want to call qcms separately like in the patch though?

(In reply to Kagami Rosylight [:saschanaz] (they/them) from comment #13)

Did we agree that we want to call qcms separately like in the patch though?

AFAIU Timothy heard that it was ~simple to change QCMS to handle floats instead of chars (since it used floats internally anyway), and he and Luca agreed that then we should keep this design. I don't remember hearing about whether we should land this before or after that change was done though.

Flags: needinfo?(tnikkel)

Apologie for the delay, I was sick last week. I think we can work toward landing the patch as is. Changing to use a float based qcms interface should not be too hard.

Flags: needinfo?(tnikkel)
Blocks: 2020281
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 150 Branch
No longer duplicate of this bug: 1993906
Blocks: 2020626
QA Whiteboard: [qa-triage-done-c151/b150]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: