I have several photos which I can’t seem to post. After poking around a bit, I found out that this server has an upload size limit of 5 MB.
Now, an upload size is perfectly reasonable. Storage is expensive, and Lemmy is primarily designed for link aggregation and discussion, not file hosting.
However, the way the system currently fails when it encounters a large file is not ideal, and varies depending on the app/UI.
At best, you get a cryptic error message like {"data":{"msg":"Exceeded maximum dimensions","files":null},"state":"success"}
, and at worst, your webpage/app stalls for an indefinite amount of time.
Obviously, it would be prudent for the Lemmy devs to improve the comprehensibility of the error messages, but if there were a way to automatically compress large images to below the size limit, that would eliminate the error messages in the first place.
I believe this instance uses Pict-rs to host images, is that correct?
I came across these discussion threads in the Lemmy and Pict-rs source code:
- Allow resize to be set in config to reduce max image size, pictrs does support this #2416
- Support pre-processing uploaded media #3
- support resizing to a maximum area #6
Would it be feasible to implement automatic image compression on this server? If it has already been implemented in pict-rs, might it just be a matter of passing an additional argument to pict-rs?
This feature would make things smoother for users, especially for new users who might not be aware of the upload size limit and just think “Lemmy doesn’t work, I guess I’ll go back to Reddit”.