diff --git a/render-ws/src/main/java/org/janelia/render/service/TileDataService.java b/render-ws/src/main/java/org/janelia/render/service/TileDataService.java index dd7d94573..45aa8e8f9 100644 --- a/render-ws/src/main/java/org/janelia/render/service/TileDataService.java +++ b/render-ws/src/main/java/org/janelia/render/service/TileDataService.java @@ -368,14 +368,14 @@ static RenderParameters getCoreTileRenderParameters(final Integer width, final int tileRenderWidth; if (width == null) { - tileRenderWidth = (int) (tileSpec.getMaxX() - tileSpec.getMinX() + 1); + tileRenderWidth = (int) (tileSpec.getMaxX() - tileSpec.getMinX()); } else { tileRenderWidth = width; } final int tileRenderHeight; if (height == null) { - tileRenderHeight = (int) (tileSpec.getMaxY() - tileSpec.getMinY() + 1); + tileRenderHeight = (int) (tileSpec.getMaxY() - tileSpec.getMinY()); } else { tileRenderHeight = height; } diff --git a/render-ws/src/test/java/org/janelia/render/service/TileDataServiceTest.java b/render-ws/src/test/java/org/janelia/render/service/TileDataServiceTest.java index 2fd50fe16..b2cffa555 100644 --- a/render-ws/src/test/java/org/janelia/render/service/TileDataServiceTest.java +++ b/render-ws/src/test/java/org/janelia/render/service/TileDataServiceTest.java @@ -17,12 +17,13 @@ public class TileDataServiceTest { @Test - public void testGetCoreTileRenderParameters() throws Exception { + public void testGetCoreTileRenderParameters() { + // from https://github.com/saalfeldlab/render/issues/24 final String json = "{\n" + " \"tileId\" : \"1,3484_aligned_0_1_flip\",\n" + - " \"z\" : 3484.0, \"minX\" : 1896.0, \"minY\" : 876.0, \"maxX\" : 2919.0, \"maxY\" : 1899.0,\n" + + " \"z\" : 3484.0,\n" + " \"width\" : 1024.0, \"height\" : 1024.0,\n" + " \"mipmapLevels\" : {\n" + " \"0\" : {\n" + @@ -42,6 +43,10 @@ public void testGetCoreTileRenderParameters() throws Exception { "}"; TileSpec tileSpec = TileSpec.fromJson(json); + + final boolean force = true; + final boolean sloppy = true; // TODO: fix 1-pixel clipped bounding box when sloppy = false + tileSpec.deriveBoundingBox(tileSpec.getMeshCellSize(), force, sloppy); RenderParameters renderParameters = TileDataService.getCoreTileRenderParameters(null, null, null,