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

Unified Diff: src/codec/SkRawCodec.cpp

Issue 1813273002: Parse icc profiles and exif orientation from jpeg markers (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix build error Created 4 years, 9 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/SkJpegCodec.cpp ('k') | tests/ColorSpaceTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkRawCodec.cpp
diff --git a/src/codec/SkRawCodec.cpp b/src/codec/SkRawCodec.cpp
index 3b7b9a96eead8cc30c9e2718825cd30453449033..762e82364cd3a6dd27e7c6534f69f0d40d6c8eb4 100644
--- a/src/codec/SkRawCodec.cpp
+++ b/src/codec/SkRawCodec.cpp
@@ -537,9 +537,12 @@ private:
}
// Check if the header is valid (endian info and magic number "42").
- return
- (header[0] == 0x49 && header[1] == 0x49 && header[2] == 0x2A && header[3] == 0x00) ||
- (header[0] == 0x4D && header[1] == 0x4D && header[2] == 0x00 && header[3] == 0x2A);
+ bool littleEndian;
+ if (!is_valid_endian_marker(header, &littleEndian)) {
+ return false;
+ }
+
+ return 0x2A == get_endian_short(header + 2, littleEndian);
}
void init(const int width, const int height, const dng_point& cfaPatternSize) {
« no previous file with comments | « src/codec/SkJpegCodec.cpp ('k') | tests/ColorSpaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698