-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
download remote files on demand #59
base: master
Are you sure you want to change the base?
Conversation
Not sure if this has the unintended consequence of changing remote URLs to local OTHER refs when in edit mode, because OCR-D core does not differentiate between It works for me – perhaps if you merge with your new test branch? |
This is of course the simplest solution possible and I like it, but I'm a bit worried about UI responsiveness at startup when a lot of files need to be downloaded. With GTK and the Python GIL the UI will freeze until everything is downloaded. |
Indeed, it's not more than a workaround as it stands. But apart from a multithreaded solution, couldn't we also replace remote images with placeholder images? These could be downloaded on (actual) demand in |
Can you try if the support_remote_images branch works for you? |
Fantastic! That works perfectly well, and the wait time is no issue IMO – it does not crash, and eventually serves the image. Before rebuilding the Docker image, one needs to update And I did see a glitch on the command line (but not in the UI):
(Might have been for a page without a PAGE though, so no issue really.) |
Should I close here, so you can proceed merging https://github.com/hnesk/browse-ocrd/tree/support_remote_images? |
I did find another glitch on your support_remote_images branch:
It's a bit fuzzy – running multiple times will download all the missing files eventually. The cause is a change in recent ocrd_models.OcrdFile.local_filename (after 2.54), which now is pathlib.Path instead of str. I can see the following spots which need adaptation (i.e. an extra
|
The latter will instead be fixed in core: OCR-D/core#1167 |
|
Fix #52