Skip to content

Fix GIF previews bypassing the preview policy - #892

Merged
kean merged 1 commit into
mainfrom
fix/gif-preview-policy
Aug 15, 2026
Merged

kean merged 1 commit into
mainfrom
fix/gif-preview-policy

Conversation

@kean

@kean kean commented Aug 15, 2026

Copy link
Copy Markdown
Owner

The GIF branch in decodePartiallyDownloadedData ran before the previewPolicy switch, so a delegate returning .disabled — documented as "No previews are generated for partially downloaded data" — still got a full UIImage(data:) decode and an emitted preview for every partially downloaded GIF.

.disabled is now checked first and applies to GIFs too. .incremental and .thumbnail keep the existing behaviour: GIFs can't be decoded incrementally, so a single preview is generated from whatever has been downloaded so far. The default policy for GIF data is .incremental, so nothing changes unless a delegate opts out.

The GIF branch in `decodePartiallyDownloadedData` ran before the
`previewPolicy` switch, so a delegate returning `.disabled` still got a
full decode and an emitted preview for every partially downloaded GIF,
contradicting the documented "no previews are generated for partially
downloaded data".

`.disabled` is now checked first and covers GIFs. The other policies keep
the existing one-shot GIF preview, since GIFs can't be decoded
incrementally.
@kean kean added this to the 14.0 milestone Aug 15, 2026
@kean
kean merged commit addbb60 into main Aug 15, 2026
5 checks passed
@kean kean modified the milestones: 14.0, 13.2.0 Aug 15, 2026
@kean
kean deleted the fix/gif-preview-policy branch August 16, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant