Skip to content

telegram bridge image rotation bug #1094

Description

@Pitbully01

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

  1. Take a portrait photo on a phone.
  2. Send it from FluffyChat to a room bridged to Telegram.
  3. 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

  • This is an actual bug, not just a setup issue (see the troubleshooting docs or ask in the Matrix room for setup help).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions