Skip to content

Commit

Permalink
Merge pull request #206 from SpeciesFileGroup/development
Browse files Browse the repository at this point in the history
Fix TIFF visualization
  • Loading branch information
jlpereira authored Feb 28, 2024
2 parents 753a0f4 + 684f13e commit 665312c
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 665312c

Please sign in to comment.