Solution
As was pointed out by @[email protected] [1], this feature was added in this pull request. It appears that the custom thumbnail field is only relevant for posts that share a URL: The “Thumbnail URL” field is used to specify a custom thumbnail to be used in place of what would’ve been automatically generated by the provided URL [2].
Original Post
I thought it would be for adding a custom thumbnail that appears for the post in the feed, but then that seems to be a duplicate of adding an image. At any rate, I tried adding an image link to it, and no image showed up for the post. So I’m not entirely sure what it’s actually for.
EDIT (2024-11-30T22:22): Perhaps it’s for the pre-expanded thumbnail for a post if it has an image? Does that mean that it only works if you have an image specified? Can it be used to override the thumbnail that’s generated from a shared article? Does it work for a text post?
References
- @[email protected] [To: “When creating a post, how does the “Thumbnail URL” option work exactly?”. “Kalcifer” (@[email protected]). sh.itjust.works. Published: 2024-11-30T22:24:10Z. Accessed: 2024-12-02T07:06Z. https://sh.itjust.works/post/28843300]. Feddit.org. Published: 2024-12-01T23:37:14Z. https://feddit.org/comment/3413077.
- “crates/api_crud/src/post/create.rs”. LemmyNet/Lemmy. GitHub. Published: 2024-12-01T01:14:07.000Z. Commit: 5085d1c. Accessed: 2024-12-02T06:40Z. https://github.com/LemmyNet/lemmy/blob/e49d346535f0769b85ad0fa4b0baabfbdba0deff/crates/api_crud/src/post/create.rs.
- L91-L99
// Only generate the thumbnail if there's no custom thumbnail provided, // otherwise it will save it in pictrs let generate_thumbnail = custom_thumbnail.is_none(); // Fetch post links and pictrs cached image let metadata = fetch_link_metadata_opt(url.as_ref(), generate_thumbnail, &context).await; let url = proxy_image_link_opt_apub(url, &context).await?; let thumbnail_url = proxy_image_link_opt_apub(custom_thumbnail, &context) .await? .map(Into::into) .or(metadata.thumbnail);
- L93: A check is done for whether a custom thumbnail URL was provided.
- L96: If it wasn’t, then one will be generated from the shared URL.
- L98: If a custom thumbnail URL was provided, it will be fetched from pictrs.
- L99: If a custom thumbnail was not provided, fallback to the generated thumbnail.
- L91-L99
If the URL being posted is anything other than an image, yes. If the URL being posted is a video, an article, an MP3, whatever. If you don’t want to leave it up to Lemmy to try to grab a thumbnail do display for the post, you have the option to expicitly specify the thumbnail image to be used.
On the other hand, if the URL that you are posting is itself an image (JPEG, PNG, GIF, WEBP, whatever), you might notice that the “Thumbnail URL” field disappears. Because Lemmy will use the image you are posting as the thumbnail.
Out of curiosity, for reference, could you cite official documentation and/or source code for where that functionality is defined?
I do not see any documentation, but here is the pull request for the creature that was added in v0.19.4
https://github.com/LemmyNet/lemmy/pull/4425