loris-imageserver / loris

Loris IIIF Image Server
Other
209 stars 87 forks source link

resolver configuaration #455

Closed ericvanderlinden closed 5 years ago

ericvanderlinden commented 5 years ago

in your document resolver.md you suggest to use: source_suffix='/datastreams/accessMaster/content'

What does that do? There is no information in the documentation.

bcail commented 5 years ago

Hi @ericvanderlinden. Here's how that SimpleHTTPResolver works: loris takes the ID of an item, and then it needs to know how to construct a URL to retrieve the master image (if the ID isn't already a URL). So there are two options you can configure: source_prefix='https:///fedora/objects/' source_suffix='/datastreams/accessMaster/content'

The source prefix is the first part of the URL, which you want for all items, and the source_suffix is the last part of the URL, if you want a consistent final segment for all URLs.

So, if I were configuring Loris to pull masters from Fedora 3, and the IDs looked like "test:123", "test:789", ..., and all the master images were in an 'accessMaster' datastream, then the configuration would look like above: source_prefix='https:///fedora/objects/' source_suffix='/datastreams/accessMaster/content'

Then the URLs that Loris would construct for pulling the master images would look like this: https:///fedora/objects/test:123/datastreams/accessMaster/content https:///fedora/objects/test:789/datastreams/accessMaster/content

Does that help?

ericvanderlinden commented 5 years ago

So in this case "/datastreams/accessMaster/content" would function as extra info you need to process the image. But my URLs would be domain/loris/image/01/image.jpg Then image/01/image.jpg is the ID...

Is that possible?

bcail commented 5 years ago

Sure, that should work. So in that case, you would leave the source_suffix as '', since the ID includes the last part of the URL.

What kind of external system is Loris pulling the images from via HTTP? Is it some kind of Fedora install?

ericvanderlinden commented 5 years ago

No, it is very simple Ubuntu file system at the moment. So the images are stored in "/usr/local/share/images/".

So maybe the SimpleFSResolver would be better. I switched because I could not find a way to work with the FS resolver and a domain name. I could only work with the IP address of the server.

I'm working on a proof of concept. It is not really about iiiF as such, more about what you can do with the images once you have them in a front end (in Mirador). (And I'm building a family photo archive on the side.)

bcail commented 5 years ago

Yes, you want SimpleFSResolver for this, not SimpleHTTPResolver, which is only for pulling the images from an external system via HTTP. So you can ignore the SimpleHTTPResolver config options. Is your SimpleFSResolver issue covered in your other issue? If not, please open a new issue with your SimpleFSResolver problem.

ericvanderlinden commented 5 years ago

I'll have a new look at the whole matter. What I know now my issue seems to be to use a domain name with the FS resolver. I will close both issues and open a new one if necessary.

Thank you for your patience. :)

ericvanderlinden commented 5 years ago

I was under the impression that the HTTP resolver worked because I the images that were in the cache showed up in the site. But new images were not cached and I started looking for a reason this was not happening.
When I deleted the cache the images that were working suddenly stopped working and did not come back.

I did not understand the use of the FS and the HTTP resolver.

From your comments I learned that caching an image and creating a URL are not only separate but also Loris first checks if an image exists in the cache and caches the image if it is not present. In the first case Loris only returns the URL, in the second case Loris create the image in the cache and then returns the URL.

Two recommendations from a user who is maybe more into creating front ends than working with back-ends. 1 Some diagram of the "Loris" process like URL only or cache -> URL would be helpful. 2 More explanation of the why and how of the FS and HTTP resolver would be helpful.