fix: missing poster image bailing on thumbnails - #3754
Merged
isekovanic merged 3 commits intoAug 5, 2026
Conversation
Contributor
SDK Size
|
oliverlaz
approved these changes
Aug 5, 2026
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.
🎯 Goal
For some reason, it would appear that video attachments picked from the photo library show no thumbnail when
PhotoKithad no cached poster frame for the asset, so the image request fails withPHPhotosErrorDomain 3303and generation bails. Hits uncached/freshly imported library videos on devic, and always hits videos added to a Simulator viasimctl addmediaas an example (which won't immediately generate poster images unless you open thePhotosapp for example).🛠 Implementation details
iOS
StreamVideoThumbnailGenerator:PhotoKitrequest from.fastFormatto.highQualityFormat..fastFormatonly returns an already cached rendition and won't generate one on demand (contrary to my previous belief), so uncached assets come back empty..highQualityFormatrenders the poster on demand at the requestedtargetSize, so still only the poster frame and not the whole videomaxDimensionfrom512to256..highQualityFormathonorstargetSize(unlike.fastFormat, which ignores it and always returns a fixed~120pxfrom my tests), so256pxis crisp at the picker cell for ~1/4 the decoded RAM. Android intentionally stays at 512 as itsgetScaledFrameAtTimescaler is cruder and needs more source pixels (documented in a code comment)Reducing the size of the generated tuhmbnails is considered safe as this was anyway happening with
.fastFormat(as mentioned it appears to simply return smaller images rather than play around with downscaling specifically). If anything, it's an increase in quality as from my benchmarks it showed that loading ~200 video thumbnails all at the same time (this is a very pessimistic test of course) rounds out to about ~20MB of extra ram usage. And this is even before taking image optimizations into account, which would alleviate decoding cycles as well. So the quality should be much better while paying almost nothing. So in essence we're basically trying to mimic what.fastFormatdoes itself but with some extra exploration around it.🎨 UI Changes
iOS
Android
No Android changes.
🧪 Testing
☑️ Checklist
developbranch