Retaining EXIF data for extracted NEF preview

Started by syousef, May 06, 2018, 07:31:09 PM

Previous topic - Next topic

syousef

Hi,

I'm a sporadic user but I want to thank everyone who's contributed in any way to this excellent piece of software and of course especially to Phil Harvey.

I'm having a small problem incoporating it into my workflow and couldn't find anything online that might guide me. (Apologies if it has been asked and I missed it).

I need to extract JPG previews for a large number of files (around 18,000 this time round). I have been using the following command:
exiftool -b -JpgFromRaw -w _exiftoolJpgFromRAW.jpg -ext NEF -r "%1"

This nicely extracts the preview, but does not embed the original EXIF data in the extracted preview. Is there a way to do that?

I have a ridiculous number of images overall taken over the last decade and a half. The extracted images are of little use to me without the metadata. At a minimum I need the date/time created, so I can refer back to the original NEF, but ideally I would like the entire set of metadata, so that I don't have to.

Thanks.

Phil Harvey

Try this:

exiftool -b -JpgFromRaw -w _exiftoolJpgFromRAW.jpg -execute -tagsfromfile @ -srcfile %d%f_exiftoolJpgFromRAW.jpg -common_args -ext NEF -r "%1"

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

syousef

Phil, you are a legend.

Note that in a windows cmd file you need to escape the % with another % for %d and %f.
So the contents of my extractJPGPreviewFromNEF.cmd file looks like this:

exiftool -b -JpgFromRaw -w _exiftoolJpgFromRAW.jpg -execute -tagsfromfile @ -srcfile %%d%%f_exiftoolJpgFromRAW.jpg -common_args -ext NEF -r "%1"

You then have to delete the .jpg_original files that are the JPGs without the exif data added back in. I prefer to do that manually rather than add it to the script.

Thanks for your assistance.

Phil Harvey

In this case it is safe to add -overwrite_original after the -execute to avoid saving the "_original" files since you already have a backup of these in the RAW file.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).