IIIF - possible wrong calculation of tile width
See original GitHub issueI have this image served by IIPImage server:
{
"@context": "http://iiif.io/api/image/2/context.json",
"protocol": "http://iiif.io/api/image",
"width": 2609,
"height": 3424,
"sizes": [
{
"width": 163,
"height": 214
},
{
"width": 326,
"height": 428
},
{
"width": 652,
"height": 856
},
{
"width": 1304,
"height": 1712
}
],
"tiles": [
{
"width": 256,
"height": 256,
"scaleFactors": [
1,
2,
4,
8,
16
]
}
],
"@id": "http://iip.test/iiif/f.jp2",
"profile": [
"http://iiif.io/api/image/2/level2.json",
{
"formats": [
"jpg",
"png",
"webp"
],
"qualities": [
"native",
"color",
"gray",
"bitonal"
],
"supports": [
"regionByPct",
"regionSquare",
"sizeByForcedWh",
"sizeByWh",
"sizeAboveFull",
"sizeUpscaling",
"rotationBy90s",
"mirroring"
],
"maxWidth": 3500,
"maxHeight": 3500
}
]
}
When used with Openseadragon viewer I get these IIIF API calls:
First row:
- http://iip.test/iiif/f.jp2/0,0,2048,2048/256,/0/default.jpg => 256 x 256
- http://iip.test/iiif/f.jp2/2048,0,561,2048/71,/0/default.jpg => 71 x 259
Second row:
- http://iip.test/iiif/f.jp2/0,2048,2048,1376/256,/0/default.jpg => 256 x 172
- http://iip.test/iiif/f.jp2/2048,2048,561,1376/71,/0/default.jpg => 71 x 174
The content of the last tile column appears dropped a bit when zoomig out or on a small displays.
As @ruven kindly pointed out at https://github.com/ruven/iipsrv/issues/237#issuecomment-1235444340 it looks like the width parameter seems probably miscalculated resulting in bad tile height.
Issue Analytics
- State:
- Created a year ago
- Comments:12 (11 by maintainers)
Top Results From Across the Web
IIIF - last (non-square) tile in each row has incorrect (bigger) height ...
It's using a "tile" width of 2048 for the first IIIF request (left tile on the full-size image) and if we calculate the...
Read more >Image API 2.1.1 - IIIF
Each description gives a width, optionally a height for non-square tiles, and a set of scale factors at which tiles of those dimensions...
Read more >Wrong tile resolution when using OpenLayers to display local ...
source.IIIF({ size: [config.map.width, config.map.height], extent: extent, projection: projection, tileSize: tileSize, resolutions: [1, 2, 4], }); ...
Read more >Tiling Problem - GeeksforGeeks
Given a “2 x n” board and tiles of size “2 x 1”, count the number of ... Please write comments if you...
Read more >Defining Normal and Abnormal Fetal Growth - NCBI - NIH
In summary, an ideal definition of FGR should take into account the growth potential of the fetus, current fetal size, fetal and placental...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Could you try modifying your local copy for these lines: https://github.com/openseadragon/openseadragon/blob/master/src/iiiftilesource.js#L401-L402 to use floor instead of ceil, and see if it works as expected?
(2609 - 2048) / 8
is 70.125, and the ceil makes it a width of 71. The top left of the region is correct in the second column, as is the width (561) and height (2048). So the only other parameter to manipulate is the desired size which has to be a whole number of pixels. Asking for a width of 71, when the number of pixels is 561 is 0.12656, times the height of 2048 is 259, giving you the three undesirable pixels.That said, this has been working for a long time now so I’m surprised it hasn’t come up before
Fixed by #2206.