parent
3ac8dd0fc9
commit
b7eaaea8e0
1 changed files with 13 additions and 1 deletions
|
|
@ -7,7 +7,7 @@
|
||||||
}}</span>
|
}}</span>
|
||||||
</v-avatar>
|
</v-avatar>
|
||||||
<div class="bubble image-bubble">
|
<div class="bubble image-bubble">
|
||||||
<v-img :aspect-ratio="16 / 9" ref="image" :src="src" cover />
|
<v-img :aspect-ratio="16 / 9" ref="image" :src="src" :cover="cover" :contain="contain" />
|
||||||
<QuickReactions :event="event" :reactions="reactions" />
|
<QuickReactions :event="event" :reactions="reactions" />
|
||||||
</div>
|
</div>
|
||||||
<div class="op-button" ref="opbutton">
|
<div class="op-button" ref="opbutton">
|
||||||
|
|
@ -33,6 +33,8 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
src: null,
|
src: null,
|
||||||
|
cover: true,
|
||||||
|
contain: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
@ -42,6 +44,16 @@ export default {
|
||||||
util
|
util
|
||||||
.getThumbnail(this.$matrix.matrixClient, this.event, width, height)
|
.getThumbnail(this.$matrix.matrixClient, this.event, width, height)
|
||||||
.then((url) => {
|
.then((url) => {
|
||||||
|
const info = this.event.getContent().info;
|
||||||
|
// JPEGs use cover, PNG and GIF ect contain. This is because PNG and GIF are expected to
|
||||||
|
// be stickers and small emoji type things.
|
||||||
|
if (info && info.mimetype && info.mimetype.startsWith("image/jp")) {
|
||||||
|
this.cover = true;
|
||||||
|
this.contain = false;
|
||||||
|
} else {
|
||||||
|
this.cover = false;
|
||||||
|
this.contain = true;
|
||||||
|
}
|
||||||
this.src = url;
|
this.src = url;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue