ExifTool Forum

ExifTool => Archives => Topic started by: Archive on May 12, 2010, 08:54:15 AM

Title: Problem updating makernotes on JPG files
Post by: Archive on May 12, 2010, 08:54:15 AM
[Originally posted by andrewj on 2008-02-07 22:27:51-08]

Hi,

I have until recently being developing my Canon RAW files using PS Elements, and using the following script to copy the Exif Makernote info from the CR2 file to the JPG:

    exiftool -k -tagsfromfile [CR2name] -makernotecanon -make -model [JPGname]

This has worked fine, and the makernotes are readable by all programs I've tried.

However, I'd prefer to develop my RAW files directly using Bibble. When I try the same command on a JPG file created using Bibble, I get an odd "empty" makernote which ExifTool and PhotoMe can read, but some other programs (e.g. Exifer and XnView) show as an empty Makernotes section with no content.

Any idea why this is happening and if so how to fix it?

Thanks
Andrew
Title: Re: Problem updating makernotes on JPG files
Post by: Archive on May 12, 2010, 08:54:15 AM
[Originally posted by andrewj on 2008-02-08 08:21:44-08]

PS: I have checked, and omitting the -make and -model flags makes no difference.
Thanks, Andrew
Title: Re: Problem updating makernotes on JPG files
Post by: Archive on May 12, 2010, 08:54:15 AM
[Originally posted by exiftool on 2008-02-08 13:34:57-08]

Without seeing a sample image I would only be guessing, but
my guess would be a byte order problem.  Some software
has trouble processing the makernotes if they have a different
byte order than the rest of the EXIF information.  What does
exiftool show for the ExifByteOrder of an image produced by
PS Elements and Bibble?

- Phil
Title: Re: Problem updating makernotes on JPG files
Post by: Archive on May 12, 2010, 08:54:15 AM
[Originally posted by andrewj on 2008-02-08 14:58:24-08]

Dear Phil,

Good guess. The Bibble JPEGs are Big-Endian, while the PS Elements JPEGs are Little-Endian. Is there any way to use ExifTool's ByteOrder / ExifByteOrder options to fix this? - I can't see anything in the documentation.

Thanks, Andrew
Title: Re: Problem updating makernotes on JPG files
Post by: Archive on May 12, 2010, 08:54:15 AM
[Originally posted by exiftool on 2008-02-08 19:52:28-08]

Hi Andrew,

You can't find anything in the documentation because there is
far too much of it, and it is poorly organized.  Tongue

If you look at the ExifByteOrder documentation in the Extra Tags
table of the html Tag Names documentation, you will see that you
can write this tag.  Setting the value of this tag defines the byte
order to be used when creating a new EXIF segment.  Note that this
only works if the EXIF segment didn't exist before (because ExifTool
will NEVER change the byte order of an existing record -- this is just
plain stupid, although many utilities commit this insane act).  So
to do this you must first erase the exif information completely
with "-exif:all=", then in a second command you can copy
all the tags from the source file while specifying the new byte
order.

I hope this helps.

- Phil
Title: Re: Problem updating makernotes on JPG files
Post by: Archive on May 12, 2010, 08:54:15 AM
[Originally posted by andrewj on 2008-02-08 21:28:35-08]

Dear Phil,

It may be the solution, but I can't get ExifTool to accept the option. What is wring with this command line (which should remove all exif and then recopy it with correct byte order)?

c:\utils\exiftool -exif:all= -tagsfromfile 1007_350D_8217_BP.jpg -exifbyteorder="II" -exif:all 1007_
350D_8217.jpg

If I can get this working, your solution should work.

Thanks
Andrew
Title: Re: Problem updating makernotes on JPG files
Post by: Archive on May 12, 2010, 08:54:15 AM
[Originally posted by exiftool on 2008-02-09 13:20:20-08]

Hi Andrew,

As I said, this must be done in two separate commands.

But since this has come up before, I thought it would be
worthwhile to add the ability to do this in one step.  So
exiftool 7.16 will be able to do this.  I have uploaded a
7.16 pre-release
here
in case you want to test it out before the official release.

