Convert .dng to .jpg
I had a batch of .dng files that should be converted to .jpg format. I tried a few ways, but they did not preserve all the exif metadata. My process documented below does.
-
Use Irfanview to batch convert all .dng files to .jpg. This will strip a lot of the metadata.
-
Add in metadata from original file.
time for word in *dng ; do exiftool -all= -tagsfromfile "${word}" -exif:all "${word%%.dng}.jpg" ; done
This command syntax is verbatim from the man page for exiftool.
-
Apply original timestamp.
for word in *dng ; do touch --no-create --reference "${word}" "${word%%dng}jpg" ; done
-
Optionall, remove the original files.
rm $( for word in *.jpg ; do echo "${word%%.jpg}.dng" ; done ; )
References
Man pages
exiftool(1p)
Comments