this post was submitted on 28 Aug 2024
23 points (100.0% liked)

sh.itjust.works Main Community

7725 readers
2 users here now

Home of the sh.itjust.works instance.

Matrix

founded 1 year ago
MODERATORS
 

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:

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".

top 6 comments
sorted by: hot top controversial new old
[–] brbposting 8 points 2 months ago

Wondered why I’ve been uploading constantly for a year without errors… of course! Screenshots for days.

Sounds reasonable - would help folks uploading real quality stuff (photography).

[–] InEnduringGrowStrong 7 points 2 months ago (1 children)

Yea the error messages all around lemmy could be a lot better.
Sometimes it only times out and you don't know why.

Lemmy is currently expecting pict-rs 0.5.something which should already have the feature mentioned.
I know there's a few new tweaks already planned in lemmy, including allowing users to see a list of their own uploaded content, etc. I can't promise anything just yet but that would indeed be nice.

[–] threelonmusketeers 2 points 2 months ago (2 children)

Lemmy is currently expecting pict-rs 0.5.something which should already have the feature mentioned.

That's awesome! Any idea what the tentative timeline is, or links to where we can track the progress towards rollout?

[–] InEnduringGrowStrong 3 points 2 months ago* (last edited 2 months ago)

Wait, I meant... that version of pict-rs has that feature, which lemmy doesn't currently use.
I don't more if it's something that can be set globally for pict-rs, or if lemmy code needs to be modified to leverage that pict-rs feature.

[–] InEnduringGrowStrong 3 points 2 months ago* (last edited 2 months ago)

Weirdly enough, I can find a PICTRS__MEDIA__PREPROCESS_STEPS variable in pict-rs 0.4.0-beta.8 release notes, but not in pict-rs 0.5.4 readme that lemmy is currently using. I might to check this again after some sleep.

edit: going through the pict-rs source code, that variable is indeed there, just these aren't in the readme file.
I think TheDude was planning a test instance, this would need some testing first.

[–] threelonmusketeers 3 points 2 months ago

@[email protected] and @[email protected]

Tagging a couple admins for their thoughts. Is this feasible?