Just one point: The rules for setting the value of the
exifByteOrder tag are the same as for any other tag with
a converted value.  So you should use something like
"-exifByteOrder=little" instead of what you wrote.

- Phil
Title: Re: Problem updating makernotes on JPG files
Post by: Archive on May 12, 2010, 08:54:15 AM
[Originally posted by andrewj on 2008-02-10 07:08:29-08]

Dear Phil,

Changing to use "little" sorted this out. I haven't been able to test 7.16 as I use the compiled windows executable, but if you can make a version of that available I'd be happy to test it.

A further question: is there a way in the Windows executable command line of making this sort of change conditional based on existing values (i.e. I don't want to do this if the JPG is already little-endian, but I need to if it's big-endian)?

Many thanks,  Andrew
Title: Re: Problem updating makernotes on JPG files
Post by: Archive on May 12, 2010, 08:54:15 AM
[Originally posted by andrewj on 2008-02-10 07:14:55-08]

Dear Phil,

Just a thought: if you are looking at this area could you add an option "As target" or similar to the exifbyteorder flag, meaning that the info is copied in the same format as the target file, not the source. This would obviate the requirement to write conditional code based on querying the target first.

Andrew
Title: Re: Problem updating makernotes on JPG files
Post by: Archive on May 12, 2010, 08:54:15 AM
[Originally posted by exiftool on 2008-02-10 13:09:10-08]

Hi Andrew,

You can use an -if option something like this to decide
whether or not you want to process a file:

Code:
exiftool -if "$exifbyteorder =~ /Big/" ...

Your "As target" idea doesn't make sense to me because you can
only set the EXIF byte order if the target contains no EXIF information.

- Phil
Title: Re: Problem updating makernotes on JPG files
Post by: Archive on May 12, 2010, 08:54:15 AM
[Originally posted by andrewj on 2008-02-10 16:49:15-08]

Dear Phil,

Thanks very much for your patience. However, combined with the new "set exif byte order in one go" option the above will do the job nicely.

Andrew
Title: Re: Problem updating makernotes on JPG files
Post by: Archive on May 12, 2010, 08:54:15 AM
[Originally posted by exiftool on 2008-02-10 21:17:18-08]

OK, great.

I will make the Windows version available when I release 7.16 officially,
which should be in about a week or so.

- Phil
Title: Re: Problem updating makernotes on JPG files
Post by: Archive on May 12, 2010, 08:54:15 AM
[Originally posted by andrewj on 2008-02-14 22:00:59-08]

Dear Phil,

I've tried to get this working with 7.16. Apologies if I'm being stupid, but how does the new feature work? I've tried the following:

c:\utils\exiftool -exifbyteorder=little 1007_350D_8217.jpg    (I was really hoping this would work)

c:\utils\exiftool -tagsfromfile "Copy of 1007_350D_8217.jpg" -exifbyteorder=little -exif:all 1007_350D_8217.jpg

c:\utils\exiftool -tagsfromfile "Copy of 1007_350D_8217.jpg" -exif:all -exifbyteorder=little 1007_350D_8217.jpg

The last two report that the target file has been updated, but the endianism hasn't changed.

Please help! Thanks, Andrew
Title: Re: Problem updating makernotes on JPG files
Post by: Archive on May 12, 2010, 08:54:15 AM
[Originally posted by exiftool on 2008-02-15 00:30:35-08]

Hi Andrew,

You had this correct in one of your previous posts (all except that
I changed "II" to "Little":

Code:
c:\utils\exiftool -exif:all= -tagsfromfile 1007_350D_8217_BP.jpg -exifbyteorder="Little" -exif:all 1007_ 350D_8217.jpg

- Phil
Title: Re: Problem updating makernotes on JPG files
Post by: Archive on May 12, 2010, 08:54:15 AM
[Originally posted by andrewj on 2008-02-15 07:30:50-08]

Dear Phil,

That works! Thanks very much for all your help on this.

Andrew