Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/components/rmrk/Gallery/GalleryItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="column" :class="{ 'is-12': viewMode === 'theatre', 'is-6 is-offset-3': viewMode === 'default'}">
<div class="image-preview" :class="{fullscreen: isFullScreenView}">
<b-image
v-if="!isLoading && imageVisible"
v-if="!isLoading && imageVisible && !meta.animation_url"
:src="meta.image || require('@/assets/kodadot_logo_v1_transparent_400px.png')"
:src-fallback="require('@/assets/kodadot_logo_v1_transparent_400px.png')"
alt="KodaDot NFT minted multimedia"
Expand Down Expand Up @@ -232,12 +232,13 @@ export default class GalleryItem extends Vue {
animation_url: sanitizeIpfsUrl(meta.animation_url || '', 'pinata')
}

console.log(this.meta)
if (this.meta.animation_url && !this.mimeType) {
const { headers } = await axios.head(this.meta.animation_url);
this.mimeType = headers['content-type'];
console.log(this.mimeType)
const mediaType = resolveMedia(this.mimeType);
this.imageVisible = ![MediaType.VIDEO, MediaType.IMAGE, MediaType.MODEL, MediaType.IFRAME, MediaType.OBJECT].some(
this.imageVisible = ![MediaType.VIDEO, MediaType.MODEL, MediaType.IFRAME, MediaType.OBJECT].some(
t => t === mediaType
);
}
Expand Down Expand Up @@ -309,10 +310,6 @@ hr.comment-divider {
margin: auto;
}

.withPicture {
margin: 0.75em 0;
}

.image-wrapper {
position: relative;
margin: 30px auto;
Expand Down
2 changes: 1 addition & 1 deletion src/components/rmrk/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export const resolveMedia = (mimeType?: string): MediaType => {
}

if (/^image\/svg\+xml/.test(mimeType)) {
return MediaType.IFRAME
return MediaType.IMAGE
}

if (/^application\/pdf/.test(mimeType)) {
Expand Down