Read only the bytes the type sniffer uses in check_in_media - #226
Merged
Merged
Conversation
check_in_media read every media file whole before checking it in. For a file on disk that data only feeds guess_mime and guess_extension, and the vendored sniffer looks at no more than the first 8,192 bytes, so a large video was held in memory in full to identify its type. It now reads those bytes with the sniffer's own get_signature_bytes. The file is still linked or copied into the report as before. On abe_ios16 the artifacts that check in media read 3.03 GiB whole for 7,992 files; the same files now take 59 MiB. A 2 GiB test video checked in by the WhatsApp artifact took the run to a 2.30 GB peak and now peaks at 0.15 GB, with the same recorded type. Every LAVA table and TSV came out identical on otto_ios17, cookbook_a11, thisisdfir_takeout, dleapp_imessage_bigsur and whatsapp_macos. New unit test pins the read size and the recorded type and extension. Co-Authored-By: Claude Opus 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.
check_in_media reads only the bytes the type sniffer looks at instead of the whole media file.
Same change in all five cores.
🤖 Generated with Claude Code