loris-imageserver / loris

Loris IIIF Image Server
Other
208 stars 87 forks source link

way to disable jp2 as source format #403

Open nmaekawa opened 6 years ago

nmaekawa commented 6 years ago

at harvardx we don't usually have jp2, so we don't bother to install anything to deal with it (kakadu nor openjp2).

But say that i have the loris/tests/img in my storage and someone decides to request it. What I see is that this request returns a 500 after a while (I think 2min).

I can remove the jp2 entry from transformers section in loris.conf and that will return a 500 faster. Or I can prevent jp2 to reach loris (like have nginx in front of loris and send a 404 for jp2 requests).

This is really a minor thing, but it would be good to have a way to disabled jp2, or other source format the we decided not to support.

alexwlchan commented 6 years ago

So the expedient fix would be to remove any JP2 images from your storage.

I suspect the long timeout is being caused by blocking in this code:

https://github.com/loris-imageserver/loris/blob/bf509cdc539c26f4bd8ab318870b8daaede9b1fe/loris/transforms.py#L314-L319

and eventually something in the stack times out the request and returns a 500 (although a 504 might be more appropriate).

The correct fix is to ensure that code doesn't block if the command hangs.

nmaekawa commented 6 years ago

@alexwlchan ah, thanks for checking on this.