Skip to content

Commit

Permalink
Fix TIFF visualization
Browse files Browse the repository at this point in the history
  • Loading branch information
jlpereira committed Feb 28, 2024
1 parent b958716 commit 684f13e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/modules/otus/store/useImageStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand 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) {
Expand Down

0 comments on commit 684f13e

Please sign in to comment.