element-hq / element-hq/element-android

Incorrect mimetype

Open
#2,421 3 comments 3 reactions 0 assignees View on GitHub
A-Media O-Occasional S-Minor
Dominant language
Kotlin
Stars
3.7k
Forks
917
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
On some uploaded images element-android sets as mimetype and content-type `image/*`. This causes some media repos, such as matrix-media-repo, to not thumbnail, as that is an unknown image type.

Failed thumbnail: https://sorunome.de/_matrix/media/r0/thumbnail/nordgedanken.dev/2866accf9a40c15a742aeccd45fd6302902a0e91?width=800&height=800
Download: https://sorunome.de/_matrix/media/r0/download/nordgedanken.dev/2866accf9a40c15a742aeccd45fd6302902a0e91

It can be seen that in the download response the content type is `image/*`

The `info` block of the m.image event also contains the incorrect mimetype.

```
"content": {
"body": "temp.jpg",
"info": {
"h": 1432,
"mimetype": "image/*",
"size": 291578,
"w": 1440
},
"msgtype": "m.image",
"url": "mxc://nordgedanken.dev/2866accf9a40c15a742aeccd45fd6302902a0e91"
},
```

**To Reproduce**
Steps to reproduce the behavior:
1. Make a screenshot
2. Tap share
3. Select room in element
4. it does not make a difference if you share as original

**Expected behavior**
It should set the correct content-type / mimetype, in this specific case `image/jpeg`

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Smartphone (please complete the following information):**
One plus 7 pro
Oxygen os 10.0.7
Android 10

**Additional context**
- App version and store: 1.0.10 gplay
- Homeserver: nordgedanken.dev

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.