←back to thread

Apple Photos app corrupts images

(tenderlovemaking.com)
1119 points pattyj | 1 comments | | HN request time: 0s | source
Show context
billyjobob ◴[] No.45274565[source]
He says the checksums are different but he doesn’t provide a diff to show how different. It could just be a single flipped bit or something. And that could happen in his own RAM/disk/CPU/router so seems premature to immediately blame Apple.
replies(5): >>45274588 #>>45274668 #>>45274699 #>>45274786 #>>45274793 #
tenderlove ◴[] No.45274786[source]
Here you go!

  https://gist.github.com/tenderlove/25853f50ab46a58738ff2cc22d682f2b
I ran both files through xxd then diffed them. I've literally changed every piece of hardware (at no small cost). "premature to immediately blame Apple" seems a bit off.
replies(2): >>45275274 #>>45275294 #
jjcob ◴[] No.45275294{3}[source]
I tried running the file segments through a binary diff with Hex Fiend

As far as I can tell:

- 0x7800 bytes were replaced at file offset 0x00aa0000

- 0x2200 bytes were replaced at file offset 0x00aa8000

I can't tell if the replacement data came from a different part of the file, or somewhere totally different. Race condition somewhere sounds plausible.

replies(1): >>45276881 #
nickcw ◴[] No.45276881{4}[source]
gcd(0x2200,0x7800) = 512

So some part of the chain with 512 byte buffer size corrupted the data.

It doesn't look like a memory corruption but if this were my computer I'd run the equivalent of memtest86 on it.

It looks like a filing system corruption to me. Running `diskutil info` on the main harddisk and the sd card might be interesting to see if the block sizes match.

Running a disk tester on the sd card and the main disk might be a good idea too. Here is one I wrote: https://github.com/ncw/stressdisk

replies(1): >>45286874 #
1. borisgolovnev ◴[] No.45286874{5}[source]
It's a shame APFS does nothing to ensure file integrity.