glitch-soc / mastodon

A glitchy but lovable microblogging server
https://glitch-soc.github.io/docs/
GNU Affero General Public License v3.0
690 stars 184 forks source link

Image uploading re-scaling is inconsistent! #2458

Open eobet opened 11 months ago

eobet commented 11 months ago

Steps to reproduce the problem

  1. Upload an image 3400 x 2300 pixels large (close to but below the 8MP limit)

Expected behaviour

Image should appear as it was uploaded (recompression begrudgingly ok)!

Actual behaviour

Image is scaled down to 1751 x 1184 pixels (close to 2MP)...

Detailed description

Please see the originally reported issue here:

https://github.com/mastodon/mastodon/issues/27612

Mastodon instance

oldbytes.space

Mastodon version

4.2

Browser name and version

Firefox 119

Operating system

Windows 10

Technical details

Issue does not appear on vanilla Mastodon. Contacted admin who updated to 4.2 already but now also updated glitch-soc. Issue unfortunately persists.

Plastikmensch commented 11 months ago

This looks to me that it has been resized client-side. Upstream removed client-side resizing of images, but glitch-soc kept it for now. The limit wasn't updated though, so the old 2MP limit applies when uploading media in the web interface. There is a PR fixing that: #2304

eobet commented 11 months ago

Ah, just to clarify the root cause here... so when you upload something above 8MP you get the server side resizing which then is updated for 8MP despite glitch-soc being used? Is that why I'm only seeing images getting crunched down to 2MP when an image within the client side resizing size range kicks in?

Plastikmensch commented 11 months ago

Ah, just to clarify the root cause here... so when you upload something above 8MP you get the server side resizing which then is updated for 8MP despite glitch-soc being used? Is that why I'm only seeing images getting crunched down to 2MP when an image within the client side resizing size range kicks in?

It depends on the client. Uploading an 3400x2300 image via the web interface resizes to 2MP (1751x1184). When using a third-party client, it would stay somewhat close to 8MP (I don't know what calculation is used by the backend, but it's the same as upstream) With the mentioned PR, it should be passed to the backend without being resized client-side, if I'm reading the code right.

eobet commented 7 months ago

This bug is still present even in v4.3.0-alpha.3+glitch! Just tested uploading a 1440p image via web and it got scaled down to 1080p. 🙁