aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/conversion/czi/pyramidWorker.ts3
-rw-r--r--src/conversion/types/helpers.ts14
2 files changed, 8 insertions, 9 deletions
diff --git a/src/conversion/czi/pyramidWorker.ts b/src/conversion/czi/pyramidWorker.ts
index c6bd766..00cb8b4 100644
--- a/src/conversion/czi/pyramidWorker.ts
+++ b/src/conversion/czi/pyramidWorker.ts
@@ -43,7 +43,6 @@ const findRelatedTiles: Function = function(plane: CZIHeightMap, desired: TileBo
};
export const getTile: Function = async function(imageDir: string, cVal: string, x:number = 0, y:number = 0, w:number = 1024, h:number = 1024, zoom: number = 1): Promise<CZITileRequest> {
-
log = logger.for({component: "CZI Live Server", req: {imageDir: imageDir, cVal: cVal, x:x, y:y, w:w, h:h, zoom: zoom}});
let layout: WholeCZIHierarchy = JSON.parse(await jobQueue.enqueue(2, readFile, null, imageDir + "layout.json", 'utf8'));
@@ -119,7 +118,7 @@ const getFinalTile: Function = async function(imageDir: string, imageTier: CZIHe
}
})
- log.info(`Gen new Tile: ${outputFileName} X:${desiredRegion.left} Y:${desiredRegion.top} W:${desiredRegion.width()} H:${desiredRegion.height()} Z:${cVal}`);
+ log.debug(`Gen new Tile: X:${desiredRegion.left} Y:${desiredRegion.top} W:${desiredRegion.width()} H:${desiredRegion.height()} Z:${cVal}`);
return {
dimensions: new TileBounds(
0, extractionRegion.width(),
diff --git a/src/conversion/types/helpers.ts b/src/conversion/types/helpers.ts
index 4621bf6..6fd3be0 100644
--- a/src/conversion/types/helpers.ts
+++ b/src/conversion/types/helpers.ts
@@ -58,16 +58,16 @@ export class TileBounds {
return this.bottom - this.top;
}
public scaleDown(level: number) {
- this.left = Math.ceil(this.left / level),
- this.right = Math.ceil(this.right / level),
- this.top = Math.ceil(this.top / level),
- this.bottom = Math.ceil(this.bottom / level)
+ this.left = Math.floor(this.left / level),
+ this.right = Math.floor(this.right / level),
+ this.top = Math.floor(this.top / level),
+ this.bottom = Math.floor(this.bottom / level)
}
public scaleUp(level: number) {
this.left = Math.floor(this.left * level),
- this.right = Math.ceil(this.right * level),
- this.top = Math.ceil(this.top * level),
- this.bottom = Math.ceil(this.bottom * level)
+ this.right = Math.floor(this.right * level),
+ this.top = Math.floor(this.top * level),
+ this.bottom = Math.floor(this.bottom * level)
}
}