## Archive for June, 2012

### Lightroom – export original in-camera JPGs

June 2, 2012

I’ve searched around a bit and could not find a way to filter a certain subset of photos and copy (export) the original JPGs from the camera, unmodified, into a new folder.

• Export has an “Original” file format, which comes out as .CR2 for me, as I shoot RAW+JPG
• Even if I shoot JPG in-camera, export to the “Original” format will add additional metadata, not providing the original camera JPG.

Here’s a hack solution: Export the files anyways, with modifications and all, just to use the filenames. Then use a script to copy those filenames from the original source’s folder to your destination folder.

If this was Linux, I could write a one-liner in my head:

for file in ls /path/to/picked-set/*.jpg; do cp /path/to/originals/\$file /path/to/destination/; done

But this is Windows, so some quick Googling led me to my answer.

FOR /F "tokens=*" %G IN ('dir/b ^"\path\to\picked-set\*.jpg^"') DO copy "\path\to\originals\%G" \path\to\destination\

You can also add a “~n” between the “%G” (making it “%~nG”) to remove the file extension, in the case that you want to use the JPG filenames to copy the CR2/RAW files. Something like this:

FOR /F "tokens=*" %G IN ('dir/b ^"\path\to\picked-set\*.jpg^"') DO copy "\path\to\originals\%~nG.CR2" \path\to\destination\

Yay!