0

I have long used wonderful exiftool to strip out exif data from images. Up to now, I've always done that in the same directory. Now I'd like to make it place the exif-stripped file in a different directory, and add a "my-original-file-name-NO-EXIF.jpg" in there. (The key thing is I want NO-EXIF to be AFTER the original file, but before the .jpg).

I have gotten it to place an identically named exif-stripped version by using this:

exiftool -o /home/dir/noexifdir/ -all= somefile.jpg

Is there any easy way to do this? I have been scouring the example sites but they're all about how to use it to completely change the filename based on date, time, etc.

All I want is the equivalent of somefile.jpg to become somefile-NO-EXIF.jpg (on that output directory). Not an identically named file as the original.

It seems like it should be easy...but clearly I'm needing help. Anyone out there know what the correct command would be?

(Also, I need this to be within the actual "exiftool" command. Not part of a bigger script!)

Edit: One wrinkle is that I am using this in a drag-n-drop launcher on my desktop. So I am not specifying the file directly, I am using the $1 variable which allows the command to be done on the file that's dropped.

1 Answer 1

0

See Example #9 on the exiftool's Writing "FileName" and "Directory" tags page.

exiftool -overwrite_original -Filename=/home/dir/noexifdir/%f-NO-EXIF.%e -all= somefile.jpg

Or, as mentioned in the third paragraph in the docs on the -o option

exiftool -overwrite_original -o /home/dir/noexifdir/%f-NO-EXIF.%e -all= somefile.jpg

8
  • I don't think this is what I'm trying to do, but I think you gave me a big clue towards it. I searched for the variables %f and %e and couldn't find them...but that's a big help. I don't think I need to overwrite the original (and don't want to!). More in a bit!
    – confused
    Commented Apr 13, 2020 at 18:09
  • (And sorry, I see now that the way I wrote it makes it sound like I DO want to overwrite the original file, but what I meant was that I want the "somefile.jpg" that gets placed in the -o location to have "no-exif" in it.
    – confused
    Commented Apr 13, 2020 at 18:11
  • I tried that -o /home/dir/noexifdir/%f-NO-EXIF.%e line and unfortunately got a file named "-NO-EXIF" in that "noexifdir" directory. I need it to include the original filename so that I can refer back easily to the original if I need to.
    – confused
    Commented Apr 13, 2020 at 18:19
  • To clarify, I edited the original post, too. Again, thank you for your help!!
    – confused
    Commented Apr 13, 2020 at 18:19
  • So it turns out that these variables don't work with the drag-and-drop. But when I type it on a regular command line, it's perfect, just like you suggested. And when I put it into a script and ran the SCRIPT from the launcher on the desktop, it was fine too. Worked perfectly. So thank you!! Nice to have this doing what I want it to! :-)
    – confused
    Commented Apr 13, 2020 at 18:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .