Sidecar script updated for Monterey

Published on by Geoff Taylor

I updated my Sidecar script for macOS Monterey. You can find the latest release on GitHub.

Update to Sidecar script

Published on by Geoff Taylor

I updated the Big Sur version of my Sidecar script so that it correctly toggles Sidecar. If Sidecar isn’t connected, running the script will connect it. If it’s connected, running the script will disconnect Sidecar. This was working in the original Catalina version, but for some reason I omitted it when I updated the script for Big Sur.

Since I’ll probably have to update the script for each new macOS version, I moved it to a GitHub repository, where you’ll find the source and downloadable zip files.

Playlist backup script updated for Big Sur

Published on by Geoff Taylor

I updated my script to backup Music playlists for Big Sur. There are two versions now: one for Catalina and one for Big Sur. Both versions are available in the GitHub repo.

Scriptable Sonos controller

Published on by Geoff Taylor

I created a Sonos controller for Scriptable. In addition to Scriptable (and a Sonos speaker), the Sonos HTTP API server must be running on a computer that’s on the same network as your Sonos system. See the GitHub repository for instructions, documentation and example scripts.

How to tell the difference between RAW and ProRAW

Published on by Geoff Taylor

If you’ve been shooting RAW photos on your iPhone for a few years, and now you’re shooting ProRAW, you probably have a mix of RAW and ProRAW images in the Photos app. How can you tell the difference? Both are DNG files, and the Photos app identifies both simply as “RAW.” Here’s a regular RAW photo in the Photos app.

And here’s a ProRAW photo.

There is a difference, however, as you can see in Halide’s photo viewer. The RAW file’s photometric interpretation is “CFA,” and the ProRAW file’s photometric interpretation is “Linear RAW.”

A RAW photo's attributes viewed in Halide.
A RAW photo's attributes viewed in Halide.
A ProRAW photo's attributes viewed in Halide.
A ProRAW photo's attributes viewed in Halide.

But if I’m in the Photos app, I don’t want to switch to Halide just to find out what kind of RAW file it is. I normally use ViewExif’s extension to inspect EXIF data in the Photos app, but it doesn’t show the photometric interpretation, so I decided to see if Shortcuts could help.

I started with a simple shortcut that gets a dictionary from an image.

The dictionary helpfully includes the photometric interpretation, but it’s a number.

Thanks to the ExifTool website, which includes a comprehensive list of EXIF tags, I learned that a photometric interpretation value of 34892 indicates a Linear RAW, and a value of 32803 indicates a CFA (Color Filter Array, or a regular RAW file).

I created a shortcut that performs these steps.

  1. Get an image via the share sheet.
  2. If the image file’s extension is not “DNG,” just display the extension in an alert.
  3. If the image file’s extension is “DNG,” get a dictionary from the image.
  4. Get the value of the dictionary’s “{TIFF}” key, which is another dictionary.
  5. From that second dictionary, get the value of the “PhotometricInterpretation” key.
  6. From that second dictionary, get the value of the “Make” key.
  7. If the photometric interpretation is 34892 and the make is “Apple,” display “ProRAW” in an alert.
  8. If the photometric interpretation is 34892 and the make is not “Apple,” display “Linear RAW” in an alert.
  9. If the photometric interpretation is 32803, display “RAW” in an alert.
  10. Otherwise display “Unknown” in an alert.

The logic is that, since all ProRAW files are Linear RAW, and ProRAW is a format used only by Apple cameras, a Linear RAW file created by an Apple camera is a ProRAW file. However, Linear RAW has been around longer than ProRAW, so your phone may hold Linear RAW files created by other devices or apps. The shortcut will simply display those as “Linear RAW.” Any CFA file is displayed as “RAW.” Since ProRAW photos and RAW photos taken with an iPhone are always DNG files, this only works for DNG files. If the file has any other extension, the shortcut will just report the extension as the image type. (You can download the shortcut here.)

This approach is admittedly a little naive. Changes to the photo metadata could break the shortcut, but at least for now, it works. This is what it looks like when you run the shortcut from the share sheet.

Running the shortcut with a ProRAW photo
Running the shortcut with a ProRAW photo
Running the shortcut with a RAW photo
Running the shortcut with a RAW photo

How do you tell the difference on a Mac? I recommend using ExifTool. After you’ve installed ExifTool, open Terminal and enter this command:

exiftool -S -PhotometricInterpretation -Make /path/to/file.dng

(Replace /path/to/file.dng with the path to a DNG file.) It will display either

PhotometricInterpretation: Color Filter Array
Make: (Camera Make)

or

PhotometricInterpretation: Linear Raw
Make: (Camera Make)

where “(Camera Make)” is the name of the camera manufacturer.

You can use this information to determine if the DNG file is a ProRAW image, another type of Linear RAW image, or a regular RAW image. For example, for a ProRAW file, the command would display this output:

PhotometricInterpretation: Linear Raw
Make: Apple