From 8ddd67d1e292f0cebcac5c77f9e2e1d4370923de Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Thu, 24 Mar 2016 15:11:10 -0700 Subject: [PATCH] Check encoding of inline images --- ocrmypdf/pageinfo.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ocrmypdf/pageinfo.py b/ocrmypdf/pageinfo.py index d59a88cb..42cd3b5e 100644 --- a/ocrmypdf/pageinfo.py +++ b/ocrmypdf/pageinfo.py @@ -34,7 +34,12 @@ FRIENDLY_ENCODING = { '/JPXDecode': 'jpx', '/JBIG2Decode': 'jbig2', '/CCF': 'ccitt', # Abbreviations permitted in inline images - '/DCT': 'jpeg' + '/DCT': 'jpeg', + '/AHx': 'asciihex', + '/A85': 'ascii85', + '/LZW': 'lzw', + '/Fl': 'flate', + '/RL': 'runlength' } FRIENDLY_COMP = { @@ -180,6 +185,7 @@ def _find_page_images(page, pageinfo, contentsinfo): image['bpc'] = settings['/BPC'] image['color'] = FRIENDLY_COLORSPACE.get(settings['/CS'], '-') image['comp'] = FRIENDLY_COMP.get(image['color'], '?') + image['enc'] = FRIENDLY_ENCODING.get(settings['/F'], 'image') dpi_w, dpi_h = _get_dpi(shorthand, (image['width'], image['height'])) image['dpi_w'], image['dpi_h'] = Decimal(dpi_w), Decimal(dpi_h)