# Best way to separate JPG from RAW+JPG pairs



## process (Feb 19, 2016)

Throughout the years I been shooting RAW+JPG now and then for various reasons, and now I've finally started the painstaking cleanup process of removing the JPG where there's a RAW equivalent in order to save disk space.

I've asked around and read about the subject but there doesn't seem to be one set, simple and failsafe way to do this. So far I've deleted paired JPGs for a couple year's worth of photos, but I think I might have figured a better way... tell me what you think:


NOTE: the whole process will be done in the *Library module*.
In the following example we've decided to work on a year's worth of photos from a folder named "2015". This folder in turn contains a number of sub-folders.

*Synchronizing (adding to the library) other (not JPG+RAW pair) photos*
First, since we're going to use the "synchronize folder" feature, ensure that there aren't files in your photo folders which haven't yet been added to the library, so we'll add them to the library now:

*1)* in the "*General*" section of "*Preferences*" where it says:
*[ ] Treat JPEG files next to Raw files as separate photos*
Turn that option *OFF* (so that JPG+RAW files show up as a single file in LR)
*
2)* decide on a folder you're going to work on (i.e. "2015" which would probably contain numerous sub-folders for that year with photos), then _right-click on the folder_ and select "*Synchronize folder...*". 
Any new photos should be added to the LR catalog.


*Preparing Collections and colour-labeling*
Now we need to prepare some Collections which will help us make the process quicker and easier. Also be prepared to colour-label photos so we can quickly, at a glance, determine which category a photo belongs to. This isn't essential, but will greatly ease the process as seeing the label is a lot quicker than reading what file type it is etc.
Naturally you need to ensure your photos aren't already colour-labeled (or you can remove them)! My colour-label scheme is as follows though you can decide on any colour you like (or have unused from before):
*2015 "Previous import" (after synchronizing)*: red label
 (these will be the JPG files belonging to their RAW counterparts for 2015 which we want to delete)
*2015 JPG files*: yellow label
 (these are all the existing JPG files for 2015. You want to keep these as they have nothing to do with the RAW files)
*2015 RAW files*: purple label
 (these are all the RAW files for 2015)


*3)* Now, create the following Collections:
* 2015 "Previous import" (after synchronizing)
 2015 JPG
 2015 RAW
 2015 RAW+JPG*
If you like you can also create a Collections-set (i.e. "2015 RAW+JPG cleanup") to put them in.

*4)* First we need to label all the JPG files from BEFORE adding the JPGs which belong to RAW files. As mentioned earlier I've chosen a yellow colour for this, so....
*click on the "2015" folder* to see all the photos for that year. Next, click on "*Metadata*" (in the "_Library filter_" section) and choose a preset for *file-type*. *Click on "JPG*" which will display just the JPG files for 2015.

*5)* Now select all of those JPGs (*CMD-A* on a Mac, I assume that'll be *CTRL-A* on a PC), then *click on one of the photos' colour-label*, select "*Yellow*" which will give all of those JPGs a yellow label


*Synchronizing (adding to the library) JPGs from RAW+JPG pairs*
Now we're going to add the JPGs belonging to the RAW files (and since we're already synchronized the folder prior to this, the upcoming sync should contain nothing else):

*6)* go to the "*General*" section of "*Preferences*" and turn *ON* the following option, like this:
*[x] Treat JPEG files next to Raw files as separate photos*
This will separate the JPGs from RAWs.

*7)* Now, right-click on the "2015" folder and select "*Synchronize folder...*"
All the JPGs from their RAW counterparts should be added to the library.

*8)* On the left pane (under "_Catalog_" at the very top, click on "*Previous import*" where you should see a number of files. *Select them all* (*CMD-A* on a Mac or *CTRL-A* on a PC), then *drag them over* to the  "*2015 "Previous import" (after synchronizing)"* Collection.

*9)* It's also a good idea is to rename that Collection to include the number of images it contains, i.e.:
*  2015 "Previous import" (after synchronizing)  (5983)*
(this is useful for a variety of reasons such as knowing how many files have been deleted and comparing it to other folders etc. as an extra safety feature before deleting stuff).

*10)* Remember to *colour-label "Red" all the photos in that Collection* ("*2015 "Previous import" (after synchronizing)  (5983)*").

