Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: src/codec/SkPngCodec.cpp

Issue 1667823004: Set sRGB flag for PNGs with an sRGB chunk (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/codec/SkCodecPriv.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkPngCodec.cpp
diff --git a/src/codec/SkPngCodec.cpp b/src/codec/SkPngCodec.cpp
index 232373c04407c63c2b391c148a7053db9e9d62e9..656df7da0b837f868a4b32732f3d972ae606584d 100644
--- a/src/codec/SkPngCodec.cpp
+++ b/src/codec/SkPngCodec.cpp
@@ -328,10 +328,13 @@ static bool read_header(SkStream* stream, SkPngChunkReader* chunkReader,
*numberPassesPtr = numberPasses;
}
- // FIXME: Also need to check for sRGB ( https://bug.skia.org/3471 ).
+ SkColorProfileType profileType = kLinear_SkColorProfileType;
+ if (png_get_valid(png_ptr, info_ptr, PNG_INFO_sRGB)) {
+ profileType = kSRGB_SkColorProfileType;
+ }
if (imageInfo) {
- *imageInfo = SkImageInfo::Make(origWidth, origHeight, colorType, alphaType);
+ *imageInfo = SkImageInfo::Make(origWidth, origHeight, colorType, alphaType, profileType);
}
autoClean.detach();
if (png_ptrp) {
« no previous file with comments | « src/codec/SkCodecPriv.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698