use of org.mycore.iiif.image.model.MCRIIIFImageTileInformation in project mycore by MyCoRe-Org.
the class MCRIVIEWIIIFImageImpl method getInformation.
public MCRIIIFImageInformation getInformation(String identifier) throws MCRIIIFImageNotFoundException, MCRIIIFImageProvidingException, MCRAccessException {
try {
Path tiledFile = tileFileProvider.getTiledFile(identifier);
MCRTiledPictureProps tiledPictureProps = getTiledPictureProps(tiledFile);
MCRIIIFImageInformation imageInformation = new MCRIIIFImageInformation(MCRIIIFBase.API_IMAGE_2, buildURL(identifier), DEFAULT_PROTOCOL, tiledPictureProps.getWidth(), tiledPictureProps.getHeight());
MCRIIIFImageTileInformation tileInformation = new MCRIIIFImageTileInformation(256, 256);
for (int i = 0; i < tiledPictureProps.getZoomlevel(); i++) {
tileInformation.scaleFactors.add((int) Math.pow(2, i));
}
imageInformation.tiles.add(tileInformation);
return imageInformation;
} catch (FileSystemNotFoundException e) {
LOGGER.error("Could not find Iview ZIP for {}", identifier, e);
throw new MCRIIIFImageNotFoundException(identifier);
}
}
Aggregations