Skip to content

Commit

Permalink
Changes corresponding to Imagebox3 update
Browse files Browse the repository at this point in the history
  • Loading branch information
PrafulB committed Oct 10, 2024
1 parent 03be693 commit cdf257a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions scripts/miscProcessing.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ const getWSIInfo = async (url, imgbox3=false) => {
imageInfo = await imagebox3Instance[url].getInfo()
} else {
const infoURL = `${tileServerBasePath}?iiif=${url}/info.json`
imageInfo = await fetch(infoURL)
imageInfo = await (await fetch(infoURL)).json()
}
return await imageInfo.json()
return imageInfo
}

const getWSIThumbnail = async (url, width, height, imgbox3=false) => {
Expand All @@ -202,9 +202,9 @@ const getWSIThumbnail = async (url, width, height, imgbox3=false) => {
thumbnailImage = await imagebox3Instance[url].getThumbnail(thumbnailWidthToRender)
} else {
const thumbnailURL = `${tileServerBasePath}?iiif=${url}/0,0,${width},${height}/256,/0/default.jpg`
thumbnailImage = await fetch(thumbnailURL)
thumbnailImage = await (await fetch(thumbnailURL)).blob()
}
return thumbnailImage.blob()
return thumbnailImage
}

const handleWSIThumbnailCreation = async (op, imageId, name, wsiThumbnailsFolderId) => {
Expand Down
4 changes: 2 additions & 2 deletions scripts/modelPrediction.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ onmessage = async (evt) => {
}
} else if (!tile) {
const tileServerRequest = `${tileServerBasePath}/?format=${fileFormat}&iiif=${imageURL}/${x},${y},${width},${height}/${tileWidthRendered},/0/default.jpg`
tile = await fetch(tileServerRequest)
tile = await (await fetch(tileServerRequest)).blob()
}
// const tileServerRequest = `${tileServerBasePath}/?format=${fileFormat}&iiif=${imageURL}/${x},${y},${width},${height}/${width > maxTileImageDimension ? maxTileImageDimension: width},/0/default.jpg`
try {
const tileBlob = await tile.blob()
const tileBlob = tile
const tileImageBitmap = await createImageBitmap(tileBlob)

if (tileImageBitmap) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/wsi.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ wsi.loadImage = async (id, name, fileMetadata={}) => {
if (!imageInfo) {
wsi.imagebox3Instance = new Imagebox3(url, 0)
await wsi.imagebox3Instance.init()
imageInfo = await (await wsi.imagebox3Instance.getInfo()).json()
imageInfo = await wsi.imagebox3Instance.getInfo()
}
wsi.isImagebox3Compatible = true
} catch(e) {
Expand Down

0 comments on commit cdf257a

Please sign in to comment.