Skip to content

Commit

Permalink
cloudpath
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianWhitneyAI committed Jun 13, 2024
1 parent 5d9de04 commit 2bfd542
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions packages/core/entity/FileDetail/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,19 +161,6 @@ export default class FileDetail {
}

public async getPathToThumbnail(): Promise<string | undefined> {
if (this.cloudPath.endsWith(".zarr")) {
try {
// const thumbnailURL = await renderZarrThumbnailURL(this.cloudPath);
const thumbnailURL = await renderZarrThumbnailURL(
"https://animatedcell-test-data.s3.us-west-2.amazonaws.com/variance/136244.zarr"
);
return thumbnailURL;
} catch (error) {
console.error("Error generating Zarr thumbnail:", error);
throw new Error("Unable to generate Zarr thumbnail");
}
}

if (!this.thumbnail) {
const isFileRenderableImage = RENDERABLE_IMAGE_FORMATS.some((format) =>
this.name.toLowerCase().endsWith(format)
Expand All @@ -190,6 +177,17 @@ export default class FileDetail {
if (this.thumbnail?.startsWith("/allen")) {
return `${AICS_FMS_FILES_NGINX_SERVER}${this.thumbnail}`;
}

if (this.cloudPath.endsWith(".zarr")) {
try {
// const thumbnailURL = await renderZarrThumbnailURL(this.cloudPath);
const thumbnailURL = await renderZarrThumbnailURL(this.cloudPath);
return thumbnailURL;
} catch (error) {
console.error("Error generating Zarr thumbnail:", error);
throw new Error("Unable to generate Zarr thumbnail");
}
}
return this.thumbnail;
}
}

0 comments on commit 2bfd542

Please sign in to comment.