James R. Barlow
a596ccf844
Raise exception if resulting PDF might appear blank in a known in some PDF viewers
...
Fixes #1187
2023-11-09 22:33:22 -08:00
James R. Barlow
e7fa97731f
ghostscript duplicate filter: filter within a window of previous messages
2023-11-09 22:32:39 -08:00
James R. Barlow
290aa28108
Fix error on attempt to write to debug log after removing debug log handler
2023-11-09 16:02:41 -08:00
James R. Barlow
e36d5a309f
Make grafting a little bit more configurable
2023-11-05 14:01:01 -08:00
James R. Barlow
372c22d42b
docs: improve
2023-11-04 02:43:08 -07:00
James R. Barlow
949265bbd0
graft: improve typing and remove procset tracking
...
ProcSet is optional and deprecated in PDF 2.0, and does little anyway; so
we removed it.
2023-11-04 02:32:39 -07:00
James R. Barlow
44bcafd3aa
Add missing file header
2023-10-30 00:28:09 -07:00
James R. Barlow
71166f7be8
Make hocr API experimental for now
...
This commit can be reverted when we are ready to release a new version.
2023-10-30 00:07:10 -07:00
James R. Barlow
580252a1a0
Merge branch 'feature/gscan2pdf'
...
Reconcile release notes and copy_final() with new pipeline.
2023-10-30 00:01:28 -07:00
James R. Barlow
ae123fd209
Try to retain/copy xattrs
2023-10-28 01:42:06 -07:00
James R. Barlow
5b5827983b
Tweak documentation of --output-type
2023-10-26 23:57:08 -07:00
James R. Barlow
56f9bc311d
Improve verbosity of colorspace selection
2023-10-25 00:38:56 -07:00
James R. Barlow
eb17dc1ecf
Fix pdf save settings at metadata_fixup
2023-10-25 00:13:17 -07:00
James R. Barlow
6f8115a052
Fix import of metadata_fixup
2023-10-25 00:06:26 -07:00
James R. Barlow
aac913c666
tesseract: EAFP
2023-10-24 13:50:04 -07:00
James R. Barlow
a31f17bb9d
Update comments and make worker functions private
2023-10-24 00:56:00 -07:00
James R. Barlow
1cb46afa94
Update pluginspec docs
2023-10-24 00:56:00 -07:00
James R. Barlow
db3df13e95
Remove ocrmypdf._sync
2023-10-24 00:54:31 -07:00
James R. Barlow
2a8bc03167
optimize: typing
2023-10-24 00:54:31 -07:00
James R. Barlow
d2297b39d0
info: clarify ICC -> components checking
2023-10-24 00:54:31 -07:00
James R. Barlow
e4cd081d4d
info: clarify pageinfo context management
2023-10-24 00:54:31 -07:00
James R. Barlow
d2dbea6cf8
Reorganize progress bars so they can be typed properly
2023-10-24 00:54:31 -07:00
James R. Barlow
46a279a49a
Improve passing of arguments to workers
...
The executor system was built around passing only a single
argument to workers, which was
always PageContext. For other tasks, all actual arguments were packed in
a tuple, which meant we needed intermediate functions to unpack the
tuple.
The situation is now rationlized and resembles how Python handles
argument passing to familiar multiprocessing tools.
2023-10-24 00:54:31 -07:00
James R. Barlow
cd61c4efd9
pngquant: remove unused ability to quantize a non-PNG
...
Covering testing showed this branch was never used, and when tested it didn't work.
2023-10-24 00:54:31 -07:00
James R. Barlow
a06ab2a1c5
unpaper: Remove format conversion
...
Code is no longer reachable since we rasterize a 1/L/RGB image prior to this point.
2023-10-24 00:54:31 -07:00
James R. Barlow
dfa4ebf1a6
Simplify function signature of extract_image_filter
2023-10-24 00:54:31 -07:00
James R. Barlow
990b462a94
Fix coverage settings and cover semfree
2023-10-24 00:54:31 -07:00
James R. Barlow
7ce9d08b2d
Define progress bar plugins formally instead of "tqdm-like"
2023-10-24 00:54:31 -07:00
James R. Barlow
eb3a51e33a
Prefer pikepdf's newer Page.mediabox accessor over .MediaBox
2023-10-24 00:54:31 -07:00
James R. Barlow
f3dd733773
optimize: explore page container as objects instead of page helpers
2023-10-24 00:54:31 -07:00
James R. Barlow
4dbc5e1dba
Fix some typing issues
2023-10-24 00:54:31 -07:00
James R. Barlow
6127f7abd6
tqdm_kwargs to progress_kwargs
2023-10-24 00:54:31 -07:00
James R. Barlow
40afcd68a7
pluginspec: spacing
2023-10-24 00:54:31 -07:00
James R. Barlow
f238e721ed
Improve documentation of new public hOCR APIs
2023-10-24 00:54:31 -07:00
James R. Barlow
16eb5627a7
Fix unused imports and other trivia
2023-10-24 00:54:31 -07:00
James R. Barlow
fbf0674189
hocr_to_ocr_pdf: handle missing hocr json file
2023-10-24 00:54:31 -07:00
James R. Barlow
62c4f65fc3
Remove duplicate thread local storage of page numbers
2023-10-24 00:54:31 -07:00
James R. Barlow
e400112f32
Improve ._pipelines naming
2023-10-24 00:54:31 -07:00
James R. Barlow
7935914f55
Use empty .hocr file instead of dummy template for symmetry with sandwich
2023-10-24 00:54:31 -07:00
James R. Barlow
b9646b6f85
Enable multiprocessing freeze_support (for Windows) and enable forkserver
...
Since we use a thread for logging among other possibilities, we were
never able to use threads safely when forking. forkserver will do the job.
2023-10-24 00:54:30 -07:00
James R. Barlow
53c953a561
Fix use_threads logic for get_pdfinfo
...
Some debug code was level in place that forced pdfinfo to run with only
one worker when --use-threads was issued. That is how it ought to be,
since threaded pdfinfo workers just fight over the GIL and there is no
sense in parallelizing them.
Also, the user's --use-threads or --no-use-threads would be ignored in
the case of pdfinfo. By setting max_workers=1 we disabled worker processes.
This fixes how that decision is made (putting it in the relevant code, which
knows its constraints) and allows the user to influence the
thread/process decision again.
2023-10-24 00:54:30 -07:00
James R. Barlow
c278fecb34
Rename post_process -> postprocess
...
For consistency with preprocess
2023-10-24 00:54:30 -07:00
James R. Barlow
23951c9e38
Working HOCR folder to PDF converter
2023-10-24 00:54:30 -07:00
James R. Barlow
e8ae370ceb
Eliminate api= kwarg and implicit creation of pluginmanager
2023-10-24 00:54:30 -07:00
James R. Barlow
67be4d1904
Refactor CLI exception handling
2023-10-24 00:54:30 -07:00
James R. Barlow
6f82097d14
Refactor setup_pipeline to decouple manage_work_folder
2023-10-24 00:54:30 -07:00
James R. Barlow
fc6f959d21
Refactor debug log and work folder context cleanup
2023-10-24 00:54:30 -07:00
James R. Barlow
e38d569d8f
languages: kwargs are overkill
2023-10-24 00:54:30 -07:00
James R. Barlow
0856750ee2
Fix exit code error on Ghostscript failure
2023-10-24 00:54:30 -07:00
James R. Barlow
05721ba84a
Fix error on no languages available
2023-10-24 00:54:30 -07:00