Photo Corners

A   S C R A P B O O K   O F   S O L U T I O N S   F O R   T H E   P H O T O G R A P H E R

Enhancing the enjoyment of taking pictures with news that matters, features that entertain and images that delight. Published frequently.

Leica And Apple And DNG! Oh My! Share This on LinkedIn   Share This on Google   Tweet This   Forward This

15 May 2015

Yesterday's report that Leica will warn owners of its Leica M Monochrom (Typ 246) not to import the camera's native DNG files into Apple Photos reminds us of a line from the Wizard of Oz.

Dorothy: Do -- do you suppose we'll meet any wild animals?

Tin Man: We might.

Dorothy: Oh!

Scarecrow: Animals that -- that eat straw?

Tin Man: Uh, some. But mostly lions and tigers and bears.

Dorothy: Lions?

Scarecrow: And tigers?

Tin Man: [nodding] And bears.

Dorothy: Oh! Lions and tigers and bears. Oh my!

As it turned out, there was nothing for Dorothy to fear from wild animals. And after a little tire kicking here, we have the same feeling about this problem. In fact, we can even tell you how to repair your Photos library.


We've already edited our original story to note that the problem Leica discovered afflicts Photos version 1.0 to distinguish it from any upcoming update.

Leica confirmed a Photos update will be required to handle the problem, rather than a firmware update to the M Monochrom. So we wanted to clarify which version of Photos is affected even if, at the moment, there's only one.


At the same time, we should point out that the M Monochrom whose files are not compatible with Photos 1.0 has not yet shipped.

Leica nevertheless felt it necessary to go to the trouble of printing a warning against using Photos to be included with the camera. Even if Apple were to resolve the issue promptly, there might still be new M Monochrom owners out there who just didn't get the message, have somehow stuck with Photos 1.0 (despite App Store update notifications) and remain at risk.

As every existing application amply demonstrates there is no foolproof method of software development.

But since the camera hasn't shipped, it seems no one could have experienced the problem in the wild.

This is, in short, a preemptive strike by Leica, to its credit.


Secondly, think twice before you bash Apple's software quality control, which is apparently a new national sport (bashing, not thinking). Apple is actively looking for a Photos Screener/Engineer, if you think you can do better.

But hold that thought.

As every existing application amply demonstrates there is no foolproof method of software development.

Software development today is not the man-against-machine chess match it was years ago. It's more a chess match conducted by tag teams on competing roller coasters. Tools, working environments and dependencies (on languages, frameworks, libraries, testing suites) are constantly in flux. Pieces topple over, slip off the board and fall to earth below.

Even after 38 years of software development, we still amuse ourselves constantly with the little surprises we supply in our own code. And we keep things pretty simple around here so we can sleep at night.

Now, even if you still think you can do better, skip ahead to Parsing The DNG to see how impossible the task is.


Which leads us to our next point, which always seems like an interruption: the importance of backing up your data.

Considering this problem involved OS 10 Yosemite, it is reassuring that Apple has made Time Machine (whatever its faults) available to Mac users for some time now, requiring only an external drive to implement safe and regular backups of your data.

Whether you use Time Machine or not, backing up your Photos Library would not seem to be optional. Photos is, after all, a version 1.0 release. With no recovery functions.

You'd be nuts not to back up your Photos library.


Which is exactly what we did earlier today before we decided to see if we could duplicate the problem Leica described.

When Leica released the M Monochrom, the company supplied sample images and DNG files to the press. We dug one up.

We were able to import it successfully into Photos. Photos, that is, reported that it had successfully imported the DNG file.

Photos displayed it in its window under today's import date. We clicked on it to display it by itself in the window and then clicked the Edit button.

It took Photos a minute to process the file before it quit unexpectedly.

When we reopened Photos, it quit unexpectedly. Every time we tried to launch Photos, it quit.

Which is exactly the problem Leica described. We'd confirmed it.

We also tried just importing the DNG and quitting. But we couldn't relaunch Photos with the DNG in the library.


Next we decided to test the more general proposition of whether or not this problem affects all DNG files or just the M Monochrom DNG files.

We're in the habit (since January 2014 anyway) or converting our Raw files into DNG files on import using Adobe's free DNG Converter. We discard the proprietary Raw files and live happily ever after.

So we imported some DNG conversions into Photos 1.0. No problem. We edited them. No problem (even fun, actually). And we closed Photos 1.0 prepared to see the destructive behavior Leica described when we reopened the application.

Instead Photos opened normally, displaying our DNG images just as we had edited them.


Before we continue, lets describe what you have to do to fix your Photos library if you run into this problem.

Hold down the Control key and click on the Photos library file in your Pictures directory to bring up the contextual menu. Select the third option "Show Package Contents."

You're now inside the library's directory.

Navigate to the Data folder and delete the last dated entry (it was the Data/2015/05/16/ folder for us). Do the same for the Masters, Modified and Data.noindex folders.

Deleting the folder in the Data and Masters file is sufficient to let Photos open successfully but there's no sense having the other remnants lying around.

That got us within a few bytes of the original library. We suspect there's a database entry that isn't as easily removed. And in fact when we tried to reimport that DNG, Photos claimed it was a duplicate.

So you're better off with a backup than our fix but the important thing is to be able to recover from the crash.


This would suggest that the problem lies with the Leica DNG files rather than DNG files in general. Which is not to say that the Leica DNGs are out of spec. In fact, we validated the Leica DNG with DNG converter and still got the crash. But apparently there is something in these DNGs that Photos can't parse.

Hold your fire, though. As Phil Harvey's frequent updates to ExifTool attest, things aren't always simple when it comes to Raw files.

Here's just one example, and it involves the DNG format:

Changed the DNG BaselineExposureOffset to a signed rational, (contrary to the DNG 1.4 specification, which specifies an unsigned rational, but obviously Adobe meant for it to store negative values).

Photos 1.0, however, predates the M Monochrom, so it would be unrealistic to expect Apple's software engineers to have anticipated any anomolies in the M Monochrom's DNG files.

Especially since the DNGs are unusual in not recording color information.


To be fair, you will not find the new M Monochrom in Apple's list of supported Raw formats.

Which is another good reason to pat yourself on the back for backing up your Photos library before importing the unsupported format.

But it also highlights a long-standing problem. Apple just doesn't add support for new Raw formats very quickly.

Adobe sets the bar here. But they aren't alone.

Brian Griffith, the one man show behind Iridient Developer, added support for the new M Monochrom on May 6. When we asked him about the M Monochrom, he replied that he hadn't run into any unusual issues, perhaps thanks to "some extra checks I put in place previously." And added:

The undocumented nature of most Raw image formats can make it very difficult to reliably support new cameras prior to actually getting Raw image samples from the camera. In this case as the Raw format used by Leica is DNG so you'd expect this would be more unusual as the format is reasonably well documented, however if Leica's images possibly fail proper DNG validation a file parser that is expecting correctly formatted DNG could still fail for many reasons.

So it doesn't make much sense to expect Photos 1.0 to support a Raw format (even a DNG variant) it hadn't seen prior to release. Griffith explained, "DNG is very much like TIFF with literally dozens of potential data layouts, compression schemes and other options that can make support and testing of every possible feature or option difficult."


Import an unusual monochrome DNG format into version 1.0 of an ambitious new photo application released before the camera that creates the DNGs has shipped and you have a fire drill.

The lesson of this fire drill is not exclaim, "Oh my!" but to protect yourself from incendiary matches like this by backing up your data.

And don't worry about the wild animals.

BackBack to Photo Corners