NativeJpegTranscoder does not properly support wide color gamut images
See original GitHub issueDescription
what you did:load a wide color image
private void loadImage(Uri uri, SimpleDraweeView simpleDraweeView) {
Log.e("jiyun_test", "loadImage:" + uri);
ImageRequest request = getImageRequest(uri, simpleDraweeView);
PipelineDraweeController controller = (PipelineDraweeController)
Fresco.newDraweeControllerBuilder()
.setImageRequest(request)
.setOldController(simpleDraweeView.getController())
// other setters as you need
.build();
simpleDraweeView.setController(controller);
}
public ImageRequest getImageRequest(Uri uri, SimpleDraweeView simpleDraweeView) {
int width;
int height;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
width = simpleDraweeView.getWidth();
height = simpleDraweeView.getHeight();
} else {
width = simpleDraweeView.getMaxWidth();
height = simpleDraweeView.getMaxHeight();
}
ImageRequestBuilder builder = ImageRequestBuilder.newBuilderWithSource(uri);
if (width > 0 && height > 0) {
builder.setResizeOptions(new ResizeOptions(width, height));
}
builder.setProgressiveRenderingEnabled(true);
return builder.build();
}
expected: The color shown in the picture is normal actually happens:The color shown in the picture is abnormal
Reproduction
[FILL THIS OUT: How can we reproduce the bug? Provide URLs to relevant images if possible, or a sample project
.]
Solution
[OPTIONAL: Do you know what needs to be done to address this issue? Ideally, provide a pull request which fixes this issue.]
Additional Information
Delete the following code, the problem is solved:
if (width > 0 && height > 0) {
builder.setResizeOptions(new ResizeOptions(width, height));
}
- Fresco version: [FILL THIS OUT] implementation ‘com.facebook.fresco:fresco:0.12.0’
- Platform version: [FILL THIS OUT: specific to a particular Android version? Device?] android 10.0 pixel
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Examples of various wide-gamut images - WebKit
Below are example images to demonstrate wide-gamut. There are multiple versions of each image: one in sRGB, then some in other color spaces...
Read more >Intro to wide color gamut and HDR in Compressor
Intro to wide color gamut and HDR in Compressor. No image device is capable of capturing and reproducing the full spectrum of colors...
Read more >Understanding the Color Gamut of an LCD Monitor - Eizo
Color gamut is one spec used to measure the image quality of an LCD monitor, but color gamut alone does not determine image...
Read more >Enhance graphics with wide color content | Android Developers
In wide color gamut mode, a window can render outside of the sRGB gamut to display more vibrant colors. If the device does...
Read more >How do wide gamut color images look on a regular display?
The reason the sRGB images look different than the wider profile images is ... Regular gamut monitors are not sRGB monitors - they...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
SimpleImageTranscoderFactory test is OK! but why the code can work well? Could you explain it in detail,tks!
Thanks for the detailed report @jiyun9901. Do you also have a suggested fix / pull request that you would like to put forward?