From 684f13e112da118054a0d171a2b3400c9675c509 Mon Sep 17 00:00:00 2001 From: jlpereira Date: Wed, 28 Feb 2024 17:56:53 -0300 Subject: [PATCH] Fix TIFF visualization --- src/modules/otus/store/useImageStore.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/modules/otus/store/useImageStore.js b/src/modules/otus/store/useImageStore.js index f6d9aef..14fa47a 100644 --- a/src/modules/otus/store/useImageStore.js +++ b/src/modules/otus/store/useImageStore.js @@ -17,6 +17,7 @@ export const useImageStore = defineStore('imageStore', { }, async loadImages(otuId) { + const UNSUPPORTED_FORMAT = ['image/tiff'] const params = { extend: ['depictions', 'attribution', 'source', 'citations'], otu_scope: ['all'] @@ -32,7 +33,16 @@ export const useImageStore = defineStore('imageStore', { }) ) - this.images = response.data + this.images = response.data.map((item) => { + const image = { ...item } + + if (UNSUPPORTED_FORMAT.includes(image.content_type)) { + image.original = item.original_png || item.original + } + + return image + }) + this.controller = null } catch (e) { if (e.name !== RESPONSE_ERROR.CanceledError) {