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

Unified Diff: src/pdf/SkPDFImage.cpp

Issue 767343002: Remove PDF JPEG shortcut, since it fails on grayscale JPEGs. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: disable unit test Created 6 years 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 | « resources/grayscale.jpg ('k') | tests/PDFJpegEmbedTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFImage.cpp
diff --git a/src/pdf/SkPDFImage.cpp b/src/pdf/SkPDFImage.cpp
index 0c9b7417a1d1254bca2cf618b182c75f87335b90..122d2f214845dfcc111bdbe262b020ec219eeba5 100644
--- a/src/pdf/SkPDFImage.cpp
+++ b/src/pdf/SkPDFImage.cpp
@@ -629,6 +629,7 @@ bool SkPDFImage::populate(SkPDFCatalog* catalog) {
return true;
}
+#if 0 // reenable when we can figure out the JPEG colorspace
namespace {
/**
* This PDFObject assumes that its constructor was handed
@@ -657,7 +658,7 @@ public:
"/Subtype /Image\n"
"/Width %d\n"
"/Height %d\n"
- "/ColorSpace /DeviceRGB\n"
+ "/ColorSpace /DeviceRGB\n" // or DeviceGray
"/BitsPerComponent 8\n"
"/Filter /DCTDecode\n"
"/ColorTransform 0\n"
@@ -702,11 +703,13 @@ static bool is_jfif_jpeg(SkData* data) {
sizeof(bytesSixToTen))));
}
} // namespace
+#endif
SkPDFObject* SkPDFCreateImageObject(
const SkBitmap& bitmap,
const SkIRect& subset,
SkPicture::EncodeBitmap encoder) {
+#if 0 // reenable when we can figure out the JPEG colorspace
if (SkIRect::MakeWH(bitmap.width(), bitmap.height()) == subset) {
SkAutoTUnref<SkData> encodedData(ref_encoded_data(bitmap));
if (is_jfif_jpeg(encodedData)) {
@@ -714,5 +717,6 @@ SkPDFObject* SkPDFCreateImageObject(
(encodedData, bitmap.width(), bitmap.height()));
}
}
+#endif
return SkPDFImage::CreateImage(bitmap, subset, encoder);
}
« no previous file with comments | « resources/grayscale.jpg ('k') | tests/PDFJpegEmbedTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698