De-Aspect Your Digital Negatives


Broken things are sometimes more valuable than you might think

Lately I stumbled over such a weird behaviour which not only irritated, but highly frustrated me.

The Story

A friend of mine took some pictures for me to edit. We use a Google Drive folder to sync our work. Google can preview a lot of file types (more than e.g. Dropbox) – but it has a “bug”: It disregards the metadata of the RAW files. If we wouldn’t have used a system, that didn’t implemented the spec, I would never have found out.

The Problem

Let’s have a closer look at the problem I encountered.
See, the image to the right is the preview I got on Google Drive.
Looking good so far, doesn’t it?

Google Drive preview image

Now, that’s the same photo, downloaded, viewed as thumb in Windows Explorer.
Do you spot anything fishy?

Windows Explorer thumb image

How about now: The same photo openend in Camera Raw.
Exactly. There is missing a whole part of the image.

Camera Raw editing pane with image

The Search

At first I believed it was a thing only occuring due to up- and downloading the RAW files via Google Drive. This “easy” solution was shortly after ruptured by the insight that my friend faced the same issue with the files coming directly of his camera.

My second guess was that there could be some kind of “pre-cropping” taking place – and I was right – it’s just you simply can’t see, or let alone change it in Camera Raw, Lightroom, etc.

This is an excellent example of being spec compliant but losing your user along the way. Even worse: no program actually gives you a hint saying that there is some weird bullshit going on. So what exactly happenend?

exiftool screenshot
Exiftool (here the GUI is displayed) quickly revealed the problem.

The camera did set a 16:9 cropping to be applied to the photographs taken. That is either a setting, which was surely not activated deliberately by the photographer,Why would you even activate it? You will have to develop the photos no matter what, so you can always crop them later or some online sources suggest that it’s happening automatically if you use certain focal lengths (not really sure about that).
All of the programs, and even Windows, respect the spec and will use the crop setting from the RAW’s metadata. But again: They do, without telling the user about it – which I think is certainly a dark pattern.

The Solution

With the famous exiftool I was able to get the original, uncropped image back:exiftool must be installed and in your PATH.

exiftool -AspectRatio="" -AspectFrame="0 0 0 0" -DefaultCropOrigin="" -DefaultCropSize="" -CroppedImageWidth="<width from exiftool>" -CroppedImageHeight="<height from exiftool>" -o output.dng input.dng

However: this only works with DNG, CR2 and ORF.
The pictures on the other hand were taken with a Sony Alpha 330, whose RAW flavour is called ARW. So you might need to convert all your RAW files to DNG first. (Just use the Camera Raw save dialog.)

If you’re facing the same problem as me you surely want an easy way to get rid of this nonsense for a whole bunch of photos – so what wouldn’t be more suitable than a script?

In other news I wrote a powershell script:

$format = "dng"  # change to cr2 or orf if needed
$search = "*." + $format
$suffix = "-da"  # suffix for renaming of the de-aspected files

function Deaspect($Filename){
    # those are getting the true original sizes
    $CmdWidth = exiftool -ImageWidth $Filename
    $CmdHeight = exiftool -ImageHeight $Filename

    $ImgWidth = $CmdWidth -replace '\D+'
    $ImgHeight = $CmdHeight -replace '\D+'

    $NewFilename = $Filename.BaseName + $suffix + $Filename.Extension

    &exiftool -AspectRatio="" -AspectFrame="0 0 0 0" `
    -DefaultCropOrigin="" -DefaultCropSize="" `
    -CroppedImageWidth="$ImgWidth" `
    -CroppedImageHeight="$ImgHeight" `
    -o $NewFilename $Filename

Get-ChildItem -Filter $search -Recurse | ForEach-Object { Deaspect -Filename $_ }

If you use Lightroom you can check out this plugin.

I hope I could save you some time, trouble, & frustration.
Happy creating! 👋🏻