aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2014-12-02 06:37:21 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-12-02 06:37:21 -0800
commitd476a176b774c387b242fa8fb2a9296d722c34aa (patch)
treef67204499d9f2d340cd1a1d098a292f759a5a3d8 /src/pdf
parentc6b8b02882a092f2ab58894956d3ac457d5c8607 (diff)
Remove PDF JPEG shortcut, since it fails on grayscale JPEGs.
Diffstat (limited to 'src/pdf')
-rw-r--r--src/pdf/SkPDFImage.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pdf/SkPDFImage.cpp b/src/pdf/SkPDFImage.cpp
index 0c9b7417a1..122d2f2148 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);
}