Set up filter_ocr_image hook

This commit is contained in:
James R. Barlow
2020-05-01 02:56:41 -07:00
parent 8d2535e327
commit be107b4fed
5 changed files with 30 additions and 9 deletions
+1 -8
View File
@@ -33,13 +33,6 @@ def prepare(options: Namespace) -> None:
The plugin may modify the options. All objects that are in options must
be picklable so they can be marshalled to child worker processes.
Typically, a plugin will call ``registry.register_plugin(__name__)`` to register
all of its public functions with the plugin registry. Functions that are
not intended for registration should be prefixed with an underscore.
Functions that imported from other modules will be ignored by
``.register_plugin()``. For example if you use ``from os import basename``,
``basename`` will not be registered.
"""
@@ -57,7 +50,7 @@ def validate(pdfinfo: PdfInfo, options: Namespace) -> None:
"""
@hookspec
@hookspec(firstresult=True)
def filter_ocr_image(image: Image) -> Image:
"""Called to filter the image before it is sent to OCR.