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

Sipi's mimetype_consistency fails with .bin file #1531

Closed
benjamingeer opened this issue Nov 28, 2019 · 4 comments · Fixed by #1535
Closed

Sipi's mimetype_consistency fails with .bin file #1531

benjamingeer opened this issue Nov 28, 2019 · 4 comments · Fixed by #1535
Assignees
Labels
API/V1 bug something isn't working Sipi
Milestone

Comments

@benjamingeer
Copy link

Knora API v1 creates files with a .bin suffix using FileUtil.createTempFile. When such a file is submitted to Sipi using Knora's convert_from_path.lua script, the Sipi function mimetype_consistency fails with this error:

Sipi image error at [/sipi/src/SipiImage.cpp: 255]:
Unsupported file type: "tmp_7340135413634979849.bin

This seems to be why call to mimetype_consistency was commented out in convert_from_path.lua in PR #1459:

https://github.com/dasch-swiss/knora-api/pull/1459/files#diff-4a1a2aedd2d8b7dee2f824e33b243ca1R123

@benjamingeer
Copy link
Author

It would also be better if Sipi had a function like mimetype_consistency that also worked with non-image files.

@tobiasschweizer
Copy link
Contributor

see dasch-swiss/sipi#316

@subotic
Copy link
Collaborator

subotic commented Nov 28, 2019

This seems to be why call to mimetype_consistency was commented out in convert_from_path.lua

yes

@tobiasschweizer
Copy link
Contributor

I think the problem is simply that the filename generated by Knora is submitted as the original filename:

https://github.com/dasch-swiss/knora-api/blob/4204ff7ff98934b8cb723f212ee5ea2d9de4fe0f/webapi/src/it/scala/org/knora/webapi/e2e/v1/KnoraSipiScriptsV1ITSpec.scala#L193

Changing it to the actually given filename "Chlaus.jpg" solves the problem for me. This was changed in https://github.com/dasch-swiss/knora-api/pull/1459/files#diff-c0e2fd38cb951767ceedc140eab63e10L203

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API/V1 bug something isn't working Sipi
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants