pelagios / recogito2

Semantic Annotation Without the Pointy Brackets
Apache License 2.0
150 stars 30 forks source link

Loading image via IIIF fails #707

Open frederik-elwert opened 1 year ago

frederik-elwert commented 1 year ago

I am trying to annotate an image that is available through IIIF via the heidICON database.

While the thumbnail is shown, the actual image in the document view is not shown. In the console, I see this error message:

Quellübergreifende (Cross-Origin) Anfrage blockiert: Die Gleiche-Quelle-Regel verbietet das Lesen der externen Ressource auf http://heidicon.ub.uni-heidelberg.de/iiif/2/1707266%3A898006/2048,0,512,1707/pct:12.5/0/default.jpg. (Grund: CORS-Anfrage schlug fehl). Statuscode: (null).

Since the same image is loaded fine in Storiiis and universalviewer, I was wondering if this is an issue in Recogito, or if it’s simply being stricter with regards to requirements.

(The manifest I’m testing is https://heidicon.ub.uni-heidelberg.de/manifest/iiif/1707266/manifest.json )

rsimon commented 1 year ago

Hi Frederik,

weird - I just tried importing the manifest, and it does load in Chrome. But it doesn't load in Firefox. It looks like it's related to this here:

https://stackoverflow.com/questions/24514666/why-is-this-cors-request-failing-only-in-firefox

I.e. could be a certificate issue. But, either way, nothing that looks like it's solvable in (or caused by) Recogito. Can you confirm that this manifest does indeed load in other apps, both in FF and Chrome?

frederik-elwert commented 1 year ago

Yes, it does load in Storiiis in Firefox.

But you’re right, in Chrome, Recogito does load the image.

(I was wondering if the CORS message is a red herring, and it might actually be about the fact that it’s a HTTP resource in a HTTPS context. But that’s just a gut feeling, I don’t know enough about how this works. And it’s still strange that it does work in other apps.)

rsimon commented 1 year ago

Ah, indeed - a web app hosted under HTTPS can never load cross-domain content from an HTTP resource. The manifest seems hosted at HTTPS. Are the image manifests hosted as HTTP? This could explain the problem.