element-hq / element-hq/element-ios

webp image without thumbnail doesn't show in several situation

Open
#4,004 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Swift
Stars
1.8k
Forks
544
PR merge metrics
PR metrics pending

Description

**Describe the bug**
When we upload a webp image without a thumbnail, element on iOS doesn't display it.

**To Reproduce**

I use mautrix-signal.
1. Go to signal
2. Upload a webp

The content decrypted looks like:
```
{
"room_id": "MY ROOT",
"type": "m.room.message",
"content": {
"msgtype": "m.image",
"body": "1_webp_ll.webp",
"info": {
"mimetype": "image/webp",
"h": 301,
"w": 400
},
"file": {
"key": {...},
"iv": "...",
"hashes": {
"sha256": "..."
},
"url": "mxc://...",
"v": "v2"
}
}
}
```

The file.mimetype is not present there. It works on Desktop and Web without any problem.

When I copy the mimetype from the info section, the image display properly.

Then I try to send a sticker which has a special "type": "m.sticker".

It fail to display again.

I set it back to "m.room.message" and it works.

**Expected behavior**
The info section is there to manage the filetype. We should not rely on the file.mimetype.
The m.room.message or m.sticker should work the same way also.

**Screenshots**

**Desktop (please complete the following information):**
- OS: MacOS
- Version: 11.2

**Smartphone (please complete the following information):**
- Device: iPhone12
- OS: iOS
- Version 14.4

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.