News:

2023-08-10 - ExifTool version 12.65 released

Main Menu

Exif User Comment Edit

Started by Winston, February 09, 2018, 06:45:48 AM

Previous topic - Next topic

Winston

Is there anyway that I can copy the format of the incorrect formatted image to a correctly formatted image?

Phil Harvey

This is what I have just shown you how to do using the config file I provided, which will write in the incorrect format to any type of file.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Winston

I have tried the config file. It seems like does not change the format of the files. It just updates the values and keeps it in the same format.

Phil Harvey

You have to be more specific.  The new config file will write the UserComment incorrectly as a string instead of the standard EXIF format.  Is this the format you are talking about?  If so, what do you mean when you say it isn't changed?  And what are you doing to determine the format?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Winston

I don't know alot about specific formats. But here is a screen shot of the config file. The only difference I can see is the ASCII in the user comment that is working for me.

Phil Harvey

If the ASCII UserComment works for you, then you don't need the config file.  The config file writes the UserComment without the standard ASCII header.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Winston

I meant that the ASCII header doesn't work.  :-[

If I use the config file it doesn't always write it without the ASCII header.

Phil Harvey

The config file will write a new UserComment without the ASCII header, or copy an existing UserComment without changing its format.  If you want to remove the ASCII header from a properly-formatted UserComment, use this config file:

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Exif::Main' => {
        0x9286 => {
            Name => 'UserComment',
            Format => 'undef',
            Writable => 'undef',
            ValueConv => '$val =~ s/^ASCII\0+//; $val',
        },
    },
);
1; #end
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).