Why my iPhone photos broke after copying them to Windows
Over a quarter of the 3,678 iPhone photos and videos I copied to Windows came over damaged. 861 were cut short or empty, and 203 more had the wrong extension. Why previews hid it, what I recovered, and the free checker I built.
What happened
My iPhone was full, so one night in April I plugged it into my Windows laptop with a USB-C cable and copied everything across. 3,678 photos and videos, about 34 GB. I opened a few, they looked fine, and I cleared space on the phone.
A few months later a lot of them would not open. Some HEIC photos showed an error, a bunch of MOV videos would not play, and some files opened in the wrong app altogether. My first guess was that they had gone bad sitting on the disk. That guess was wrong, and working out why took a full evening of going through the files one by one.
409 files had the wrong name
Every file format starts with a few signature bytes. A JPEG starts with FF D8. HEIC photos and MOV videos have the word ftyp at byte four, followed by heic or qt. I wrote a small script that reads the first bytes of every file and compares them with the extension.
409 files did not match. 100 files named .MOV were really JPEG photos. 94 files named .JPG were really videos. Others were HEIC photos named .JPG or .MOV, and the reverse. Windows picks the app from the extension, so a photo named .MOV goes to the video player, which fails. For 203 of them the name was the only problem, and renaming each one to match its contents fixed it. The other 206 were also cut short, which is the next part.
One group stood out. 33 files named .HEIC actually held JPEG data. That is what you get when the iPhone converts a photo to JPEG while sending it but Windows keeps the original name. The phone does this conversion when Settings, Photos, Transfer to Mac or PC is set to Automatic, which is the default.
861 files were cut off partway through
This was the real problem. 492 JPEG photos, 235 MOV videos, 117 HEIC photos, 15 MP4 videos and one PNG stop before they should, and one more file is completely empty.
I did not see the full size of it at first. ffprobe caught 310 of these, the videos that report moov atom not found and the HEIC photos that report partial file. The rest only showed up when I checked the structure of every file. The cut-short JPEGs still open, but with a grey or green block where the data ran out, and Windows shows no error at all.
A phone video is a long block of frames followed by an index called the moov box, which tells the player where every frame sits. In these files the copy stopped before the index was written. The frames are there, but no player can find them.
Why I am sure this happened during the copy
All 3,678 files were written in one 32-minute session on the night of the import, and none of them changed after that. A disk that is wearing out flips random bits. It does not rename a file or make it shorter than its own index says it should be.
My laptop also had a failing RAM stick, with over 2,300 corrected memory errors in a month, so I checked that too. Bad memory can flip bits inside a file during a copy, but it cannot change a file's length or its extension. OneDrive only uploads the bytes it is given. That leaves the transfer itself, with the phone converting files on the fly and Windows saving them with the wrong name or the wrong size.
I could not prove which setting my phone had that night, and Windows had already rotated the logs from April. So the conversion is the most likely cause, and I am calling it that.
Why they looked fine when I checked
An iPhone HEIC photo is made of 48 tiles of 512 by 512 pixels that join into the full 4032 by 3024 picture. It also carries a separate small thumbnail of 320 by 240. File Explorer and the Photos app show you that thumbnail first.
So a photo can show a perfect preview while the full picture is broken. I pulled a clean thumbnail out of a photo that Windows refuses to open, which is exactly what fooled me that night. Scrolling through previews is not a check.
Getting the photos back
Windows rejects a HEIC completely if any part of it is damaged. But each tile is its own small image and can be decoded on its own. So I wrote a script that pulls out every tile that survived, joins them back into the grid, crops and rotates the result, and saves it as a JPG.
I ran it on the 70 HEIC photos that would not open at all, and it rebuilt 69 of them. Six came back complete. 21 came back with 90 percent or more of the picture, 34 with between half and 90 percent, and 8 with less than half. The typical photo kept 81 percent of its tiles. The missing part is always the bottom, because that is where the file was cut off.
The 250 cut-short videos still need work. A tool called untrunc can rebuild the missing index using a healthy video from the same phone as a reference, and that is my next step. For anything that really matters, the originals on the phone or in iCloud Photos are still the best copy, if they are still there.
Before changing anything I compared SHA-256 checksums of every file I moved. All 3,678 copies match their originals byte for byte, so none of my own fixing made things worse.
What I do now when I copy photos off a phone
I set Transfer to Mac or PC to Keep Originals before plugging in, so the phone sends files without converting them. I copy a few hundred at a time and keep the phone unlocked. I compare the number of items on the phone with the number of files on the laptop.
Then I run a check on the folder, and I only clear the phone once it comes back clean. I keep a second copy on another drive for a while too.
This is a common situation for students. Phone storage fills up, iCloud costs money, and a laptop with a cable is the free option. Nothing in that chain tells you when a copy goes wrong, so I made a small free page that does. You pick the folder you copied to, it checks every file in your browser without uploading anything, and it tells you whether it is safe to delete from your phone. If some files only have the wrong extension, it gives you a script that renames them.
I used AI tools to help write and check the scripts. The investigation and the write-up are my own.
People who helped
- Umang Gupta · Testing and review
- Prabesh Sharma · Testing and review