Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

FYI: Generate custom Finder icon for RAW images (even if image format is not supported by macOS)

The method relies on 3 distinct parts (click on links for information/download).



The example below is based on Canon's CR3 RAW image format (supported since Big Sur). Workflow assumes images are located in ~/Pictures.


DNG Converter Configuration

Run the workflow in Automator (or create a standalone app from Automator). Workflow can easily be customized for other RAW images formats (see below).



Sample Output





Mac mini, macOS 12.2

Posted on Feb 14, 2022 7:37 AM

Reply

Similar questions

17 replies

Feb 14, 2022 12:19 PM in response to BlueberryLover

Another approach that does not use Adobe DNG converter, and instead uses the free third-party tool ExifTool.


In this case, it is an AppleScript that determines if ExifTool is installed and quits otherwise. It prompts for images of type public.camera-raw-image and then using that selected RAW image, will extract its internal icon data to a temp file. It then converts that temp data into an NSImage and proceeds to set the icon image on the RAW image.


# raw_icon.applescript

# extract the icon data from an unsupported camera RAW image and then set that image
# data on its icon.
# Dependency: ExifTool (https:exiftool.org) which installs into /usr/local/bin.
# Tested: macOS Big Sur 11.6.3, Exiftool 12.37

use framework "AppKit"
use AppleScript version "2.4" -- Yosemite or later
use scripting additions

property NSImage : a reference to current application's NSImage
property NSWorkspace : a reference to current application's NSWorkspace

# get the shell so we know which source statement to use below to get PATH info
set shell to (do shell script "echo $SHELL")

if shell is "/bin/zsh" then
	set XIF to (do shell script "source ~/.zshrc;/usr/bin/which exiftool")
else if shell = "/bin/bash" then
	set XIF to (do shell script "source ~/.bash_profile;/usr/bin/which exiftool")
end if

if XIF is missing value or XIF is "" then
	display alert "Need ExifTool installed." giving up after 10
end if

# only allow camera RAW images
set theImage to POSIX path of (choose file of type {"public.camera-raw-image"} default location (path to desktop) without invisibles) as text

# now check if the RAW image really does not have an icon set on it and quit if it does
try
	# returns 13 if sips cannot extract icon from RAW image when it is not supported by camera RAW db
	set ret to (do shell script "sips -i " & theImage & " > /dev/null; echo $?")
	if ret = 0 then return # because image was on it
on error number -128
	# user canceled
	return
end try

# extract the image icon data from the RAW file
do shell script XIF & " -a -b -preview:all " & theImage & " > /tmp/XXImage.png"
set thisImg to NSImage's alloc()'s initWithContentsOfFile:"/tmp/XXImage.png"
set status to ((NSWorkspace's sharedWorkspace)'s setIcon:thisImg forFile:theImage options:0) as boolean
tell application "Finder"
	delete POSIX file "/tmp/XXImage.png" as alias
	if status then reveal POSIX file theImage as alias
end tell
return


For the Nikon Z fc RAW image:


From:

To:

Feb 14, 2022 12:55 PM in response to VikingOSX

Thanks for the reply.


Actually, I'm using both DNG Converter and exiftool (I recall that I had encountered an issue getting the preview image from HEIC files using exiftool). DNG Converter performs conversion for a large number of RAW formats and also can include a jpeg preview in the DNG file. It's this jpeg preview that I use to create the custom icon for the RAW file.


I posted this as someone had expressed a dislike for white borders displayed by finder.



Feb 17, 2022 7:43 AM in response to BlueberryLover

I've updated the workflow (same link as above) to check for the presence of Exiftool. The workflow now skips over images which already have a custom icon (i.e. com.apple.FinderInfo extended attribute). Last, I realized that the CR3 file extension would need to be changed in a few places in the workflow in order to be used with another RAW file format.




Apr 10, 2022 2:06 AM in response to BlueberryLover

Hi there,


I'm trying to configure this for my A7IV files and I could not get it to work. I'm not sure if I'm doing something wrong but I tried to follow the steps in the READ ME file and I'm getting the error below. Should I change something in Automator app? For a life of me I can't figure out what I'm doing wrong. Any insights are highly appreciated.


Macbook Air M1 // Big Sur 11.5

Apr 10, 2022 5:09 AM in response to PandaMedo

The Automator script defaults to CR3 if no extension is specified (see below) . The value is stored in the Start RAW Preview Batch script file. By any chance, did you change the location of any of the files (the folder should be placed in ~/Pictures)?



As a test, delete the set RAW Preview folder and download a fresh copy. Re-do your test but this time first rename the RAW files to CR3. If this works then it would seem that the problem is related to passing the RAW extension.


I'm not sure why this wouldn't be working as I tested the Automator apps using RAW files that aren't currently supported by macOS.


- Pie Lover


Apr 10, 2022 8:57 AM in response to BlueberryLover

Hey,


First of all thanks for a quick reply, I really appreciate it! I did few tests:


1) I placed four RAW (.ARW) files in the folder and as advised I changed the file names from .ARW to .CR3 (for 3/4 photos) and it worked! The thumbnails for .CR3 were updated


2)

A) After that I ran the "Start RAW Preview Batch' again (NOTE: currently in the folder there are three .CR3 files and only one .ARW)

B) When I got ask to select extension I entered ARW (screenshot below)


C) Selected the same folder as in the first test

D) Got a notification that three icons were not replaced:


It seems that AWR extension is not being picked by the script? Do you maybe have any idea on how to correct this behavior or if you have a scrip that defaults to .AWR files that would be awesome!


Thanks in advance :)


Apr 10, 2022 11:17 AM in response to PandaMedo

I think that confirms what we both suspected. The error message is D) is by design (the Automator script checks if there's an existing custom icon).


Perhaps, the easiest method would be to replace "CR3" with "ARW" in the line that I had highlighted in the screenshot. You can modify the set RAW Preview Automator script and then convert it to an Automator app (make sure to replace the existing app in the set RAW Preview folder).


Good luck!


- Pie Lover

P.S. I tried specifying an ARW RAW file and it seemed to work in my environment. I'm not sure what would be different in yours.

FYI: Generate custom Finder icon for RAW images (even if image format is not supported by macOS)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.