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

problems on 4.3.2 that were not on 4.2.0, maybe with image dimensions? #116

Closed t4k closed 1 year ago

t4k commented 1 year ago

The serverless-iiif part of the stack might not be where my issue is, but I need a place to start.

I have been developing against a test install of this application that was spun up on version 4.2.0 and it works without issue. I'm ready to move to production and spinning up a new install of this application at 4.3.2 is giving me lots of trouble.

I'm seeing messages like The image “https://rvmnf2goqim5qiqtpufd544upq0wyoje.lambda-url.us-west-2.on.aws/iiif/2/76832775/full/90,/0/default.jpg” cannot be displayed because it contains errors. (in the browser) to

Unable to get dimensions for 76832775 using custom function. Falling back to sharp.metadata().

and

TypeError: Cannot read properties of undefined (reading 'toString')
    at /var/task/cache.js:31:54
    at new Promise (<anonymous>)
    at makeCache (/var/task/cache.js:29:10)
    at handleImageRequestFunc (/var/task/index.js:70:13)
    at async handleResourceRequestFunc (/var/task/index.js:49:14)
    at async Runtime.handleRequestFunc [as handler] (/var/task/index.js:24:16)

(in CloudWatch)

Please let me know what additional information might be helpful in diagnosing/debugging this issue. I'm happy to provide it.

mbklein commented 1 year ago

Would you be willing and able to supply a source image I can try to reproduce the error with locally?

t4k commented 1 year ago

Absolutely. Here is a generated original TIFF and a Pyramid TIFF:

And here is a real-world original and pyramid:

The Pyramid TIFFs were created with the same vips command as in the README with the only exception being the file extension on the output file is set to .ptif. (The resolverTemplate variable in my settings is updated to %s.ptif as well.)

mbklein commented 1 year ago

Great, thanks. I’ll let you know what I find.

mbklein commented 1 year ago

Good morning! I've just published v4.3.3 which I think should resolve the issue. I wasn't able to reproduce your exact error, but I did find a rounding error in the resizing code. Your image is currently resolving on my 4.3.3 test deployment at https://m7hwdiiq7opcbpc3ernelcsdme0uzppb.lambda-url.us-east-1.on.aws/iiif/2/76832775/full/90,/0/default.jpg. I'll leave that stack running until this issue is closed to make it easier to continue to work on it if necessary.

t4k commented 1 year ago

The issues I was seeing are gone! Thank you so much!