Giter VIP home page Giter VIP logo

Comments (5)

hnesk avatar hnesk commented on July 21, 2024 1

I hope I have fixed most of the points now, except the selectable file group, which is quite difficult to implement (but absolutely worth it) and now handled in #9

Why should the initial view be restricted to pages contained in OCR-D-IMG

The initial view file_group is now determined by the algorithm outlined in my comment, point 1., the (quite dirty) implementation is here

So how about presenting all structMap entries sorted by their @ORDER (if present) or @ID with the first fptr that shows up?

The page browser now uses all page_ids from ocrd_models.ocrd_mets.OcrdMets.physical_pages (but without taking @ORDER into account) to determine which pages "exist". It then tries to find matching image files from a given file_group to display. If no image is found for the page a "missing-image" icon is displayed.

from browse-ocrd.

hnesk avatar hnesk commented on July 21, 2024

That's a valid question, and I had the problem myself (original fileGrp not named OCR-D-IMG).
Solutions to your questions:

  1. The fileGrp to display with PageListStore should not be hardcoded to OCR-D-IMG, but should be selectable like in ViewImages. As a default it should try:
  • The first of a (configurable) list of preferred fileGroups to display as images ( OCR-D-IMG, MAX, ORIGINAL) which have a mime-type matching image/*.
  • The first fileGroup (sorted by ???? maybe string length, because derived images usually have more complex name than the original?) which has a mime-type matching image/*.
  • If there is no match according to the page_id in file_lookup-logic you described, display a "missing image"-icon
  1. View.use_file_group is overridden in ViewXmland ViewImages. OCR-D-IMG is just the default value for all possible views. The use_file_group implementations in these views are actually quite robust and are taking the user selection and availability of the selected fileGrp into account. I think the way to go is to base PageListStore on the same implementation.

What do you think?

from browse-ocrd.

bertsky avatar bertsky commented on July 21, 2024

2: Oh, I see! Yes, sounds reasonable to base the initial view on that as well.

1: Yes, this would be very intuitive behaviour and easy to use IMHO. Or (instead of the second criterion) one could even start with an empty view if the first criterion (fixed/configured list of preferred groups) does not yield any images.

from browse-ocrd.

bertsky avatar bertsky commented on July 21, 2024

I hope I have fixed most of the points now, except the selectable file group, which is quite difficult to implement (but absolutely worth it) and now handled in #9

Great work!

The initial view file_group is now determined by the algorithm outlined in my comment, point 1., the (quite dirty) implementation is here

Wow, you even have a heuristic for the length of the candidate fileGrps in there!

The page browser now uses all page_ids from ocrd_models.ocrd_mets.OcrdMets.physical_pages (but without taking @ORDER into account) to determine which pages "exist". It then tries to find matching image files from a given file_group to display. If no image is found for the page a "missing-image" icon is displayed.

Works perfectly, many thanks!

from browse-ocrd.

hnesk avatar hnesk commented on July 21, 2024

I will close this now, for the rest see #9

from browse-ocrd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.