Swiss German Umlaute

Started by anca, April 19, 2016, 06:17:35 PM

Previous topic - Next topic

anca

I created a batch-file and I would use Swiss German Umlaute for my Name "André" into the Copyright field of all .jpg-files in this directory.
I not understand how I have to implement this into a batch-file


@echo off
for %%i in (*.jpg) do (
exiftool -iptc:CopyrightNotice="André" "%%i"
del tmp.xmp /Q
)


With this Batch the Copyright Change to Andr without the é
If I open a CMD-Window and check with chcp, the active Codepage is: 850





StarGeek

This is partially a FAQ 18 and FAQ 10 but the addition of using it in a batch file adds more problems.  You can do some google searches about accented characters in batch files and try some of the answers there, but none of them ever worked for me.

My personal solution with batch files has been to use the -E option and use html entity codes for accented characters and such in tags (though it won't work for filenames or directories).  In this case, you could use
-E -iptc:CopyrightNotice="André".

Additionally, you don't need to loop through the files.  It'll be much faster to use this command, as it will call ExifTool only once rather than once every file:
exiftool -E -ext jpg -iptc:CopyrightNotice="André" TargetDir

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

anca

#2
Thany you very much. The solution with é works with the IPCT-infos but not for the EXIF-Infos. I see only: Andr   on the Copyright and Artist field.

Sorry, the code on my first entry was incomplete. I have now optimized the code with your second proposal:



@echo off

for %%i in (*.jpg) do (
exiftool -TagsFromFile "%%i" -AllDates tmp.xmp
exiftool -all= "%%i"
exiftool -TagsFromFile tmp.xmp "%%i"

del tmp.xmp /Q
)

exiftool -E -ext jpg -Copyright="André" *
exiftool -E -ext jpg -Artist="André" *
exiftool -E -ext jpg -iptc:CopyrightNotice="André" *
exiftool -E -ext jpg -iptc:Writer-Editor="André" *


StarGeek

Quote from: anca on April 20, 2016, 01:26:11 AM
The solution with é works with the IPCT-infos but not for the EXIF-Infos.

This can be fixed with info from the FAQ 10 I linked above (something I just learned).  If you scroll down that FAQ, it mentions some of the differences in how character sets are handled in the various metadata groups.  In the case of the EXIF group, we can add -charset exif=Latin to fix it (though a different character set may be needed for other character types, like Cyrillic, for example).

QuoteSorry, the code on my first entry was incomplete. I have now optimized the code with your second proposal:

We can optimize this even further and make it a one (long) line command.

First, we can get rid of your loop.  We'll remove all the data with -all= but we'll make an exception for AllDates with --AllDates (note the two hyphens) so that data isn't removed.  Next, add in the charset line from above.  Then we can just put all your new data in.  Now try this command and see if it works for you.  I haven't tested it but I think it should work (it's late and I'm heading for bed).

Exiftool -E -ext jpg -charset exif=Latin -all= --AllDates -Copyright="André" -Artist="André" -iptc:CopyrightNotice="André" -iptc:Writer-Editor="André" *


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

anca

You are a genius !!!!  Thank you :D