dasch-swiss/sipi

/knora.json doesn't work with a CSV file

benjamingeer opened this issue · 11 comments

Steps to reproduce:

  1. Put a CSV file test.csv in /sipi/images/tmp.
  2. Make a request to http://localhost:1024/tmp/test.csv/knora.json.

Sipi responds with an internal server error:

Internal Server Error: Sipi image error at [/sipi/src/SipiImage.cpp: 381]: Could not read file /sipi/images/tmp/test.csv

The Sipi log says:

sipi            | Sipi: ERROR IN TIFF! Module: /sipi/images/tmp/test.csv
sipi            | Sipi: Not a TIFF or MDI file, bad magic number 28755 (0x7053)
sipi            | Sipi: GET /tmp/test.csv/knora.json failed (Internal Server Error): Sipi image error at [/sipi/src/SipiImage.cpp: 381]: Could not read file /sipi/images/tmp/test.csv

Ping (this is still blocking dasch-swiss/dsp-api#1532)

Still not working.

Yeah – I just fixed it. .../knora.json just returns the mimetype:

http://localhost:1024/images/test.csv/knora.json

results in

{
   "internalMimeType": "text/plain"
}

There is no way that the csv mikmtype can be determined by the magic number....

XML works also:

http://localhost:1024/images/hello.gresource.xml/knora.json

results in:

{
   "internalMimeType": "text/xml"
}

That's perfect, thanks, can we have a new Sipi release with this fix?

done!

I'm still getting the same error with the current Sipi.

Now Sipi's log says:

Sipi: GET /tmp/test.csv/knora.json failed (Internal Server Error): Sipi image error at [/sipi/src/SipiImage.cpp: 383]: Could not read file /sipi/images/tmp/test.csv

But I can see that the file is there in the filesystem.

I've just tried this again with the current Sipi, and got the same result.

Fixed in 3.0.0-rc.5.