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

Unified Diff: src/codec/SkRawCodec.cpp

Issue 1883783002: Update PIEX version and adjust the RAW codec accordingly (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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
« DEPS ('K') | « DEPS ('k') | no next file » | 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 762e82364cd3a6dd27e7c6534f69f0d40d6c8eb4..1247173b852c6a3bb03f8d89636b3f1233e5ecab 100644
--- a/src/codec/SkRawCodec.cpp
+++ b/src/codec/SkRawCodec.cpp
@@ -640,7 +640,11 @@ SkCodec* SkRawCodec::NewFromStream(SkStream* stream) {
if (::piex::IsRaw(&piexStream)) {
::piex::Error error = ::piex::GetPreviewImageData(&piexStream, &imageData);
- if (error == ::piex::Error::kOk && imageData.preview.length > 0) {
+ // PIEX can return JPEG compressed image or uncompressed RGB image. We only handle the JPEG
scroggo 2016/04/13 12:20:23 I'm confused. What is the "uncompressed RGB image"
yujieqin 2016/04/13 13:11:29 There are two kind of thumbnails image can be embe
scroggo 2016/04/13 15:54:31 Ah, this probably is more obvious to someone who i
yujieqin 2016/04/14 07:54:59 Actually it is not only for "thumbnail". Theoretic
scroggo 2016/04/14 13:24:24 Ah, thanks for clarifying.
+ // compressed case for now.
+ if (error == ::piex::Error::kOk && imageData.preview.length > 0 &&
+ imageData.preview.format == ::piex::Image::kJpegCompressed)
+ {
// transferBuffer() is destructive to the rawStream. Abandon the rawStream after this
// function call.
// FIXME: one may avoid the copy of memoryStream and use the buffered rawStream.
« DEPS ('K') | « DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698