*11)* *Click on the "2015" folder again*, then use the "*Metadata"* filter as before, only this time select "*RAW*" as the disoplayed file-type. Select them all *Select them all* (*CMD-A* on a Mac or *CTRL-A* on a PC), *click on the colour-label of one of the photos*, select "*Purple*" which will give all RAW files a purple label.

*12)* While still having all those RAW files selected, *drag them over to the "2015 RAW" Collection*. *Rename the Collection* to reflect the number of RAW files within (i.e. "*2015 RAW  (9389)*").

*13)* *Click on the "2015" folder* again, click on the "*Metadata*" filter as before, now, as the file-type *click on JPG, and while holding down CMD, click on "RAW"* (Mac). This should select both JPG and RAW files.  
(I assume on a PC you'd click on "JPG", then while holding down CTRL, click on "RAW")

*14)* Drag all those files over to the "*2015 RAW+JPG*" Collection. Rename the collection to reflect the total number of files within.

*
Marking JPGs (from RAW+JPG pairs) ready for deletion*
The preparation process is finally over and we're ready to actually delete the JPG files which we already have RAW files of. If you're feeling brave you could just delete all the files within "Previous import" but you may want to reconsider and ensure you're not making a mistake, so here's the more time consuming but safer way.....

So now we've grouped our photos in Collections and by colour-labels. If everything's worked out the way it should all red photos should be the JPG counterparts of the RAW files while the yellow files are all the JPGs from before (i.e. stand-alone JPGs, which of course we want to keep).

*15) Click on the "2015 RAW+JPG" Collection* which should display all your RAW and JPG files from 2015 (note: the number of files may differ from what your 2015 folder says as the folder may also contain other file-types such as PNG, TIFF, PSD and videos).

This collection is sort of a non-destructive testing ground for deleting stuff. Remember, in a collection we're not actually deleting files from a hard drive but removing them from that specific collection. We can now browse throught our collection (colour-labeling makes it easier), then mark the JPGs we want deleted with a "Reject" (X), and (once double-checked) we can actually commit to deleting those files from the hard drive.  

*16)* *Browse through the images* and *look for identical pairs*. If you find two identical photos you should have one which is labeled red (JPG) and one which is purple (RAW). You may have other identical photos which could be a copy of the JPG (possibly edited, which you don't want to delete). The JPGs which don't belong to a RAW file should be yellow -just leave those alone.

Depending on your "View options" you could have the file-type displayed and info about it being a virtual copy and so on. This will be of great help.
So, once you locate a *JPG which has an identical RAW*, *click on that JPG and press the "X" key* (reject).


*A final safety measure, then deleting the JPG duplicates*
*17)* When you're done, *create a new Smart Collection* as an extra safety measure before actually deleting the "reject" marked files with the following settings:
*
Match [any] of the following rules:
[Pick flag] [is] [rejected]*

This Smart collection should then display all the rejected files. Here you can also ensure that you haven't rejected any RAW files (use the "Metadata" filter for "File-type" as before, selecting "RAW") which you definitely don't want to do! You can also use other filters if you feel the need, to ensure the files match the criteria of just being JPG counterparts of existing RAW files. 
A couple of ideas would be to *check for edited virtual copies*, or *yellow colour labels* -both files you want to keep.

*18)* Finally, after double (or triple) checking you're ready to delete the JPG duplicates. You may want to *compare the number of rejected files with the number of "Previous import..." files*. Ideally they should be the same. If not, recheck what's in the "Rejected" Smart Collection.
So when you're ready to delete all those rejected files, click on the "2015" folder (it's not possible to physically delete files from a Collection/Smart Collection), then go to *"Photo"-"Delete rejected photo"*. Depending on your collection you should have regained a fair bit of hard drive space, and not to mention cleaned up your photo library.



Phew!  I realize the above seems like an awful lot of work, but really it's not that bad.
Tell me what you think and let me know if I've made any mistakes or there are better ways around.


----------



## tspear (Feb 19, 2016)

I asked a similar question:
DNG and JPG Clean Up

Tim


----------



## Rob_Cullen (Feb 19, 2016)

By my logic- would this work?

1. Turn option *OFF  [ ] Treat JPEG files next to Raw files as separate photos * (so that JPG+RAW files show up as a single file in LR)
2. Import everything from ALL folders from the top hierarchy including sub-folders.
3.  Turn option *ON  [/ ] Treat JPEG files next to Raw files as separate photos. (Restart Lr)
4. Re-run step 2.  (This will import the 'copy' JPGs )
5. Select ALL photos in the "Previous Import"- Press [Delete].

