Repository navigation
Let Instagram Reels and YouTube Shorts take a custom cover image - #505
Merged
Merged
Conversation
added 12 commits
November 16, 2026 20:29
A video's cover can now be an image (media.*.meta.cover): one the user uploads, or a screenshot of the frame picked in the Thumbnail tab. The image is a medias row owned by the post, synced by SyncOwnedMedia like thread reply media, and accepted from the web, the REST API and MCP. Instagram gets it as cover_url on the Reel container (re-encoded as a JPEG when it is not one or is over 8 MB). YouTube gets it through thumbnails.set once the video is processed (SetYouTubeCover); a refused cover keeps the post published and shows a warning on its card, kept in error_context.
…Instagram The Thumbnail tab shows the video's frames under the stage with a selector that holds the picked frame; the right panel keeps the Video frame / Image switch and the upload, and an uploaded cover takes the stage.
…review until it plays VideoStill draws a video as its cover (the uploaded image, else the picked frame) on the composer tile and on every post card; the preview keeps the cover over the video until it is first played.
The cover image goes through the same stage, crop panel and render as any image: the stage edits the cover's own crop (locked to 9:16, movable and resizable like a profile photo's square) while the Thumbnail tab shows it, and a reframed or new cover is rendered at apply.
…, name YouTube's warning - Store where a cover comes from (meta.cover_source); picking an image keeps the frame time, and a post on a frame-only network drops the image on save. - Rename the warning to App\Enums\YouTube\ThumbnailWarning; add the ProcessingStatus enum; warn when YouTube cannot process the video and when the token is revoked instead of retrying. - Drop covers sent on thread reply media; fall back to the frame when a Reel cover cannot be made a JPEG. - Laravel helpers over native calls, one covers() helper, one download-process-host flow, named template conditions, strip frames drawn at the strip's size, blob URLs revoked. - Copy: the hint describes the frame strip, Turkish in the file's formal voice, one German word for the cover, the unused alt key removed.
- An Instagram Reel whose cover is a frame publishes it as thumb_offset; only YouTube, which takes no frame time, gets the frame's screenshot, so Reels need no capture (and no CORS) and a new frame time is never beaten by an old screenshot. - A post on a frame-only network drops cover_source with the cover, and its Thumbnail tab always shows the frame strip. - One JPEG conversion (FitsImageToCanvas::jpegFrom) for Instagram and YouTube, checking the result is a JPEG within the network's size; a cover YouTube cannot get as a JPEG warns at once. - A cover row shares its video's order instead of taking one of its own. - The picked file's blob URL survives a failed Apply; detached videos are released after use. - CoverSource and CoverImage live in types/media.ts. - Clearer Russian, Ukrainian, Greek and French cover buttons.
- Previews of a network that takes no cover image show the frame, never an image uploaded for another network. - A frame picked before YouTube was added gets its screenshot on Apply. - SetYouTubeCover warns when the channel is no longer connected and stays quiet on a 404 (the video was removed); the card's failure is built from the context again, ignoring only the YouTube warning. - YouTube reuses the trait's download (no image buffered in memory); the trait is renamed HostsProcessedImages, since it now converts as well. - Template decisions moved to computeds (stage box class, picked time).
…f the post takes one
10 tasks
added 9 commits
November 17, 2026 09:15
… reason in a popover
…ordering keeps the media order
… run in CI" This reverts commit 74ca309.
…rts the video frame lib
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A Reel or a Short can now take an image as its cover, either one the user uploads or a frame of the video, picked like in the Instagram app. Requested in https://github.com/orgs/trypostit/discussions/504.
Composer: the media editor's Thumbnail tab
VideoStilldraws the cover on every post card (list, board, calendar, details).Storage
media.*.meta.coverholds the image as a whole media item: amediasrow owned by the post (or idea), synced bySyncOwnedMedialike thread reply media. A temporary upload is adopted and another post's row is copied. Removing the cover deletes its row, duplicating the post copies it, and deleting the post deletes it. The cover row shares its video'sorder.media.*.meta.cover_source(App\Enums\Media\CoverSource:frameorimage) says where the cover comes from. Picking an image keepscover_offset_ms, so a network that only takes a frame still has one.meta.coverandcover_sourceon save, asPostMeta::forChannel()drops a poll. Its previews never show an image uploaded for another network either (PlatformPreview).AuditMediacounts covers as referenced.API and MCP
media[].meta.covertakes{upload_token},{url}or{id}like a media item, andmedia[].meta.cover_sourcetakesframeorimage(imagewhen a cover is sent without it). This works on create and update.list-content-types-tooladdssupports_custom_video_cover. The tool descriptions explain both fields.Publishing
cover_url, which Instagram prefers overthumb_offset. It is re-encoded first when it is not a JPEG of up to 8 MB (HostsProcessedImages::hostAsJpeg). A frame goes asthumb_offset, which Instagram shows exactly. An image that cannot be made a JPEG falls back to the frame instead of failing the Reel. Docsthumbnails.setneeds a processed video, soSetYouTubeCover(queued a minute after publishing) checksprocessingDetails(App\Enums\YouTube\ProcessingStatus) every minute for up to 30 minutes, then uploads the cover. JPEG and PNG go as they are; anything else is re-encoded. It uses theyoutube.uploadscope we already have and costs 50 quota units. DocsApp\Enums\YouTube\ThumbnailWarning: channel not verified, daily limit, invalid image, failed) is kept inposts.error_context.youtube_thumbnail_warning, and the post card shows it with a pointer to YouTube Studio. No new column.failedwarning at once.FitsImageToCanvasis renamedHostsProcessedImages: it also converts images to JPEG now, through onejpegFrom()that checks the result is a JPEG within the network's size.Copy
All 17 locales: the Thumbnail hint (the frame strip), the Video frame / Image switch, the upload and replace buttons, the 9:16 hint, the capture error, the two validation errors and the four YouTube warnings.
Storage CORS
The YouTube frame screenshot reads the video with CORS.
cdn.trypost.italready answersGETwithAccess-Control-Allow-Origin: *, so it works on Cloud (checked in the manual run below). A self-hosted bucket needs the same rule, or picking a frame for a YouTube Short fails on Apply; Reels (frame time) and uploaded images work either way.Automated tests (all passing)
tests/Feature/Media/VideoCoverImageTest.php: web, REST API and MCP; adopt, keep, remove and copy; video and GIF refused; duplicate and delete; media audit; frame-only network drops the cover and its source;cover_sourcevalidation; thread reply covers dropped; idea keeps its cover; Reel to Feed drops it; cover ordertests/Feature/Jobs/SetYouTubeCoverTest.php: processed, still processing, 403 / 429 / 400 warnings, 404 quiet, 5xx retried, out of tries, failed and terminated processing, video gone, revoked token, channel not connected, WebP converted, unreadable image, card shapetests/Feature/Jobs/PublishToSocialPlatformTest.php: the job is queued only for a YouTube video with a covertests/Feature/Services/Social/InstagramPublisherTest.php:cover_urlfor an uploaded image,thumb_offsetfor a frame, re-encoding a PNG and a JPEG over 8 MB, fallback to the frame, a feed video keepsthumb_offsettests/Feature/Resources/PostCardResourceTest.php: the warning, and the failure kept for a context without a categorytests/Browser/MediaEditorTest.php: frame strip, upload and 9:16 crop, reframing a stored cover, switching between frame and image, a frame screenshot for YouTube only, a frame picked before YouTube was added, the tile and preview cover, TikTok preview, single-item rowLocalizationParityTest,SingleLineCopyTest(17 locales)Manual test plan
Media editor: Thumbnail tab
Image cover
Frame cover
Shared video (one video on several channels)
Composer flows
Regressions in the shared media editor
Composer and cards
Publishing (real accounts)
API and MCP
PUT /posts/{id}withmedia[0].meta.cover: {upload_token}on a Reel: saved; on a TikTok post: dropped,cover_offset_mskeptupdate-post-toolwithmeta.cover: {id}of another post's image: copied to this postlist-content-types-toolshowssupports_custom_video_cover: trueforinstagram_reelandyoutube_shortonlyLanguages