lemmy
lemmy copied to clipboard
Include thumbnail width and height on Post
Requirements
- [X] Is this a feature request? For questions or discussions use https://lemmy.ml/c/lemmy_support
- [X] Did you check to see if this issue already exists?
- [X] Is this only a feature request? Do not put multiple feature requests in one issue.
- [X] Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.
Is your proposal related to a problem?
While creating an UI for Lemmy, it would be really helpful to know the height and width of thumbnail before downloading them. This will allow to preallocate the correct space in the layout, without missing frames or jittering.
I thing this information could be easily included in the API, as I assume the thumbnail size is known by the server.
Describe the solution you'd like.
Include thumbnail size on the Post entity.
Describe alternatives you've considered.
Downloading the image without knowing the size in advance. However that causes the UI elements to change in size after the download, and that's very juggering.
Additional context
No response
or just a ratio of height and width in image URL or as separate field as width and height in the api will be great.
@subashz An aspect ratio field is redundant, because it can be calculated from width and height. The server giving us the dimensions should be enough.
Did we got height and width for images in API now??????
It would be possible to do this for the thumbnail_url
, but not the post.url, which is not necessarily an image.
Yeah. It would be great.
On Mon, Oct 23, 2023, 17:19 Dessalines @.***> wrote:
It would be possible to do this for the thumbnail_url, but not the post.url, which is not necessarily an image.
— Reply to this email directly, view it on GitHub https://github.com/LemmyNet/lemmy/issues/3328#issuecomment-1776038538, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADAYFKAHA5FAONJQGUTTKXLYA3NONAVCNFSM6AAAAAAZSS2DWSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZWGAZTQNJTHA . You are receiving this because you were mentioned.Message ID: @.***>
Please do it it would help mobile clients to build views easily
It would be possible to do this for the
thumbnail_url
, but not the post.url, which is not necessarily an image.
can it be done?? or required help from outside?
Ya we could def use some help, as we're busy with other things like the release. Pictrs has a details endpoint that you could use for that info.
Also, if you're an app dev, these are already pictrs images, meaning you can do any cropping / transforms you like on them, so you can choose your own height and width.
A later commit undid this, but there's still an open PR for it.