News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Need to rename artist...

Started by brunos, March 07, 2020, 08:44:42 AM

Previous topic - Next topic

brunos

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

StarGeek

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.

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:CreatorEXIF:XPAuthor is pretty much a Windows only tag, very few other programs will read/write it.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

brunos

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

StarGeek

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 for the fix.  Do NOT run that fix on any type of RAW image, just jpgs.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

brunos

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> 

Phil Harvey

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

j99mac

how would you use this exiftool -if "$artist eq '' " to compair and then change the artist if blank or filled in?

Phil Harvey

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

j99mac

when I run the command
exiftool -if '$artist eq ""' -artist="me" $directory

Error: File not found

StarGeek

The error is self explanatory.  The file you specified doesn't exist.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

j99mac

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

StarGeek

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
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

j99mac

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

j99mac

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?

StarGeek

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
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).