klokantech / embedr

Embedr.eu - Image Embedding Service (IES) with support for IIIF, OEmbed, zoomable viewer in an iFrame
http://embedr.eu/
European Union Public License 1.1
15 stars 4 forks source link

Specific error with kdu_compress can leads to Interaction with S3 failed error #81

Open o1da opened 8 years ago

o1da commented 8 years ago

Check image with URL https://www.rijksmuseum.nl/assetimage2.jsp?id=BK-1980-773-B It is JPG file, it can be converted to TIF, but conversion to JPEG2000 is failing, but without error status code from kdu_compress, so ingestion process continues to S3 upload. S3 upload fails with error code (and this is the one which is saved), because file with 0B size can't be uploaded.

This info is printed:

Error in Kakadu File Format Support:
Did not find a valid curv' data type in the embedded ICC profile's tone
reproduction curve tag.

Probably add another check for not 0B size of converted image - test of output code from kdu_compress isn't enough.

Look at kdu_compress too, it seems that source image isn't corrupted. Maybe different configuration? https://github.com/klokantech/hawk/blob/master/embed/app/ingest.py#L121 @MartinMikita

MartinMikita commented 8 years ago

kdu_compress returns -1 as error code (255), so maybe just improve checking in python.

Kakadu 7.7. is failing too. I tried converting this JPEG into TIFF with gdal_translate, but it ends with same error. kdu_compress without any arguments doesn't succeed.

I do not know, what to do with this error. I don't found anything special on kakadu forum, but maybe you can try write them, what to do with this error message.

klokan commented 8 years ago

If we detect this error we have to strip from the TIFF headers the ICC color profile or ignore it - this should be possible to do.

This is enhancement of the existing ingest process.