Delete JPEGs Imported As RAW+JPEG

Josh and Ellen Anon have a very interesting post and discussion going on at O'Reilly. The topic is this: suppose you have lots and lots of images that were shot as RAW+JPEG in your Aperture library and you no longer want the JPEGs? They can use up a ton of space. How do you get rid of the JPEGs?

The short answer is that you don't. At least not with the tools supplied in Aperture, since Aperture treats the RAW file and the JPEG as a single composite master and won't let you do anything with them individually except create a new master from the JPEG. That new master can be deleted, but it doesn't buy you anything since the original JPEG is still there with the RAW file.

I have as technique that I think is better then Ellen and Josh's. It uses only the Finder and doesn't require any Terminal typing or scripts. And I don't leave any files behind. So without further ado, I'll show you what I do.

Here is a project called Yard shoot inside a blue folder:
All three of the images are RAW+JPG. Here they are:
I'll look inside the project to see how it is organized. I open up my Aperture library with control-click and select Show Package Contents, then navigate to the Z folder and then control-click on the Yard shoot project file and select Show Package Contents again. Here are all the files:
I can see the RAW files (CR2) and their JPEG (JPG)sisters. I can also see the apfiles which contain Aperture's information about the image files and the apmaster file that documents the master. What I want to do is to get rid of the JPG files and their apfiles, but leave the CR2 files alone and not leave the apmaster file in a state that will confuse Aperture. Also notice the JPEG files in there that are in the Previews and Thumbnails folders. Those are the previews used for iLife and other applications, and I may want to keep those.

1. Export the project

First I export the project to a temporary location. It looks like this:

2. Open up the project package

It's a package just like the library, so I control-click and select Show Package Contents to view its insides:

3. Find all the JPEG files in the package

I type .JPG into the search box top right and press return:
The Finder window changes to show me the apfiles and the images that match. I can tell the image files apart by looking at the pixel sizes underneath.

4. Select all the files and delete them

If I want to delete all the JPEG files (including the previews) then this step is easy. Select all with command A and delete them with command Delete. Command delete does not appear to do anything at all, but actually it has moved the files to trash. Close the window.

4a. or Select some of the files and delete them

If I want to delete only some of the JPEGs or if I want to leave the previews alone then I have to be selective. By command clicking on all the images that I want to delete, I can make a selection. I'm deleting the JPEGs for images 2563 and 2565 in this case, so I select those.

While it is not critical that the apfiles get deleted too it can be good to be neat. Making this additional selection can be made much easier with the following trick. Press command J to bring up the Finder view options and make sure that This window only is selected. Now select Group By Date and within the group, By Name:
The window changes, but the selections are still there:
Now I can easily command click the apfiles that immediately follow the images already selected and add them to my selection. I do that, and then press command Delete and close the window.

Now if I look in the exported project I see that the JPEGs I wanted gone are gone and the JPEGs I wanted to keep are still there:

5. Reimport the project into Aperture

I create a new blue folder for my project to avoid confusion, and drag the fixed project in:
Now the images I removed the JPEGs from no longer have the option to create a new master from the JPEG:

6. Clean up

After checking the project, I delete the temporary copy and the original. I am done.

Why do all this with an external project? One reason is that it is much safer to operate on a copy of the data than the original, so exporting the project satisfies that urge. The other reason is that the result is much neater. When the project is imported, Aperture does some checking and fixes up the apmaster files.

The original apmaster files have the JPEG listed (originalJPEGFileUUID):
But the fixed and imported image no longer lists the JPEG:
Hopefully Apple will add this facility into a future version of Aperture and we can avoid jumping though all these hoops entirely.
The Bagelturf site welcomes Donations of any size