Open FirraWoof opened 1 year ago
Thoughts: I know vx (prob FX too) twitter uses c.vxtwitter to put all the images on one tweet into one image for e.g. comics. Subdomains on xfuraffinity? Also gotta pop in an issue too... Meow
@shelbyKiraM Interesting! Do you know why they do it this way? I would have probably gone for the naive approach which would be to just use imagemagick to stitch the images together whenever that makes sense (i.e. rendering a preview for a gallery), but I'm definitely open to doing something else if there's a benefit!
There's this issue but no commits referred so I'm not sure what they're using: https://github.com/dylanpdx/BetterTwitFix/issues/3
Nevermind, looks like they're using PIL, Python's Image Library: https://github.com/dylanpdx/BetterTwitFix/blob/main/combineImg/__init__.py
Imagemagick: is π
Is something wrong with it? π
The main reason I'd use it is that it's installed by default in the google cloud runtime environment, so it's pretty convenient!
Hehe no IMagick may be a little heavy on CPU for a little bit, but it should be fine. My worry is how long you may need to store the combo of the images for. π€·πΌββοΈ However, I believe (except when someone attempts to refresh the link with @WebsiteBot in Telegram), it should only need to be a temp file (datastream? That sounds cooler hehe). I know Discord re-hosts files themselves, too. IMagick & temp in memory should be good! ππΌπΈ
What
When a user uses xfuraffinity to link to a user's gallery, we should show the first couple images (NSFW or SFW) in the preview. Discord supports multiple images in an embed (most likely through oembeds), but Telegram doesn't look like it does.
Potential issues
Telegram doesn't seem to support embedding multiple images in a convenient way (and doesn't look like it supports oembeds). To solve that issue, we could use imagemagick which is bundled in cloud functions to stitch togetehr the first couple images artificially.
Starting points
Examples