fix(clean): preserve multi-frame photos and fail on silent audio loss#2
Draft
cursor[bot] wants to merge 1 commit into
Draft
fix(clean): preserve multi-frame photos and fail on silent audio loss#2cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
NativeImageIO only wrote frame 0, truncating multi-page TIFF and animated WEBP outputs. NativeVideoClean swallowed audio insert failures with try?, producing silent videos when mute was off. Loop all frames and fail when source audio cannot be preserved. Co-authored-by: ringlet_fires5b <ringlet_fires5b@icloud.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.
Summary
Fixes two critical regressions from the native ImageIO/AVFoundation migration:
NativeImageIO.stripMetadataonly encoded frame 0, silently dropping extra pages from multi-page TIFF scans and frames from animated WEBP.NativeVideoCleanusedtry?on audio track insertion, so videos with audio could be exported silent when mute was off.Changed files
Sources/MetaBurn/Services/NativeImageIO.swift— loop allCGImageSourceframes when re-encodingSources/MetaBurn/Services/NativeVideoClean.swift— fail when source audio cannot be preserved (mute off)Sources/MetaBurnCore/AudioPreservation.swift— pure rule for audio preservation contractTests/MetaBurnTests/CoreTests.swift— unit tests for audio preservation ruleTesting performed
swift buildswift testSafety notes
Originals remain untouched (work-file copy → promote). Failed audio preservation now surfaces as a clean failure instead of promoting a silent output. Multi-frame photos now preserve all visible content.
Screenshots
N/A — backend clean-path fix only.