Repository navigation
fix(upscale): read an animated AVIF as a sequence - #1280
Merged
Merged
Conversation
Main reads an AVIF image sequence as "avis" so it keeps its frames (#1230). The upscaler (#1064) still read it as "avif", so every frame went through the GPU and came out as separate _p1, _p2 stills. It now picks the read format the way MagickImageConverter does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 does this change?
Since #1230 an AVIF image sequence is read as
avis(AvifSequence.SourceFormat), so its frames stay one animation. The upscaler from #1064 still read the file asavif.SelectFrames("avif", "avif")then returned every frame andKeepsAnimationwas false, so each frame went through upscayl-bin andImageEncoder.Writewrote them as separate_p1.avif,_p2.avif, … (AVIF → PNG did the same).UpscalerEngine.ReadFormatnow picks the read format the wayMagickImageConverterdoes:apngfor an animated PNG saved as.png,avisfor an AVIF sequence, otherwise the format as given. Found while re-reviewing #1064; I left it out of that PR so the author's branch only got merge and drift fixes.Type of change
How was it tested?
dotnet test tests/Filee.Engines.Tests --filter Upscaler: 33 passed, 1 skipped (the real upscayl-bin run, not on this PC). The new test checks that an animated AVIF is read asavisand a still one asavif(a.pngthat isn't animated stayspng), and that read asavisboth frames are kept as one animation.🤖 Generated with Claude Code