workspace validator: better check for file existence, fix
@@ -167,7 +167,7 @@ class WorkspaceValidator():
Validate that the imageFilename is correctly set to a filename relative to the workspace
"""
for f in self.mets.find_files(mimetype=MIMETYPE_PAGE):
- if not f.local_filename and not self.download:
+ if not is_local_filename(f.url) and not self.download:
self.report.add_notice("Won't download remote PAGE XML <%s>" % f.url)
continue
self.workspace.download_file(f)
@@ -183,7 +183,7 @@ class WorkspaceValidator():
Validate image height and PAGE imageHeight match
"""
for f in self.mets.find_files(mimetype=MIMETYPE_PAGE):
- if not f.local_filename and not self.download:
+ if not is_local_filename(f.url) and not self.download:
self.report.add_notice("_validate_dimension: Not executed because --download wasn't set and PAGE might reference remote (Alternatve)Images <%s>" % f.url)
continue
page = page_from_file(f).get_Page()
