0

I have a folder full of DNG and JPG files like

IMGP0001.DNG
IMGP0001.JPG

and I want to rename them to

20190725-133012-IMGP0001.dng
20190725-133012-IMGP0001.jpg

respectively.

I am currently using these exiftool args

 exiftool -d '%Y%m%d-%H%M%S-%%f.%%le' '-filename<CreateDate' '-FileCreateDate<CreateDate' '-FileModifyDate<CreateDate' -fileOrder DateTimeOriginal -ext mp4 -ext jpg -ext heic -ext mov -ext dng ./**/*

It handles a bit more then DNG and JPG files and I'd like to keep it that way, since my folders can be mixed with different image and video format files.

I think I'd have to specify a source for the EXIF data extraction, which would be the DNG or JPG (they seem to have the exact some createDate in them). But in case a MOV or MP4 would have to be renamed, the tagsFromSource arg might not work.

  • 4
    This "question" has no question. – xiota Jul 24 at 23:34
  • Not in one go... After renaming the JPGs, you can rename the DNGs to assume the name of the JPG they are associated with: for d in *.dng; do echo mv $d $(basename *$(basename $d .dng).jpg .jpg).dng ;done – xenoid Jul 25 at 0:21
  • 3
    I recommend you taking this to Stackoverflow as its not all that related to photography. Writing a program such as this is quite easy in eg Python. – timvrhn Jul 25 at 5:57
  • 1
    Are you asking if you can rename the .DNG files based upon the CreateDate in the .JPG file (or vice versa)? Does one of the file not have a CreateDate value? I would think it would be easier to make sure both files have proper timestamps, but take a look at this exiftool forums post for some details on how to rename both files based upon metadata in one of the files. You may have to use a separate command to handle the video files, though. – StarGeek Jul 25 at 17:14
  • 1
    I figured out the DNG and JPG contain the exact same timestamps so I can just rename them based on their EXIF info which turns out to work great. Thanks all for your help! – philk Aug 7 at 8:38
1

I have used for all my renaming needs, images and general files, Bulk Rename Utility. Works like a charm for me every time. You can make pretty complex bulk changes with it.

screenshot

  • Thanks. I prefer a command line tool to run it headless, though. – philk Aug 7 at 8:37
  • Bulk Rename Utility also has a command line tool. Check their website for more details. – Ian Trolles Aug 7 at 9:26
  • @IanTrolles Given the ./**/* in the question, and the reference to running "headless", OP is likely not using Windows, so the program you recommend wouldn't work. – xiota Aug 7 at 18:14
  • If the OP uses Linux there is pyRenamer and if Mac there is Transnomino, if Finder itself cannot get the job done. – Ian Trolles Aug 7 at 18:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.