From ae2547b0f2059b9bee391e02b8af072e7d695eba Mon Sep 17 00:00:00 2001 From: "Michael R. Hines" Date: Wed, 14 May 2014 13:25:30 +0800 Subject: [PATCH] Stop throwing exception on LITERALS_DCT_DECODE I have PDF documents with images stream and two filters, don't throw exceptions on the second one (DCT). --- pdfminer/pdftypes.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pdfminer/pdftypes.py b/pdfminer/pdftypes.py index 95f5693..6851fbf 100644 --- a/pdfminer/pdftypes.py +++ b/pdfminer/pdftypes.py @@ -250,6 +250,10 @@ class PDFStream(PDFObject): data = rldecode(data) elif f in LITERALS_CCITTFAX_DECODE: data = ccittfaxdecode(data, params) + elif f in LITERALS_DCT_DECODE: + # This is probably a JPG stream - it does not need to be decoded twice. + # Just return the stream to the user. + pass elif f == LITERAL_CRYPT: # not yet.. raise PDFNotImplementedError('/Crypt filter is unsupported')