facebook / facebook/fresco

Color spaces in Android O are not handled properly by some features

Open
#1,871 1 comment 0 reactions 0 assignees View on GitHub
enhancement good first issue help wanted
Dominant language
Kotlin
Stars
17.2k
Forks
3.7k
PR merge metrics
No merged PRs in 30d

Description

### Description

O is the first Android release that introduces a proper color management system into the OS and platform framework. This addition doesn't require any changes for simple decoding and displaying of Bitmaps, but some of Fresco's more advanced features seem to drop [ColorSpace](https://developer.android.com/reference/android/graphics/ColorSpace.html) information.

I went through the Fresco Showcase sample app modified as described below and found bad color reproduction in these parts of the app:
- Drawee -> Rotation
- Image Pipeline -> Post-Processor
- Image Pipeline -> Resizing

Things that I've not tested yet:
- Progressive JPEGs,
- GIFs
- WebPs
- SVGs
- Images from Data URIs

### Reproduction

- Check out 3194ad2
- Add [whacked_jpg](https://user-images.githubusercontent.com/4332237/29499311-74447982-860e-11e7-91e7-3fd45f1b9b6f.jpg) and [whacked_png](https://user-images.githubusercontent.com/4332237/29499312-74463c04-860e-11e7-8289-26b83a3e3ff0.png) to `res/drawable-nodpi` in the Showcase module
- I created these files from [this image](https://raw.githubusercontent.com/facebook/fresco/3194ad2957a4db8dc1bc5001dee5ac3675fe4ce9/docs/static/sample-images/animal_d_l.jpg) by using the "Match to Profile" feature of the macOS ColorSync Utility app with the popular [WhackedRGB.icc](https://bugs.chromium.org/p/chromium/issues/detail?id=537077#c4) and intent set to "Automatic".
- Replace jpg urls with `"res:///" + R.drawable.whacked_jpg` and png urls with `"res:///" + R.drawable.whacked_png` in [ImageUriProvider](https://github.com/facebook/fresco/blob/3194ad2957a4db8dc1bc5001dee5ac3675fe4ce9/samples/showcase/src/main/java/com/facebook/fresco/samples/showcase/misc/ImageUriProvider.java)
- Play around with the samples

### Additional Information

* Fresco version: 3194ad2
* Platform version: Android O (rev. 5 of the emulator image)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.