saucecontrol / Compact-ICC-Profiles

Minimal ICC Profiles intended for embedding in image files
Creative Commons Zero v1.0 Universal
195 stars 7 forks source link

patching firefox for D50 chad with negative XYZ values on Linux and Windows #10

Closed 24fpsDaVinci closed 1 year ago

24fpsDaVinci commented 1 year ago

on linux and windows you can patch firefox's icc parsing here gfx/qcms/src/iccread.rs around line 400

if !cfg!(target_os = "macos") {
        negative = (rX < 0.)
            || (rY < 0.)
            || (rZ < 0.)
            || (gX < 0.)
            || (gY < 0.)
            || (gZ < 0.)
            || (bX < 0.)
            || (bY < 0.)
            || (bZ < 0.);
    } else {
        // Chromatic adaption to D50 can result in negative XYZ, but the white
        // point D50 tolerance test has passed. Accept negative values herein.
        // See https://bugzilla.mozilla.org/show_bug.cgi?id=498245#c18 onwards
        // for discussion about whether profile XYZ can or cannot be negative,
        // per the spec. Also the https://bugzil.la/450923 user report.

        // FIXME: allow this relaxation on all ports?
        negative = false; // bogus
    }
    if negative {
        return true;
    }

I already requested this on bugzilla but for reasons i cant comprehend firefox devs dont want to enable this on windows and linux builds. maybe you can include this in the readme.

jrmuizel commented 1 year ago

What's the bug number?

24fpsDaVinci commented 1 year ago

https://bugzilla.mozilla.org/show_bug.cgi?id=1792469

saucecontrol commented 1 year ago

Interesting. I noticed a while back that Chrome was fixed and meant to update the compatibility note here.

Moving this over to Discussions since it's not actionable here.