Skip to content

fix(clean): preserve multi-frame photos and fail on silent audio loss#2

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-54d6
Draft

fix(clean): preserve multi-frame photos and fail on silent audio loss#2
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-54d6

Conversation

@cursor

@cursor cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown

Summary

Fixes two critical regressions from the native ImageIO/AVFoundation migration:

  1. Multi-frame photo truncationNativeImageIO.stripMetadata only encoded frame 0, silently dropping extra pages from multi-page TIFF scans and frames from animated WEBP.
  2. Silent audio lossNativeVideoClean used try? on audio track insertion, so videos with audio could be exported silent when mute was off.

Changed files

  • Sources/MetaBurn/Services/NativeImageIO.swift — loop all CGImageSource frames when re-encoding
  • Sources/MetaBurn/Services/NativeVideoClean.swift — fail when source audio cannot be preserved (mute off)
  • Sources/MetaBurnCore/AudioPreservation.swift — pure rule for audio preservation contract
  • Tests/MetaBurnTests/CoreTests.swift — unit tests for audio preservation rule

Testing performed

  • swift build
  • swift test
  • Manual run on macOS / Apple Silicon

Safety 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.

Open in Web View Automation 

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>
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