tagsFromFile and missing tags

Started by Kim, March 12, 2021, 04:29:15 AM

Previous topic - Next topic

Kim

Hey everyone!

I'd like to start by giving a huge thank you to Phil and everyone involved in the creation of this wonderful tool.

Now, I'm new to this but I'm trying to run a command line every time someone uploads an image to my server. The goal is to strip the image of all tags except Orientation and ColorSpaceTags. This is what I've got at the moment:
exiftool -all= -tagsFromFile @ -Orientation -ColorSpaceTags -overwrite_original somefile.jpg

This works great until someone uploads a file that is missing the tags I want to keep. That's when I get the following error:
Warning: No writable tags set from somefile.jpg
    0 image files updated
    1 image files unchanged


So my question is... how do I tweak this to do what I want and just be okay with tags missing sometimes?

Phil Harvey

The command is already doing what you want.  You will get this warning if the file contains no metadata.  But in this case you don't want the command to do anything, so all is good.

- 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 ($).

Kim

It seems my testing was insufficient. Thanks for your help and sorry for wasting your time! :)