# HG changeset patch # User Sebastien Jodogne # Date 1723643533 -7200 # Node ID 9dc7f1e8716d2d7eab531cc105582c75ca17bd73 # Parent 584909ee8883f2d3a5a155946a8400459fbef102 reverse the order of the "sizes" field in the IIIF manifest diff -r 584909ee8883 -r 9dc7f1e8716d NEWS --- a/NEWS Wed Aug 14 15:43:28 2024 +0200 +++ b/NEWS Wed Aug 14 15:52:13 2024 +0200 @@ -4,6 +4,8 @@ * OrthancWSIDicomizer supports plain TIFF, besides hierarchical TIFF * New option: "tiff-alignment" to control deep zoom of plain TIFF over IIIF * Force version of Mirador to 3.3.0 +* In the IIIF manifest, reverse the order of the "sizes" field, which + seems to fix compatibility with Mirador v4.0.0-alpha Version 2.0 (2023-10-07) diff -r 584909ee8883 -r 9dc7f1e8716d ViewerPlugin/IIIF.cpp --- a/ViewerPlugin/IIIF.cpp Wed Aug 14 15:43:28 2024 +0200 +++ b/ViewerPlugin/IIIF.cpp Wed Aug 14 15:52:13 2024 +0200 @@ -127,6 +127,18 @@ } } + /** + * Reversing the order of the "sizes" field seems to be necessary + * for recent version of OpenSeadragon (>= 4.1.0) and Mirador (>= + * 4.0.0). This fix was included in release 2.1 of the WSI plugin. + * https://github.com/openseadragon/openseadragon/issues/2379 + **/ + Json::Value reversedSizes = Json::arrayValue; + for (Json::Value::ArrayIndex i = sizes.size(); i > 0; i--) + { + reversedSizes.append(sizes[i - 1]); + } + Json::Value tiles; tiles["width"] = pyramid.GetTileWidth(0); tiles["height"] = pyramid.GetTileHeight(0); @@ -141,7 +153,7 @@ result["id"] = iiifPublicUrl_ + "tiles/" + seriesId; result["width"] = pyramid.GetLevelWidth(0); result["height"] = pyramid.GetLevelHeight(0); - result["sizes"] = sizes; + result["sizes"] = reversedSizes; result["tiles"].append(tiles); std::string s = result.toStyledString();