Giphy Support on Reddit #10

Closed
opened 2026-08-30 18:15:18 +00:00 by thatguygriff · 1 comment
Owner

Reddit comments that include a giphy gif embed as a markdown link, but not a proper href.

![gif](giphy|zUW23b6FmzB5e)

Reddit comments that include a giphy gif embed as a markdown link, but not a proper href. `![gif](giphy|zUW23b6FmzB5e)`
Author
Owner

Fixed on giphy-tokens-and-video-posters.

A giphy token now resolves without media_metadata to look it up in — Reddit ships plenty of comments carrying one and no metadata at all, including the zUW23b6FmzB5e in this issue, and with nothing to look it up in the token itself was what the comment showed. Giphy is the one of the three token kinds whose id means something off Reddit, so that one falls back to i.giphy.com/media/<id>/giphy.gif. Emote and upload ids still resolve only through the metadata.

The video sizing was two things. The renderer put only aspect-ratio on the <video>, and a video with no data has a natural size of 300x150 that WebKit sizes from in preference to the ratio — so a portrait video kept a squat landscape box until playback supplied real dimensions. Chromium stretch-fits and gets it right, which is why it only showed on Safari. A video's size before its data arrives is its poster's, so one with no poster now gets an empty SVG of the right shape as a stand-in.

And Reddit's videos with sound had no poster to be sized by at all: fromRedditVideo attached the still from preview.images to the MP4 branch only, so every post with sound showed an empty box where a silent one showed a frame. It goes on both forms now.

Checked against https://www.reddit.com/r/LoveTrash/comments/1vxkehp/growing_your_account — 31 comment gifs, none broken, and the video's own still in place and correctly sized in WebKit.

Fixed on `giphy-tokens-and-video-posters`. A giphy token now resolves without `media_metadata` to look it up in — Reddit ships plenty of comments carrying one and no metadata at all, including the `zUW23b6FmzB5e` in this issue, and with nothing to look it up in the token itself was what the comment showed. Giphy is the one of the three token kinds whose id means something off Reddit, so that one falls back to `i.giphy.com/media/<id>/giphy.gif`. Emote and upload ids still resolve only through the metadata. The video sizing was two things. The renderer put only `aspect-ratio` on the `<video>`, and a video with no data has a natural size of 300x150 that WebKit sizes from in preference to the ratio — so a portrait video kept a squat landscape box until playback supplied real dimensions. Chromium stretch-fits and gets it right, which is why it only showed on Safari. A video's size before its data arrives is its poster's, so one with no poster now gets an empty SVG of the right shape as a stand-in. And Reddit's videos with sound had no poster to be sized by at all: `fromRedditVideo` attached the still from `preview.images` to the MP4 branch only, so every post with sound showed an empty box where a silent one showed a frame. It goes on both forms now. Checked against https://www.reddit.com/r/LoveTrash/comments/1vxkehp/growing_your_account — 31 comment gifs, none broken, and the video's own still in place and correctly sized in WebKit.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Unsupervised/antisocial#10