Skip to content
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

StillImageRepresentation uploaded by knora-xml-import cannot be displayed in Salsah 1.5 #21

Closed
mrivoal opened this issue Dec 4, 2019 · 15 comments
Labels
bug Something isn't working

Comments

@mrivoal
Copy link
Contributor

mrivoal commented Dec 4, 2019

Using knora on develop and running the knora-xml-import script with images as described in the doc results in an error in Salsah 1.5 and Knora API.

If a resource is a subclass of knora-base:StillImageRepresentation, even though the import with knora-xml-import went smoothly, I cannot display the resource at all. I got a 500 Internal Server Error and if a try to display the resource in the API (using http://0.0.0.0:3333/v1/resources/http%3A%2F%2Frdfh.ch%2F00FE%2FuYkYMpHoRfe7O29TPBb-BA), then I got the following error:

{"status":4,"error":"org.knora.webapi.InconsistentTriplestoreDataException: Unknown MIME type: image/jpx"}

But I can display without any problem a resource if it is not a a subclass of knora-base:StillImageRepresentation.

It can be easily reproduced using the test-data.xml.

@mrivoal mrivoal added the bug Something isn't working label Dec 5, 2019
@mrivoal
Copy link
Contributor Author

mrivoal commented Dec 6, 2019

@lrosenth could you maybe have a look at this? (not very urgent though, but I'm planning to use the library for a full data import which will include images.)

@subotic
Copy link
Collaborator

subotic commented Dec 9, 2019

Could you maybe try the same thing with https://github.com/dasch-swiss/knora-api/releases/tag/v10.1.1 and not develop?

After this commit, there where some changes involving Knora-Sipi integration. It would be good to know if this issue was introduced recently or if it was there for a longer time.

@subotic
Copy link
Collaborator

subotic commented Dec 9, 2019

And thanks for reporting :-)

@mrivoal
Copy link
Contributor Author

mrivoal commented Dec 9, 2019

You were right. With this version of Knora, I am able to display a StillImageRepresentation.

@subotic
Copy link
Collaborator

subotic commented Dec 10, 2019

So the question is, was a bug introduced in knora-api or a breaking change requiring changes to knora-py?

@subotic
Copy link
Collaborator

subotic commented Dec 10, 2019

@benjamingeer @tobiasschweizer could you maybe take a look at this issue? In recent commits of knora-api there was either a bug introduced or a breaking change.

@subotic

This comment has been minimized.

@subotic
Copy link
Collaborator

subotic commented Dec 10, 2019

What happens if you access the resource with v2?: http://0.0.0.0:3333/v2/resources/http%3A%2F%2Frdfh.ch%2F00FE%2FuYkYMpHoRfe7O29TPBb-BA

@tobiasschweizer
Copy link
Contributor

I guess v2 allows for MIME types that v1 does not support:

https://github.com/dasch-swiss/knora-api/blob/4dad1d788c15a21c2d04bc2f14fc0081e638137a/webapi/src/main/scala/org/knora/webapi/responders/v1/ValueUtilV1.scala#L104-L125

image/jpx is not listed, only image/jp2.

@tobiasschweizer
Copy link
Contributor

Maybe image/jpx could simply be added: see https://en.wikipedia.org/wiki/JPEG_2000, https://tools.ietf.org/html/rfc3745

@benjamingeer
Copy link

I think I had this problem too, and I solved it this way:

https://github.com/dasch-swiss/knora-api/pull/1233/files#diff-902f74f03286363fd8a94360df6c4753R109

@mrivoal
Copy link
Contributor Author

mrivoal commented Dec 12, 2019

@subotic I have finally tested the /v2/resources route on develop. I get to see the complete description of the resource if I use this route instead of v1.

@loicjaouen
Copy link
Contributor

@benjamingeer so PR #1233 solves this issue? it should be in a coming release of knora-api, shouldn't it?

@benjamingeer
Copy link

@loicjaouen I don't know, I haven't looked at this issue myself. dasch-swiss/dsp-api#1233 is waiting for dasch-swiss/sipi#309.

@tobiasschweizer
Copy link
Contributor

If you need that urgently, why don't you just add the missing mimetype as suggested in #21 (comment)?

@subotic subotic added this to the Backlog milestone Feb 7, 2020
@irinaschubert irinaschubert removed this from the Backlog milestone Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants