Colors of pasted image differ from original image (incorrect TIFF -> PNG/JPG conversion?)
Categories
(Core :: Widget: Cocoa, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox57 | --- | fix-optional |
People
(Reporter: robwu, Assigned: jaas, NeedInfo)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 1 obsolete file)
| Reporter | ||
Comment 1•8 years ago
|
||
Comment 2•8 years ago
|
||
| Reporter | ||
Comment 3•8 years ago
|
||
Updated•8 years ago
|
Comment 4•7 years ago
|
||
| Reporter | ||
Comment 5•7 years ago
|
||
Comment 6•7 years ago
|
||
Comment 7•7 years ago
|
||
Comment 8•7 years ago
|
||
Comment 9•7 years ago
|
||
Updated•7 years ago
|
Comment 11•7 years ago
|
||
Comment 12•5 years ago
|
||
This bug still exists and it's a huge problem for me, as my users expect colors to be kept exact. It's also part of a larger problem of firefox displaying PNGs incorrectly when a color profile is present (though I can at least use PNGCRUSH to remove them). But I'm afraid because of this bug I have to disable uploading images via pasting in firefox, which is very disappointing since the functionality has been around for years and users have come to expect it.
I don't believe it has anything to do with filetype conversion as it happens when copying from an image editor such as paint or photoshop, and I believe windows stores that as bitmap (which also means it's probably not related to color profiles like the displaying PNGs bug).
Comment 13•3 years ago
|
||
Yup. Still struggling with this. Trying to make a game where users can upload an image to create a level, based on the color of the pixels. Unsurprisingly, it's broken in firefox because firefox says a #ff0000 pixel is #fe0000 (etc).
Really sad that I still have to tell people they can't use my site unless they use Chrome (or pngcrush all their images first).
(should be noted it's not just copy-pasted images, uploading an image with a filereader causes this too).
Updated•3 years ago
|
| Assignee | ||
Comment 14•18 days ago
|
||
| Assignee | ||
Comment 15•18 days ago
•
|
||
I believe the patch I just uploaded fixes this issue. The attached test case fails without the patch, succeeds with it.
The patch does three things:
nsCocoaUtils::CreateCGImageFromSurfacewas usingkCGColorSpaceGenericRGB, a legacy generic RGB colorspace. Firefox's pixel buffers are sRGB. Any color-managed consumer of clipboard data from Firefox would interpret the pixel values through the wrong profile, producing shifted colors.- nsCocoaUtils::CreateNSImageFromCGImage was making roughly the same mistake, but using
NSDeviceRGBColorSpace. The code there could be simplified a lot by just using[[NSBitmapImageRep alloc] initWithCGImage:aInputImage]. - Prefer
NSPasteboardTypePNGoverNSPasteboardTypeTIFFfrom the clipboard. PNG is more likely to just be sRGB up and if the output is PNG we can avoid any TIFF->PNG conversion.
Comment 16•2 days ago
|
||
Comment 17•1 day ago
|
||
Comment 18•1 day ago
|
||
Backed out browser_screenshots_test_visible.js.
Backout link: https://hg.mozilla.org/integration/autoland/rev/a434d1674662
Failure log: https://treeherder.mozilla.org/logviewer?job_id=553631293&repo=autoland&task=LzOQHepSQza3CRMdcHZURg.0&lineNumber=3236
Updated•1 hour ago
|
Description
•