Skip to content

treat images sent as files as such #8167

@r10s

Description

@r10s

when an image is sent as a Viewtype::File, it is sent and received as Viewtype::Image, for historical reasons 1.

this has the disadvantage that the user is not aware of the impact - as increased size, transmitted filename. showing as file also make more clear that the file is really an original file, so may include other data.

for these reasons, other messengers, as telegram, show images sent as files as files.

for outgoing files, the conversion is removed at #8166

for incoming files, we need some flag on the wire. to stay compatible with existing versions, so that not suddenly all images are rendered as files.

the Content-Disposition: header comes into mind for that flag

current headers for (A) images sent as image:

Content-Type: image/jpeg
Content-Disposition: attachment; filename="image_2026-04-24_21-11-19.jpg"
Content-Transfer-Encoding: base64

for (B) image sent as file:

Content-Type: image/jpeg
Content-Disposition: attachment; filename="IMG_1681.jpeg"
Content-Transfer-Encoding: base64

idea is to sent (A) as Content-Disposition: inline (inline does not need a filename).

on the receiving side, images will be rendered as images if set to inline or the filename starts with image_ - the latter can be removed some versions later and is needed to not suddenly render all images as files

Footnotes

  1. history: the auto-conversion comes from a time where we had few options in UI to distinguish. meanwhile, on all platforms the user can select between

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions