Mattermost Peer-to-Peer Forum

File Above Maximum Dimensions Couldn't Be Uploaded


#1

Summary

When trying to upload a photo from the 4.0.0 desktop app, the photo won’t upload (and can’t be canceled by clicking X).

Steps to reproduce

Mattermost Server Version 4.8 Enterprise (no license key), Desktop Version 4.0.0, Nginx, Debian, Postgresql, Amazon S3 Storage

File Cap has been set to >50 MB (although on a related note, files above 50 MB will also be endlessly stuck uploading). Smaller files work, but not this image.

Expected behavior

that the upload works. We’ve checked our connection and it’s not that. Alternatively - where can we adjust the accepted picture dimensions?

Observed behavior

Error log shows this each time we try to upload the image file:

[2018/03/28 09:45:06 +07] [EROR] /api/v4/files:uploadFile code=400 rid=ncz55we7a7fxur5h4b9mddthjr uid=13mdb5adffghxka35pyy51ntbe ip=XXX.XXX.XXX.XXX File above maximum dimensions could not be uploaded: name-of-image.jpg [details: ]


#2

Hi @Ju_St,

Apologies for late reply - we have a doc on adjusting maximum file size via System Console: https://docs.mattermost.com/administration/config-settings.html?highlight=config%20settings#maximum-file-size.

Let me know if this helps?


#3

Hello Amy, thanks for your reply. We’ve tried to adjust the maximum file size, which didn’t fix the problem. This seems to be a recent problem, as we were able to upload larger files in the past. Could this be related to this issue?


#4

Hi @Ju_St,

I checked with one of our engineers about this and they mentioned that currently our maximum image dimensions is 6048 x 4032 - would you be able to find out the dimensions of the image that you are trying to upload? If it exceeds 6048 x 4032, I can file a ticket for our engineers to investigate relaxing that limit. If it is smaller than that it might be a bug and I’ll help file a bug ticket instead.


#5

Hello Amy, the photo was above the maximum image dimensions (it was 8700x11600 pixels).


#6

Thank you! I’ve opened a ticket here for our engineers to investigate: https://mattermost.atlassian.net/browse/MM-10166.


#7

This arbitrary image dimension restriction is still in place, there’s no way to change it that I can see, and it’s kind of frustrating when you want to upload a large image.

For example, my desktop has dimensions of 11520×2160 so I can’t even share a screenshot of my full desktop in mattermost … :frowning:

Any news on making this configurable at least?


#8

Hi @codinghorror,

I forwarded your feedback to our team and it sounds like there have been some changes made recently that might be able to support larger max image dimensions. The Jira ticket referenced above has been re-opened and re-triaged for further discussion.

Earlier there were security concerns that we would have to load the image into memory to generate a thumbnail/preview, and large images take up a lot of memory. It’s also possible to make an image that’s small as a file, but when we read it into memory, it has massive dimensions which is why those max dimensions were added in the first place. For example, the sample file I had been using that then was a 5MB PNG file that would take up 116GB of memory when fully read into memory.

We need some max dimensions, but we could certainly look at increasing them. One of our developers did a bunch of work recently on improving the memory usage of file uploads, so he might have a better idea of how large we should be able to go. The current max dimensions support an image that takes 36MB when read into memory, so that’s already quite large.

The dev who is working on relaxing the file size constraints for non-image files has a separate ticket open here: https://mattermost.atlassian.net/browse/MM-10188.

Images currently require to be decoded for 2 use cases:

  1. To generate preview and thumbnail images
  2. We fully decode GIFs to detect if they are animated, and to display the original animation rather than a static preview when displayed in the channel.