Skip to content

Change image matrix size limit from 1920×1080px to 4096×4096px #23322

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

Closed

Conversation

ClearlyClaire
Copy link
Contributor

@ClearlyClaire ClearlyClaire commented Jan 30, 2023

Mastodon currently uses ImageMagick on every user-uploaded picture, accepting images up to 4096×4096px and resizing them to 1920×1080px or less if needed.

This change would have the following effects:

  • Storage cost: increased for uploads above 1920×1080px, but still limited to 10MB per picture
  • RAM usage: kept about the same, as the already-high cost (~300MB of RAM for processing a single picture) of processing 4096×4096px input images with ImageMagick does not increase with the size of the output image (as long as it's 4096×4096 or below)
  • CPU usage: actually lowered for pictures above the 1920×1080px matrix size limit since ImageMagick does not have to do expensive resizing work anymore
  • User ability to upload larger-sized images: this change does not allow going above the 4096×4096px limit but keeps anything below that to its intended size

@ClearlyClaire
Copy link
Contributor Author

This PR was made while investigating a request to update the limit to allow 7680x4320px pictures. Such a change would make ImageMagick's consumption up to 485MB per picture at maximum size (from the already-high current value 300MB). I don't think that's reasonable, but we could consider it in the future if we move away from ImageMagick to something more tractable.

@supernovae
Copy link

I'd like to see larger image sizes supported. The memory consumption isn't an issue for me.

Honestly, I'd also like larger video file size too. I think it would be great to target videos of 60 seconds or less and natively support image sizes of modern phones.

@ClearlyClaire
Copy link
Contributor Author

The memory consumption isn't an issue for me.

It may be for a lot of admins, though.

@supernovae
Copy link

supernovae commented Feb 1, 2023

The memory consumption isn't an issue for me.

It may be for a lot of admins, though.

I don't disagree. I wish we had data.

I have users quitting because the UX around uploading photos isn't that great and mobile phone native images sizes are growing faster than we seem to want to support. ivory goes a long way here in mobile UX and handling iOS images according to mastodon dimensions, but i don't think that's a better solution than increasing ram requirements by a tiny amount.

Costs me more time/money in responding to the issues than just paying for more resources and supporting modern image sizes.

@supernovae
Copy link

I'd be happy to run with this patch and report back on any numbers/graphs that may be helpful

@github-actions
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@mjankowski
Copy link
Contributor

I believe this accomplished a variation on this idea - 9bda933 - closing this one because the JS file doesn't exist anymore, but we should rebase/reopen if we want to track the even higher size bump still?

@mjankowski mjankowski closed this Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants