Apple Photos App Corrupts Images

(tenderlovemaking.com)

363 points | by pattyj 3 hours ago

32 comments

  • myshkin5 2 minutes ago
    I’m a fan of the whole Apple ecosystem but I have to say that there’s a pattern here. Apple does a decent job of keeping my data safe from others but a terrible job of keeping it intact. From music libraries with song titles that got switched to long integers to this (and I’m sure more that I’m not remembering atm) they need to do a better job here.

    Sure security is important but integrity is too.

  • deviation 2 hours ago
    It seems to be an import pipeline bug.

    Photos does a lot of extra work on import (merging RAW+JPEG pairs, generating previews, database indexing, optional deletion), so my guess is a concurrency bug where a buffer gets reused or a file handle is closed before the copy finishes.

    Rare, nondeterministic corruption fits the profile.

    • tenderlove 2 hours ago
      This is also my guess. It's really a bummer, and I'd report it to Apple but since it's nondeterministic I have no idea how to provide repro steps.
      • ChrisMarshallNY 2 hours ago
        I have had extremely bad luck, reporting bugs to Apple.

        They constantly ask for an example project, even if it's something that is easily demonstrated, simply by running existing Apple software, and creating a project, would be a huge pain.

        They also ignore reports. Very rarely, I may get a ping on one of my reports, asking me to verify that it was fixed in some release. Otherwise, there's no sign that they ever even read it.

        I usually end up closing my bug reports and feature requests, after a few months, because I'm tired of looking at them.

        It's clear that they consider every bug report to be a burden. That's a very strange stance, but then, they are not a typical company.

        I guess you can't argue with the results, as they have a market value North of 3 trillion dollars, but that does not make it any less annoying.

        • deviation 1 hour ago
          Not to hand wave-- but this feels industry standard IMO. I have a dozen PRs sitting unacknowledged and stale across a handful of FAANG (and other) repos, including Apple's.

          I start my first day @ Apple in a few weeks, so I ACK that my opinion might be a little biased here.

          • dmd 1 hour ago
            Maybe you can help bump FB13400242, a bug that is _literally_ going to kill people. (The bug is that to make an emergency call, even from lock screen, you're supposed to be able to squeeze buttons on either side of the phone. But it only works with the volume buttons on the left - the Action button didn't get supported, when that button was added. So now the rule for teaching a small child isn't just "squeeze both sides" it's "oh but not that one!")

            (Yes, this came close to killing someone close to me. Fortunately someone else happened to come along to help.)

            • RankingMember 15 minutes ago
              Consider hitting up some Apple "watcher" people (e.g. 9to5mac) to see if they can give you a boost on their social media. It's pretty obnoxious that it's come to needing to make a stink like that to get eyeballs on something, but here we are.
            • pants2 14 minutes ago
              I think a faster / easier approach is to just press the biggest button repeatedly until it makes an emergency call for you.
              • dmd 11 minutes ago
                A five year old is going to find "just squeeze" easier than doing that.
          • devmor 20 minutes ago
            If you ever get the chance, maybe you can be the one that improves that process some day.

            Even if it's standard among tech giants, you could be the one that makes a new standard! Good luck in your new role, btw.

        • latexr 1 hour ago
          > I have had extremely bad luck, reporting bugs to Apple.

          From your description, your experience is quite typical.

        • lapcat 1 hour ago
          > I guess you can't argue with the results, as they have a market value North of 3 trillion dollars

          This was financed by equally massive technical debt.

          • imchillyb 29 minutes ago
            How does one finance a project or a company with increased maintenance costs and lower quality production?

            That’s what technical debt is. It’s the cost for moving forward quickly. I’m not sure I understand what you’re trying to state.

            • lapcat 12 minutes ago
              > How does one finance a project or a company with increased maintenance costs

              You seem to be assuming that the company will eventually pay off the technical debt rather than just continue accumulating it and lowering production quality.

      • ValentineC 18 minutes ago
        What's worse about the Apple ecosystem is that because of how tightly coupled it is, a bug fix for Photos would only come as part of a macOS update.

        Which means that if that bug has been present since the (now unsupported) Mavericks, tough luck!

        • JKCalhoun 3 minutes ago
          MacOS updates are several per year though. If a fixes found (and the bug considered a high enough priority) it could show up before 2025 is up.
      • egorfine 10 minutes ago
        > I'd report it to Apple

        What's the point of it? It is well known in the industry they ignore bugreports.

        Also, this bug doesn't affect the majority of users, so it won't ever be fixed.

      • strunz 1 hour ago
        Have you tried copying the files to the local disk before importing?
        • turnsout 12 minutes ago
          This is what I always do. Rather than go directly from the card reader or camera into Photos or Lightroom, I copy the files onto an SSD, and then bring them in from the SSD. The entire process goes faster.

          I also want to point out that I've seen similar corruption in the past, only in Lightroom. The culprit ended up being hardware, not software. Specifically, the card reader's USB cable. I've actually had two of these cables fail on different readers. On the most recent one, I replaced it with a nicer Micro B to USB C cable, and haven't had an issue.

    • inanutshellus 1 hour ago
      Also interesting that he went from one day's import damaged 30% of his photos, but after replacing everything he had gotten to the point where it took a while to even get a single corrupt photo.

      Random is random, and random is clumpy, so maybe swapping parts is irrelevant, but... I wanted more detail on his parts-replacement journey.

      He doesn't mention how often the corruption happened whilst he swapped out parts, unfortunately. Presumably it was too rare the entire journey.

      edit:

      also wth i just realized I went to "tenderlovemaking.com" at work. gross. lol.

      • bluSCALE4 58 minutes ago
        I'd be interested in knowing if he was multitasking and using a lot of memory. I know wedding photos are usually something you feel rushed to upload so maybe this issue can be made worse depending on system resource availability.
      • tuetuopay 18 minutes ago
        Since it looks like a concurrency issue, most likely the new laptop made the issue less frequent through the simple virtue of being faster.
    • JoBrad 1 hour ago
      I wonder if it’s related to import sources, and maybe the speed of that hardware. They are still successfully importing the photos into the Photos app, just not from the camera.
    • mentos 59 minutes ago
      Sounds like an argument for Apple to provide a new high-level media import framework?
  • ChrisRR 2 hours ago
    I feel like this is a URL that I don't want in my history
    • sholladay 1 hour ago
      There is a very popular professional audio website called Gearspace that had a much spicier name for a long, long time.

      https://gearspace.com/

      https://www.reddit.com/r/audioengineering/comments/mftc0g/ge...

    • macintux 2 hours ago
      In the late 90s my then-wife was watching over my shoulder one day and saw the domain “freshmeat.net” pop up as a possible auto-completion in my address bar. She was justifiably suspicious until I showed her it was just a software distribution site.
      • devnullbrain 1 hour ago
        Infohazard warning:

        C++ reference is one of these.

        • Y_Y 1 hour ago
          See also: Experts Exchange, Pen Island
          • eru 1 hour ago
            There was also a website for a mole station, but I'm not sure if that one was satire.
      • layer8 1 hour ago
        And she wasn’t suspicious of amazon.com? ;)
    • coldtea 1 hour ago
      As if "tender lovemaking" is so shocking?
      • cluckindan 1 hour ago
        Obviously there must be bureaucracy and an RFP involved!
    • sgopalan98 1 hour ago
      Whaaa, you don't like tender lovemaking?
    • copperx 2 hours ago
      Why? It's brilliant.
      • brulard 2 hours ago
        The URL might be mistaken for some different content?
        • k8sToGo 2 hours ago
          Well, then don't browse from the church computer
      • kotaKat 2 hours ago
        ZScaler gets pissed off going to frame.work just because of a “malicious TLD”.

        I don’t even want to know what ZScaler thinks of “tender love making”.

      • crazygringo 2 hours ago
        What's brilliant about it? What's the reference, for those of us unfamiliar?
        • meterogue 2 minutes ago
          The author's name is tenderlove. He has been a famous contributor to Ruby and Rails for at least 10 years. If this is objectionable to you, it shows your lack of expertise.
        • rhgraysonii 2 hours ago
          It is simply hilarious to make grown adults visit a website called tender love making dot com (a sexual reference) to read a very specific and niche blog about technology.
          • sombragris 13 minutes ago
            "tender love making" and then the specific URL mention photos and corruption... it could look really bad!
            • meterogue 0 minutes ago
              You are welcome not to visit it if you do not want to hear from a Rails contributor for over 10 years.
    • dcchambers 2 hours ago
      Site belongs to Aaron Patterson, one off the most prolific Ruby developers in the world.
  • asolove 2 hours ago
    I also have an OM System camera (OM-5) and never get corruption this bad but occasionally got one row of green pixels at the bottom of a photo during import to Photos. I thought I was crazy, but this motivates me to change up my routine and check if it was Photos all along.
  • doodaddy 52 minutes ago
    As an Olympus shooter this is good to know.

    But good gravy that troubleshooting path got expensive real fast. Replacing the laptop and the camera? Why not start by trying something other than Photos? It doesn’t even need to be a paid product; the Olympus software is free not to mention a good baseline since it - of all the applications - should be able to import photos without corrupting them.

    Edit to add: delete on import seems pretty risky. My workflow is to import and only delete from the camera after 1) the imported photos are backed up 2) I’ve done a first pass culling.

  • spuz 39 minutes ago
    It would be very helpful to document the version number of the Photos app that demonstrates this behaviour so anyone else who is affected can use this article to keep track of potential fixes.
  • sitharus 2 hours ago
    I hadn’t dug that far in to it, thanks for sharing! I assumed my rather old SD card or the adapter I keep stuffed at the bottom of my bag was the issue as I’ve only seen it on a couple of photos.

    I’ve used Olympus cameras for over a decade. Well, the same camera to be honest, a PEN E-PM2. This has only appeared in the past couple of years.

    I haven’t seen it on photos from my Canon EOS 80D yet, but I guess it’s time to change my workflow. And maybe OS.

  • maz1b 23 minutes ago
    I stopped using the Photos App on Mac because of this, has happened on several occasions.
  • mcflubbins 39 minutes ago
    What are some good Open Source / Self Hosted alternatives to Apple Photos (Desktop)? I pretty much keep my Mac Mini around solely to import photos from our phones, free up space on the phone, and backup the Photos DB. We like to go back and look at old photos from time to time too, and the feature that shows them on a map is a big one for us.

    Last time I looked (pre-COVID) there wasn't a lot of promising options, and some didn't support HEIF images

    • sodality2 35 minutes ago
      Immich.app, with their import from iCloud CLI command to seed it: https://github.com/simulot/immich-go#from-icloud-sub-command
    • tom1337 36 minutes ago
      Immich could solve what you are looking for. It supports wireless upload to the server, everything is stored locally and it has some neat additional features.

      https://immich.app/

    • rwky 36 minutes ago
      I'm fond of digikam https://www.digikam.org/ it's simple enough for most users and has complex features for more advanced users its open source cross platform and doesn't do some weird rearranging of files so you can still use your file browser too.
  • tmountain 55 minutes ago
    I shoot RAW but I wouldn't want to eat up all my iCloud space with my RAW files. They're 80MB each off of my Fujifilm camera. I store them on a local DAS instead. Curious what the real use case is for storing RAW on iPhoto.
    • _aavaa_ 44 minutes ago
      Backups on the go. 2TB iCloud + wifi + sd card reader for iPhone.

      No longer have to bring laptop or external drive along for backups

    • josephg 43 minutes ago
      You can put your apple photos library on an external / network attached drive. Thats what I do, since my photo library has grown to ~300gb. And I'd much rather buy a hard drive than rent one from apple.

      There's also the excellent osxphotos utility which can export / backup / migrate photos in and out of apple photos:

      https://github.com/RhetTbull/osxphotos

  • mcflubbins 43 minutes ago
    I had a weird issue with at least one photo in Apple Photos recently (possibly more that I haven't found) where the photos app showed the image, but I couldn't export it - like it was only a preview. I've upgraded my photos database over many release so I don't know if that's a part of it, the photo in question was from 2018 or so
  • giancarlostoro 1 hour ago
    > Turns out “delete after import” was a huge mistake.

    https://www.cgsecurity.org/wiki/photoRec

  • itake 2 hours ago
    Apple corrupted images on my iPhone where I can’t import them to my PC via photos, but I can backup the whole phone.

    They finally recognized there is an issue, but there is no fix, as of a few weeks ago :(

    • alterom 1 hour ago
      Yeah, that's one of the billion reasons I'm sticking to Android phones with gasp file managers and shock expandable storage via an SD card slot.

      I never need to import anything when I can simply copy the data from the card.

      • freedomben 37 minutes ago
        But files are hard, scary and dangerous! What if a scammer asks Grandma to open the files app or copy photos directly to her pc!?
  • bichiliad 51 minutes ago
    Somewhat tangental, but I keep my music in the Music app. Wireless music sync is great and usually does what I need. Once in a blue moon, however, it'll absolutely scramble every album cover of every song I have.
  • dzink 1 hour ago
    Not sure if related but importing images via image capture on mac to the disk of the mac gives you correct time when the photo was taken in the file (kind of important if it’s family photos). But if you import it to a usb drive you get current time as creation time for each file so you’ve lost any timestamp you had on the photos.
    • ValentineC 14 minutes ago
      > Not sure if related but importing images via image capture on mac to the disk of the mac gives you correct time when the photo was taken in the file (kind of important if it’s family photos).

      Something related: exporting originals from Photos used to give the current timestamp back in Ventura, which annoyed me to no end.

      They fixed that bug in either Sonoma or Sequoia (I jumped straight from Ventura to Sequoia).

    • mystifyingpoi 1 hour ago
      > kind of important if it’s family photos

      Anything important should be kept inside the file. Filesystem metadata gets lost all the time, isn't consistent between operating systems, zipping up a folder and extracting it will probably mess up timestampts too.

  • CtrlAlt 1 hour ago
    I’ve never had this bad of corruption. But not surprised.

    Personally, I have seen a row of green pixels on the top or bottom + vertically flipped photos on import.

    Good sleuthing!

  • kevwil 10 minutes ago
    WTF is that URL? I'm NOT clicking on that. LOL
  • kokey 1 hour ago
    Fortunately it mentions early on in the article that this is related to an Olympus camera so I'm guessing this has something to do with the OM system's flavor of Olympus's proprietary ORF format.
  • billyjobob 2 hours ago
    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.
    • tenderlove 2 hours ago
      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.
      • jjcob 1 hour ago
        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.

      • daemin 1 hour ago
        This is the kind of stuff that makes me wish my Binary Diff Tool was already completed, but unfortunately I'm still working on it. Can't tell much what's wrong with the differences in the bytes without knowing what the structure behind it is.
    • daemin 2 hours ago
      There's a corrupted photo at the top of the article and the non corrupt version at the bottom, is that not enough?
      • Someone 2 hours ago
        No, it isn’t. The OP isn’t questioning whether the file changed, but asking what changed to the file, not what changed visibly.

        The visible effect shown could be due to a change as small as a single bit flip. It also could be that large parts of the file got overwritten, or that it partially got zeroed. The exact kind of damage can help pinpoint the cause of the problem.

    • asksomeoneelse 2 hours ago
      Yeah, I would have been interested in the diff too.

      That said, the article does mention replacing basically all the hardware and still encountering the issue. FWIW, my personal experience with Apple software so far is that the usage expected for Average Joe is well tested and polished. But stepping outside of that, it's "Here be dragons" territory very quickly.

    • jsw97 2 hours ago
      He switched out his laptop.
    • mobilemidget 2 hours ago
      "I’ve not seen any file corruption when importing to Darktable, so I am convinced this is a problem with the Photos app."

      Yes this argument is a bit unconvincing for me. Not saying Apple photos doesn't corrupt his files, but this is not real proper investigating either.

  • bluSCALE4 1 hour ago
    I have Apple Photos but I never thought to use it to automatically import my photos and clean it up. My process is very similar to where you've ended up. Thanks for validating it--I'll never change it.
  • internetdrew 28 minutes ago
    ...just discovered DarkTable because of this! #win
  • lapcat 2 hours ago
    See also the Image Capture bug from several years ago where it appends a ton of empty data to imported photos:

    https://cdfinder.de/blog/files/image_capture_bug.html

    (I'm not sure whether this bug has been fixed or not yet, though I think it has been fixed.)

    • iamshs 2 hours ago
      Image Capture did me dirty once. Macbook ran out of space while importing photos but it never stopped and kept on deleting photos from my iPhone. Lost 5K photos of a wedding... submitted a bug and hopefully it has been rectified.
      • ValentineC 12 minutes ago
        Image Capture hasn't had a delete after import checkbox for a few versions now, I think.
  • tamimio 3 hours ago
    For transferring files (photos or others) from iOS, I have been using Landrop for a while and never had any issues so far, it’s also way faster than using a cable.
    • basejumping 2 hours ago
      For transferring photos from your Iphone to your Mac, you can also use the native Image Capture app.
    • actionfromafar 3 hours ago
      I always wonder about the motivation behind these polished, high-quality programs on the App Store which are not open source, and also don't collect (much) data, neither have ads in them.
      • tamimio 2 hours ago
        It’s open source, else I wouldn’t recommended it

        https://github.com/LANDrop/LANDrop

        I used it along with another called Localsend, but the later one gave me a bit of headache and crashed while transferring some large files last time I used it, but still great as an alternative too, and it’s open source as well.

        Edit: Actually, you are correct, it seems they did close it! Try localsend instead.

        • BolexNOLA 2 hours ago
          Love LocalSend. Can be a bit finicky but for quick transfers between systems I love it. Use it so my work laptop, Linux gaming PC, and iPhone can easily pass staff around.
          • k8sToGo 2 hours ago
            You figured out how to teleport people through local send?
    • ratg13 2 hours ago
      This article is about importing photos from an SD card to MacOS
  • huflungdung 1 hour ago
    [dead]
  • smeeger 2 hours ago
    [flagged]
  • outsideoftime 2 hours ago
    [dead]
  • pvdebbe 3 hours ago
    [flagged]
    • DRW_ 2 hours ago
      Why?
  • amelius 2 hours ago
    [flagged]
    • rollcat 2 hours ago
      Where can I get professional-grade toothpicks?
      • amelius 1 hour ago
        Ask your dentist?
    • reaperducer 2 hours ago
      This is what you get when you buy consumer hardware.

      And when your Toyota breaks down, we'll all be there to tell you that you should have bought a military-spec truck.

  • hk1337 2 hours ago
    > Turns out “delete after import” was a huge mistake.

    That's a mistake no mater what application you're importing to, else we'll be graced with another blog post, "Darktable app Corrupts Photos".

    What's the purpose of RAW+jpg though? Seems rather redundant?

    • indrora 48 minutes ago
      Speed. It all comes down to speed.

      Processing RAW can be expensive time wise. If you’re sorting through a session of 10,000 photos, you want the speed that comes with the jpeg variant, which allows you to quickly sort out blurry, smeared, severely mis-exposed, and other various defect photos.

      The storage cost is negligible (JPEG75@10MP is cheap) and the workflow benefit is immediate. Additionally, cropping and early white balance corrections (as well as a handful of other things) are much faster to preview with a non-RAW version of the image; since you’ll be processing that detail later anyway from scratch in the RAW later, it’s functionally free to do it on the jpeg version before you dig into the raw.

      Additionally, there’s a cheap debugging aspect that you saw here: was it Apple Photos mishandling ORF? Was it something else? When working with both, you have a “reference” that can be used to make sure your digital development pipeline is set up correctly; finer details about the imager can sometimes get mangled by some RAW developers like pixel order and sub pixel blending. Not every CCD is a linear grid, not every LCD looks the same, but if you can get your RAW pipeline producing ≈the same as your camera did, it verifies that you have things mostly set up correctly.

    • tenderlove 1 hour ago
      > That's a mistake no mater what application you're importing to, else we'll be graced with another blog post, "Darktable app Corrupts Photos"

      Thanks dad.

    • merelysounds 2 hours ago
      > What's the purpose of RAW+jpg though? Seems rather redundant?

      You get to keep out of camera jpg files. Some people might like how their camera processes jpg files and might also want the raw file for a scenario when a more complex editing is needed.

      • hk1337 2 hours ago
        Interesting, based on this and other replies, it sounds like Photos App should have an option to select what to import? i.e. RAW or jpg, but not both.

        It sounds like Photos App can have issues trying to import both at the same time?

        • tenderlove 1 hour ago
          As I said in my blog post, it imports both and combines them in the UI. Also as I said in my blog post, I switched to shooting only in raw, and it still exhibited file corruption.
          • cwillu 50 minutes ago
            I commend you for your patience with this comment section.
    • stillworks 41 minutes ago
      Is this downvoted because of the last line i.e.

        What's the purpose of RAW+jpg though? Seems rather redundant?
      
      Otherwise, it is wise to highlight that "delete after import" is not a good choice in general.

      I personally would not let device A to automatically delete files from device B while files are being copied from B to A.

      My workflow is quite manual when bringing pictures in from camera to my MacBook.

      - I simply take the SD Card from the camera and then use the SD Card reader on MacBook itself to copy the files (RAW + JPEG) into a working directory.

      - Move just the JPEGs into Apple Photos library

      - The ones which I think I can/should improve using RAW processing, are processed in DxO Photo Lab and exported to JPEG with a *_DXO.JPEG filename

      - DXO Processed JPEGs are added to Apple Photos again. This time due to the naming scheme, the DXO processed JPEGs and camera baked JPEGs are next to each other which helps in quickly checking the results.

      - Delete the camera baked JPEG once I am happy with DXO's output

      Regarding...

        What's the purpose of RAW+jpg though? Seems rather redundant?
      
      ...as others have pointed out. Shooting RAW+JPEG is like an insurance policy where if the camera was unable to produce a result which I would like to keep, I have the RAW to play with.

      I only keep JPEGs in Apple Photos as all of my image library is backed up to iCloud and don't want that duplication.

      RAW files get backed up to another SSD. Looking into a better backup for RAW files.

      Also, since I switched recently to a camera which uses CFeB cards for best experience (but also has a SD card slot), the onboard SD Card reader on my MacBook will become useless for this once I get an external CFeB reader.

    • bayindirh 2 hours ago
      I also use RAW+JPG. Latter part allows quick sharing without long post-processing, esp. for impatient friends.

      If I'm going to share the photo to an album or something, I process the RAWs selectively.

    • basisword 2 hours ago
      JPG so you can also see the default camera processing which might be work well from time to time. RAW in case it doesn't.
    • formerly_proven 1 hour ago
      I don't know why this is downvoted.
      • cwillu 47 minutes ago
        Because it's utterly irrelevant nitpicking, acting as if a blog post is something that was inflicted on hk1337, followed by a question about a pretty basic concept demonstrating a very limited understanding of the domain, which would be fine if the assumption of good-faith wasn't undermined by the preceding text.