Hi,
I'm doing something wrong, but I can't get what. Have thousands of photos with -artist value of (bs), set by my Canon 7D. I need to replace (bs) with bsprf. My attempts are with the exiftool-11.91 on Windows 10.
C:\Users\Bruno\Desktop\tmpfolder>exiftool -if "$artist eq ""(bs)""" -artist=bsprf -overwrite_original .
Error: Error reading StripOffsets data in IFD1 - ./026-IMG_7225.jpg
Error: Error reading StripOffsets data in IFD1 - ./046-IMG_7250.jpg
1 directories scanned
0 image files updated
2 files weren't updated due to errors
Strangely enough, this one works with no errors.
C:\Users\Bruno\Desktop\tmpfolder>exiftool -if "$artist eq ""(bs)""" -creator=bsprf -overwrite_original .
1 directories scanned
2 image files updated
I've tried to use -exif:artist="bsprf", and but the error persists.
Another thing: firstly, I've tested C:\Users\Bruno\Desktop\tmpfolder>exiftool -if "$creator eq ""(bs)""" -creator=bsprf -overwrite_original . and it worked, but Windows properties and Picasa properties still show (bs) - probably reading from artist and not from creator?
Thanks in advance!
Bruno
I've attached the -v5 log, hope this can help to understand what's wrong (but probably is some trivial oversight of mine...)
While it is possible to try and follow Windows weird rules on double quotes inside of double quotes, it's best to just use single quotes to enclose strings inside double quoted arguments. I've puts some spaces between the single and double quotes to make it easier to read. The spaces themselves won't affect the command in this case.
exiftool -if "$artist eq '(bs)' " -artist=bsprf -overwrite_original .QuoteI've tried to use -exif:artist="bsprf", and but the error persists.
This sets the value of
EXIF:Artist to "bsprf", it doesn't compare.
QuoteAnother thing: firstly, I've tested C:\Users\Bruno\Desktop\tmpfolder>exiftool -if "$creator eq ""(bs)""" -creator=bsprf -overwrite_original . and it worked, but Windows properties and Picasa properties still show (bs) - probably reading from artist and not from creator?
Windows (and many other programs) will read metadata from multiple different tags. Which value it uses seems to depend upon the actual location in the file in some way, as in my testing, it can vary between files. You can see what tags Windows reads for it's Properties->Details values in this post (https://exiftool.org/forum/index.php?topic=6591.msg32875#msg32875).
In the case of the Windows properly "Author", it will read from these tags:
EXIF:Artist,
IPTC:By-line,
XMP:Creator, and
EXIF:XPAuthor. I haven't check Picasa for this value but if it follows the same pattern as it does for other tags, then it's probably reading/setting
IPTC:By-line and
XMP:Creator.
EXIF:XPAuthor is pretty much a Windows only tag, very few other programs will read/write it.
Thanks StarGeek, I've tried your syntax (copy and paste from the reply to cmd window), but the error is just the same as before...
C:\Users\Bruno\Desktop\tmpfolder>exiftool -if "$artist eq '(bs)' " -artist=bsprf -overwrite_original .
Error: Error reading StripOffsets data in IFD1 - ./052-IMG_7256.jpg
Error: Error reading StripOffsets data in IFD1 - ./053-IMG_7257.jpg
1 directories scanned
0 image files updated
2 files weren't updated due to errors
C:\Users\Bruno\Desktop\tmpfolder>
BTW, I've tried it on more JPGs, just to exclude the corruption. Anyway, the reading works well, the writing fails
C:\Users\Bruno\Desktop\tmpfolder>exiftool -artist .
======== ./052-IMG_7256.jpg
Artist : (bs)
======== ./053-IMG_7257.jpg
Artist : (bs)
======== ./053-IMG_7257small.jpg
Artist : (bs)
I attached a scaled down original foto if you want to try it.
Kindest regards
Bruno
Oops, my mistake. I was so focused on the quotes thing that I didn't actually read what the errors were.
The EXIF block for that image has been written incorrectly. StripOffsets is not supposed to exist in jpg images. See FAQ #20 (https://exiftool.org/faq.html#Q20) for the fix. Do NOT run that fix on any type of RAW image, just jpgs.
I've tried the command exiftool -all= -tagsfromfile @ -all:all -unsafe -icc_profile bad.jpg, it gave errors, but it looks like it fixes the problem anyway. Here's the test repeated 4 times in the sequence as shown. Remains to understand what happened with those photos... Thanks a lot, StarGeek...
C:\Users\Bruno\Desktop\tmpfolder>exiftool -if "$artist eq '(bs)' " -artist=bsprf -overwrite_original .
Error: Error reading StripOffsets data in IFD1 - ./051-IMG_7255.jpg
1 directories scanned
0 image files updated
1 files weren't updated due to errors
C:\Users\Bruno\Desktop\tmpfolder>exiftool -all= -tagsfromfile @ -all:all -unsafe -icc_profile -ext jpg .
Warning: Not enough values specified (4 required) for ExifIFD:ComponentsConfiguration - ./051-IMG_7255.jpg
1 directories scanned
1 image files updated
C:\Users\Bruno\Desktop\tmpfolder>exiftool -if "$artist eq '(bs)' " -artist=bsprf -overwrite_original .
1 directories scanned
1 image files updated
C:\Users\Bruno\Desktop\tmpfolder>
Your second command gives a warning, not an error. Warnings don't stop the file from being written. It does, however likely indicate that ComponentsConfiguration wasn't copied.
- Phil
how would you use this exiftool -if "$artist eq '' " to compair and then change the artist if blank or filled in?
1. Use a -if condition to select the files you want to process.
2. Add a tag assignment to set the tags you want to write for these files.
For example:
exiftool -if '$artist eq ""' -artist="me" DIR
- Phil
when I run the command
exiftool -if '$artist eq ""' -artist="me" $directory
Error: File not found
The error is self explanatory. The file you specified doesn't exist.
I have a tiff file that dose not have an artist field that I am trying to work on. Is there away to work on a file with no artist field
There seems to be some problem communicating, so let's take it back to the basics.
What is the output of this command. Run it on the command line, not as part of any script. Replace /path/to/file.tif with the path to the tiff file.
exiftool -Artist /path/to/file.tif
when I run exiftool -Artist and path to my to tiff. I get the error 1 files failed condition. The file I am file has nothing in the artist feild
the command
exiftool -if '$artist eq ""' -artist="me" DIR
Do I need to first write a blank exif field artist
or how can i make sure the commd work if there is no feild in a image file?
Ok, I think I see the problem.
It sounds like the Artist tag doesn't exist in your file, but your initial question seemed to indicate that the tag existed, but had no content, i.e. it was a 0 length value.
Try
exiftool -if 'not $artist' -artist="me" DIR
exiftool -if 'not $artist' -artist="me" DIR
And get the fallowing results
1 directories scanned
0 image files read
there away to get it to add me if artist is blank? or get it to show me the result if the tad has something in it.
Your command is correct, but as the output shows, there aren't any files in the directory you gave exiftool. If there were files to process in that directory, you would have at least gotten "x files failed".
Did you forget to add the -r (-recurse) option (https://exiftool.org/exiftool_pod.html#r-.--recurse) to recurse into subdirectories?
I am getting the error
Error: Not a valid TIFF (looks more like a MacOS
when running the fallowing exiftool -if '$artist eq ""' -artist="me" dir
I change "me" to what I need the artist to be and dir to a file location
The file I am running on did not currently have an artist.
I would normally run this command to add artist
exiftool -r "$path" -r -overwrite_original -Exif:Artist="$Artist"
I would like to run it and have it only run on the files that are missing artist tag or update file that need it.
Duplicate post removed.
Check your quotes. If you're using Windows CMD, then use double quotes on the outside, single inside of that, e.g. -if "$artist eq '' ". The command you have listed would be what you would run under Windows PowerShell/Mac/Linux.
It would be very helpful if you remember to copy/paste you're entire output every time and use the [code][/code] button (https://exiftool.org/forum/Themes/default/images/bbc/code.gif) to format the output (and only the output) properly.
See this post (https://exiftool.org/forum/index.php?topic=4888.msg69111#msg69111)