mirror of
https://github.com/qurator-spk/eynollah.git
synced 2025-06-14 22:59:53 +02:00
adapt to ocrd>=2.54 url vs local_filename
This commit is contained in:
parent
1a95bca22d
commit
0720091a48
1 changed files with 5 additions and 1 deletions
|
@ -43,6 +43,10 @@ class EynollahProcessor(Processor):
|
||||||
page = pcgts.get_Page()
|
page = pcgts.get_Page()
|
||||||
# XXX loses DPI information
|
# XXX loses DPI information
|
||||||
# page_image, _, _ = self.workspace.image_from_page(page, page_id, feature_filter='binarized')
|
# page_image, _, _ = self.workspace.image_from_page(page, page_id, feature_filter='binarized')
|
||||||
|
if not('://' in page.imageFilename):
|
||||||
|
image_filename = next(self.workspace.mets.find_files(local_filename=page.imageFilename)).local_filename
|
||||||
|
else:
|
||||||
|
# could be a URL with file:// or truly remote
|
||||||
image_filename = self.workspace.download_file(next(self.workspace.mets.find_files(url=page.imageFilename))).local_filename
|
image_filename = self.workspace.download_file(next(self.workspace.mets.find_files(url=page.imageFilename))).local_filename
|
||||||
eynollah_kwargs = {
|
eynollah_kwargs = {
|
||||||
'dir_models': self.resolve_resource(self.parameter['models']),
|
'dir_models': self.resolve_resource(self.parameter['models']),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue