schemas/account,account_view: add akkoma.media.*_preview #1071
No reviewers
Labels
No labels
approved, awaiting change
broken setup
bug
cannot reproduce
configuration
documentation
duplicate
enhancement
extremely low priority
feature request
Fix it yourself
help wanted
invalid
mastodon_api
needs change/feedback
needs docs
needs tests
not a bug
not our bug
planned
pleroma_api
privacy
question
static_fe
triage
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
AkkomaGang/akkoma!1071
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "Yonle/akkoma:profmedprev-1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
as discussed on AkkomaGang/akkoma-fe#481 (comment) for #1066
One nit regarding the schema and you’ll also need to add the new fields to docs ("Differences from Masto API") and explain there how the fields differ from the plain and
_staticversions.As discussed in the other issue, you’ll probably want to generate smaller images (in terms of dimensions and transfer size) for avatar previews than for regular image attachment thumbnails (and iinm the proxy cannot encode parameters into the (signed) path, meaning a new endpoint or the ability to encode params would be needed).
Though I guess the default of max 600px in any direction is already enough to curb the worst offenders?
Generally we don’t accept backend features without any client users. But you already have a FE PR to make use of it, so if both end up good enough for merge this shouldn’t become an issue.
@ -127,0 +131,4 @@avatar_preview: %Schema{type: :string, format: :uri},header_preview: %Schema{type: :string, format: :uri}}}I don’t think a
mediasubobject inside theakkomasubobject is necessary. You can just put it directly intoakkoma@Oneric wrote in #1071 (comment):
it will be up to the mediaproxy to do that.
i would say the default size of a thumbnailed ones are already perfect.
however, before we even begin with this, there's actually a major problem on the thumbnailer itself where it can't convert animated avatar/banner to a compressed format. I have a custom mediaproxy which did exactly that, however this thing make me stuck for quite a while.
The proxy currently has no idea though whether the preview URL is for an avatar or a full attachment thumbnail atm, as described in prev post. And without knowing it can’t take care of it
If you’re thinking of query url parameters, they are not signed as far as I understand and thus susceptible to being replaced with much larger dimensions by anyone
Can you clarify whether this is just an "it does not avoid as much network traffic as it could" issue, or does it make enablng previews somehow worse than no previews at all? If it’s the former, exacerbating the issue with more preview links seems indeed unfortunately ill-advised. But if it’s the latter this shouldn’t be a blocker for merging this (and you just need to adjust the schema as per previous review comments)
Either way you’re ofc welcome to improve the built-in proxy (though then someone more familiar with its everyday workings would need to pick up reviewing), but if you already have an out-of-tree solution which works for you you presumably don’t want to spend time on something without return.
@Oneric wrote in #1071 (comment):
at this current condition, it's not really worse, but did not really solve the main issue, which you can check from the following, that it's redirecting and did only proxying:
content_type == "image/gif" ->redirect(conn, external: media_proxy_url)@Oneric wrote in #1071 (comment):
it's kinda rough as elixir itself is not my main programming language (my main lang is go), but probably making a separate issue on fixing the media proxy might also work? not really sure at this point or probably keeping the current flow only on my end
Thanks for clarifying. Then it’s no blocker for adding avatar and header previews and can be left for some future issue or patch
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.