I am thinking- 
Step 2. will import any photos that are not in the catalog AND do NOT have an accompanying JPG. Including JPGs that exist "Alone".
Step 4. will only import the 'accompanying' JPGS that match RAWs already in the catalog.

The flaw in this method occurs if you have edited the 'paired' JPGs outside of Lightroom- such as opening in Photoshop direct from File Explorer/Finder.*


----------



## Ian.B (Feb 20, 2016)

personally I would leave them a start a better system from now. I have just done some raw / jpg experiments and yes; raw and jpg is, or could be a _real pain_  long term :(.


----------



## process (Feb 20, 2016)

I-See-Light said:


> By my logic- would this work?
> 
> 1. Turn option *OFF  [ ] Treat JPEG files next to Raw files as separate photos * (so that JPG+RAW files show up as a single file in LR)
> 2. Import everything from ALL folders from the top hierarchy including sub-folders.
> ...



Good catch!
I guess any edits _outside_ of LR wouldn't have the "edited" label in LR so it would be hard to distinguish from non-edited files, right?
You're talking about non-LR edits of the actual JPG files that belong to their RAW counterparts, resaved with the same name, not copies of them, right?
I don't know for sure, but I would think that a copy (i.e. a copy of the original JPG with a slightly different different name such as "IMG_2498 copy.JPG") would be shown in LR regardless of the RAW+JPG option being turned on or off and in my example above be coloured yellow, as being an already existing JPG.
I assume LR pairs up RAW+JPG files based on the same filename but with a different extension (i.e. "IMG_2498.JPG" and "IMG_2498.CR2") so anything else would probably not be included in the pairing.

In any case, in step 16 I suggest _browsing_ through all images so you can physically inspect each one (the colour-labeling makes it a lot quicker and easier) as an extra safeguard against these kind of things.

UPDATE: to speed things up further you could of course mark all of the red labeled JPGs (those belonging to a RAW file) up front by selecting them all, then pressing "X" (reject). And the browsing would just involve visually comparing those rejects with their RAW counterparts.
Another thing I missed out from step 16 is to set the image sorting to "Captured date" (*"Photo"-"Sort"-"Capture time"*). This way you'll see the JPGs next to their matching RAW counterparts.


----------



## Rob_Cullen (Feb 20, 2016)

Keep at it. Tim.
I like the logic of Ian.

Re: my logic-
Yes, in step 4. I was referring the 'paired' jpg files.
And- yes the method could delete edited jpgs that keep their original filename.

Although the 'Previous Import'  could be made into a collection (without deleting!) then decide if you want to keep/delete any of them by viewing the collection.

Tick the Import option [Add to collection]


----------



## rob211 (Feb 20, 2016)

I seem to recall I used Syncomatic to find pairs, then made sure the metadata I had at times accidently put in the JPEGs was copied to the RAWs, added a keyword like "pair" to both, filtered on that and "jpeg" file type and then deleted.


----------



## johnbeardy (Feb 20, 2016)

rob211 said:


> I seem to recall I used Syncomatic to find pairs, then made sure the metadata I had at times accidently put in the JPEGs was copied to the RAWs, added a keyword like "pair" to both, filtered on that and "jpeg" file type and then deleted.



I suspect you added "pair" to all the RAWs, then ran Syncomatic to ensure the corresponding JPEGs also got that keyword. You could then identify the JPEGs with "pair" which were not needed.


----------



## [email protected] (Feb 23, 2016)

Why not just delete jpgs from folder in Windows or move them to a different folder if you want to keep them.  Then when LR can't find them just delete catalog entries with question mark?


----------



## Ian.B (Feb 23, 2016)

[email protected] said:


> Why not just delete jpgs from folder in Windows or move them to a different folder if you want to keep them.  Then when LR can't find them just delete catalog entries with question mark?


 in my case, there would be other jpg files that are not part of the raw-jpg original that would be needed to be kept. Files like scanned negatives/files from before the _rawing _days 
One thing that bugs me is the number of tiff/psd files we seem to save while editing but never think of deleting. One of the great parts about LR/virtual copies although I wish I could choose which side of the dng the psd/tiffs files and virtual copies live.


----------

