Skip to content

deal with huge incoming image pixelsizes #6825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
r10s opened this issue Apr 29, 2025 · 0 comments
Open

deal with huge incoming image pixelsizes #6825

r10s opened this issue Apr 29, 2025 · 0 comments
Labels
bug Something is not working good first issue Good for newcomers

Comments

@r10s
Copy link
Contributor

r10s commented Apr 29, 2025

it may happen, that an incoming image is huge in pixelsize (not necessary in bytesize).

eg. recently a 20000 x 10000 pixel image was sent accidentally to a community chat. for comparison: this image has 200+ times more pixels than an image usually sent with deltachat

depending on the used operating system, such huge images may need more than 1 gigabyte of ram to be displayed, this takes a looooong time, if it succeeds at all - the app may just crash because of exhaustive memory usage.

possible fixes:

  1. there are ways to process images with less memory, eg. https://github.com/libvips/libvips - but that is a huge C dependency, with many sub-dependencies. that will introduce other issues. also, we're talking about a cornercase here.

  2. peek at the image size, and mark incoming messages with huge images as "file", and not as "image". the user can still "save as" the file or open it with an external viewer

i think, 1 is not reasonable, while 2. seems to be an easy fix.

in general, we should consider to not create "image messages" in case we cannot find out the image size (eg. for exotic formats the system may try to display - that may result in the same issue, incl crashes)

moreover, it'd be fine to not allow send such huge images, but that can be another issue then

cmp. https://support.delta.chat/t/image-optimization/3749 and "DC Community" chat

@r10s r10s added bug Something is not working good first issue Good for newcomers labels Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant