iCloud内照片损坏,如何排查四万余张照片与视频的损坏范围?
Hey Anthony, sorry to hear about your corrupted scanned photos—dealing with a library of 40k+ photos and 2500 videos is no small task, so manual checks are totally out of the question. Here are actionable, scalable ways to spot damaged files across your entire collection:
1. Start with Photos App Built-In Tools (Quick & Easy)
First, leverage macOS Photos' native features to catch obvious issues:
- Open Photos, then go to
Photos > Show Corrupted Items(this option exists in most recent macOS versions). It’ll flag any files the app already recognizes as broken, though it might miss some subtle corruption. - Create a Smart Album to filter unopenable files: Go to
File > New Smart Album, set rules likeFile TypeincludesImage/Video, plusStatusisCannot Open. This pulls all system-identified damaged media into one view.
2. Command-Line Scans for Thorough Checks
For deeper visibility, use macOS built-in tools or third-party CLI utilities to batch-test file integrity:
Use qlmanage to Verify Preview Capability
qlmanage is the backend for macOS Quick Look—we can use it to test if files load properly:
# Navigate to your Photos library's master files (default path below) cd ~/Pictures/Photos\ Library.photoslibrary/Masters # Scan common media types, output paths of files that fail to preview find . -type f \( -iname "*.jpg" -o -iname "*.png" -o -iname "*.mov" -o -iname "*.mp4" \) | while read file; do qlmanage -p "$file" >/dev/null 2>&1 || echo "Corrupted: $file" done
This runs through each file and prints paths where Quick Look can’t render the media. It’s slower than metadata checks, but it’s a reliable test of whether the file is actually usable.
Use exiftool to Check Metadata Integrity
If corruption is tied to broken metadata (common with scanned files), exiftool can flag these issues:
- Install it via Homebrew first (if you don’t have Homebrew, run the official installation script in terminal):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew install exiftool - Run the scan to export damaged file paths to a text file:
cd ~/Pictures/Photos\ Library.photoslibrary/Masters exiftool -q -if '$Error' -p '$Directory/$Filename' . > corrupted_media.txt
This will generate a corrupted_media.txt file with all files that have metadata errors, which you can review later.
3. Third-Party Tools for Non-Technical Users
If command lines aren’t your thing, these apps offer user-friendly scanning:
- Photo Sweeper: While known for duplicate removal, its scan feature automatically detects unopenable photos/videos and lets you review them in a clean interface.
- Disk Drill: Its photo recovery module includes a file integrity check that can quickly flag damaged media across your library.
Pro Tips Before You Start
- Backup First: Copy your entire
Photos Library.photoslibraryfolder to an external drive before running any scans—better safe than sorry if something goes wrong. - Re-sync from iCloud: If you find widespread corruption, try toggling off iCloud Photos on your Mac (wait for local files to delete), then re-enable sync to pull fresh copies from iCloud’s servers. Sometimes this fixes sync-related corruption.
内容的提问来源于stack exchange,提问作者Anthony Kong

