mattermost / desktop

Mattermost Desktop application for Windows, Mac and Linux
Apache License 2.0
2.03k stars 829 forks source link

[MM-60232] Fix a crash in Linux when trying to create a thumbnail from an image #3147

Closed devinbinnie closed 2 months ago

devinbinnie commented 2 months ago

Summary

When we made the fix to disallow the file: protocol, we started using createThumbnailFromPath to process images. Unfortunately, this function is simply not defined on Linux, causing a crash.

This PR falls back to using the createFromPath function for Linux only, which creates a full version of the image. I've capped the image size to use at 1MB so that we don't inflate the memory usage of the downloads dropdown too much.

Ticket Link

https://mattermost.atlassian.net/browse/MM-60232 Closes #3129

Fix a crash in Linux when trying to create a thumbnail from an image
devinbinnie commented 2 months ago

/cherry-pick release-5.9

mattermost-build commented 2 months ago

Cherry pick is scheduled.

licaon-kter commented 1 month ago

what's the timeline for this? Can't save images at all

M-ZubairAhmed commented 1 month ago

@licaon-kter its included in v5.9

licaon-kter commented 1 month ago

@M-ZubairAhmed "merged 2 weeks ago", 5.9 was released "6 weeks ago", not sure I follow :smile:

time travel aside, I'm seeing this on 5.9 hence my question

devinbinnie commented 1 month ago

@licaon-kter It will go out in the next dot release of v5.9, as well as v5.10 which is scheduled for November 16th.