More testing: JPEG
This commit is contained in:
+3
-2
@@ -67,8 +67,9 @@ def encode_text_string(s: str) -> str:
|
||||
From PDF 32000-1:2008 a string object may be included in hexademical form
|
||||
if it is enclosed in angle brackets. For general Unicode the string should
|
||||
be UTF-16 (big endian) with byte order marks. A non-hexademical
|
||||
presentation is possible but this is preferable since it allows the output
|
||||
Postscript file to be completely ASCII.
|
||||
representation is doable but this is preferable since it allows the output
|
||||
Postscript file to be completely ASCII and no escaping of Postscript
|
||||
characters is necessary.
|
||||
'''
|
||||
if s == '':
|
||||
return ''
|
||||
|
||||
@@ -9,7 +9,9 @@ import os
|
||||
import sys
|
||||
import shutil
|
||||
from nose.tools import *
|
||||
from pkg_resources import Requirement, resource_filename
|
||||
|
||||
req = Requirement.parse('ocrmypdf')
|
||||
|
||||
TEST_OUTPUT = os.path.join(os.path.dirname(__file__), 'output')
|
||||
|
||||
@@ -93,3 +95,12 @@ def test_single_page_inline_image():
|
||||
|
||||
pageinfo.pdf_get_all_pageinfo(filename)
|
||||
|
||||
|
||||
def test_jpeg():
|
||||
filename = resource_filename(req, 'tests/resources/c02-22.pdf')
|
||||
|
||||
pdfinfo = pageinfo.pdf_get_all_pageinfo(filename)
|
||||
|
||||
pdfimage = pdfinfo[0]['images'][0]
|
||||
assert pdfimage['enc'] == 'jpeg'
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
@@ -4,10 +4,14 @@ copyright reasons.
|
||||
Test files do not necessarily produce perfect (or even good) OCR
|
||||
results.
|
||||
|
||||
+--------------+--------------------------------------------------------------------------------+
|
||||
| File | Source |
|
||||
+==============+================================================================================+
|
||||
| graph.pdf | Wikimedia |
|
||||
+--------------+--------------------------------------------------------------------------------+
|
||||
| c02-22.pdf | Project Gutenberg: https://www.gutenberg.org/files/76/76-h/images/c02-22.jpg |
|
||||
+--------------+--------------------------------------------------------------------------------+
|
||||
+-------------------+--------------------------------------------------------------------------------+
|
||||
| File | Source |
|
||||
+===================+================================================================================+
|
||||
| graph.pdf | Wikimedia |
|
||||
+-------------------+--------------------------------------------------------------------------------+
|
||||
| c02-22.pdf | Project Gutenberg: https://www.gutenberg.org/files/76/76-h/images/c02-22.jpg |
|
||||
+-------------------+--------------------------------------------------------------------------------+
|
||||
| LinnSequencer.jpg | Wikimedia: https://upload.wikimedia.org/wikipedia/en/b/b7/LinnSequencer_hardware_MIDI_sequencer_brochure_page_2_300dpi.jpg |
|
||||
+-------------------+--------------------------------------------------------------------------------+
|
||||
| congress.jpg | http://www.baxleystamps.com/litho/meiji/courts_1871.jpg |
|
||||
+-------------------+--------------------------------------------------------------------------------+
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 188 KiB |
Reference in New Issue
Block a user