loris-imageserver / loris

Loris IIIF Image Server
Other
208 stars 87 forks source link

Full support for Pyramidal TIFF #460

Open regisrob opened 5 years ago

regisrob commented 5 years ago

It seems that Loris does not fully support PTIFF, in the sense that it does not give sizes and tiles in the info.json (which may mean that Loris does not read all the information in the image, i.e. widths/heights and tile width/height).

Below the info.json of a Pyramid TIFF in Loris:

{
"profile": [
    "http://iiif.io/api/image/2/level2.json",
{
"supports": [
    "canonicalLinkHeader",
    "profileLinkHeader",
    "mirroring",
    "rotationArbitrary",
    "regionSquare"
],
"qualities": [
    "default",
        "color",
        "gray",
        "bitonal"
],
"formats": [
    "jpg",
    "png",
    "gif",
    "webp"
]
}
],
"protocol": "http://iiif.io/api/image",
"sizes": [],
"height": 3152,
"width": 2320,
"@context": "http://iiif.io/api/image/2/context.json",
"@id": "https://example.org/loris/B721816101_RIA_062_1_0005.tiff"
}

The TIFF source image has been converted to a tiled pyramidal TIFF with vips:

vips tiffsave B721816101_RIA_062_1_0005.tif ptif/B721816101_RIA_062_1_0005.tif --compression=deflate --tile --tile-width=256 --tile-height=256 —pyramid

alexwlchan commented 5 years ago

Looking at https://github.com/python-pillow/Pillow/issues/3053 and #415, it sounds like the underlying image library (Pillow) has some support for pyramidal TIFF. I’m not sure if it exposes that information – I’ll need to do more digging.

(Although I’m about to go on leave for a week, so I won’t be looking at this for a while.)