samvera / serverless-iiif

IIIF Image API 2.1 & 3.0 server in an AWS Serverless Application
https://samvera.github.io/serverless-iiif/
Apache License 2.0
69 stars 21 forks source link

Image contains errors #132

Closed hammo92 closed 9 months ago

hammo92 commented 9 months ago

I'm able to get the info.json file for the image, however, when I try to access the image I get a message that the image contains errors: Screenshot from 2023-11-28 10-59-22

I'm not getting any errors on the lambda function, I've tried redeploying the application, but the error persists.

hammo92 commented 9 months ago

I've found that only some images cause the issue, these images work fine: success.zip

but these don't: fail.zip

All the tifs are generated using the imageMagick command specified in the docs

mbklein commented 9 months ago

Thanks for reporting this issue, @hammo92! The difference between your working and non-working images is that the working ones have 3 color channels, while the non-working ones have 4. It seems the version of libvips packaged with serverless-iiif has a problem with JPEG-compressed pyramidal TIFF images with alpha channels. Please try recreating the two failed source images using the following command and let me know if it resolves the issue (or doesn't):

convert source_image.tif -alpha off -define tiff:tile-geometry=256x256 -compress jpeg 'ptif:output_image.tif'

If it helps, I'll update the docs to include this information and workaround.

hammo92 commented 9 months ago

Perfect, that's working for me now.

I think it might be good to add it as a note on the docs, it's not an issue which is easy to identify as the images seem fine when viewed locally, fortunately you're a Tiff wizard and spotted it straight away!

Thanks for the help.

mbklein commented 9 months ago

Do you think this draft doc change covers it clearly enough?

hammo92 commented 9 months ago

I think that's good, it's clear; and even if users don't understand the specifics of the Tiff format and channels the provided commands will get them the right results.