Matrix → Telegram images rotated 90° counterclockwise
JPEG images sent from Matrix to Telegram are rotated 90° counterclockwise. The same Matrix media is handled correctly by the mautrix-whatsapp and mautrix-signal bridges. Telegram → Matrix also works correctly.
Reproduction
- Take a portrait photo on a phone.
- Send it from FluffyChat to a room bridged to Telegram.
- The image arrives on Telegram rotated 90° counterclockwise.
The problem occurs when sending with compression, without compression, and as a file. A screenshot is transferred with the correct orientation.
Image details
- Uncompressed camera JPEG: physical pixel size
4000×1848, EXIF Orientation 6.
- Its Matrix event reports
w: 1848 and h: 4000.
- FluffyChat-compressed JPEG: physical pixel size
1440×3120, EXIF Orientation 0.
- Screenshots are oriented correctly.
The Matrix → Telegram upload path decodes images with Go's image.Decode and re-encodes them as JPEG. image.Decode does not apply EXIF orientation. The issue is still present on main at commit 83554ac2.
Environment
- Bridge:
mautrix-telegram v26.08
- Build date:
Sun, 16 Aug 2026 13:22:10 UTC
- Docker image:
dock.mau.dev/mautrix/telegram:latest
- No relevant image/media errors are logged while sending.
Checklist
Matrix → Telegram images rotated 90° counterclockwise
JPEG images sent from Matrix to Telegram are rotated 90° counterclockwise. The same Matrix media is handled correctly by the mautrix-whatsapp and mautrix-signal bridges. Telegram → Matrix also works correctly.
Reproduction
The problem occurs when sending with compression, without compression, and as a file. A screenshot is transferred with the correct orientation.
Image details
4000×1848, EXIF Orientation6.w: 1848andh: 4000.1440×3120, EXIF Orientation0.The Matrix → Telegram upload path decodes images with Go's
image.Decodeand re-encodes them as JPEG.image.Decodedoes not apply EXIF orientation. The issue is still present on main at commit83554ac2.Environment
mautrix-telegram v26.08Sun, 16 Aug 2026 13:22:10 UTCdock.mau.dev/mautrix/telegram:latestChecklist