Date Shift fails with MakerNotes error

Started by Archive, May 12, 2010, 08:54:14 AM

Previous topic - Next topic

Archive

[Originally posted by ggking7 on 2008-01-28 17:12:36-08]

I'm trying to correct the date of an image but I get:

$ exiftool -AllDates+=8776 file.jpg
Error: [minor] Bad format (65535) for MakerNotes entry 17 - file.jpg
    0 image files updated
    1 files weren't updated due to errors

Can I fix this?

Archive

[Originally posted by exiftool on 2008-01-28 22:52:58-08]

Makernote errors are not uncommon if you have edited the image
with another utility, and most are designated as minor so they
can be ignored (downgraded to warnings) with the -m
option.

- Phil

Archive

[Originally posted by ggking7 on 2008-01-29 03:43:34-08]

Perfect, thank you.

Archive

[Originally posted by mixx on 2008-01-29 11:52:39-08]

I have a related problem (or so I believe). I have a database in Thumbsplus that I want to migrate. I managed to put the Capture date from the database into an unused IPTC field (say CREDIT) as a string of the format "2008:01:29" or (for some images) "2008/01/29" for each image. This date is different from the DateTimeOriginal field, and that is my problem for Lightroom (where I am migrating to). I am trying to change all Date fields in the images to the date stored in IPTC:Credit by

exiftool -S -s -Credit a.jpg | tr '/' ':' | exiftool -d "%Y:%m:%d" -AllDates'<=-' a.jpg

Ideally, I'd like to shift the time by +1 hour, too, but I could not figure out how. This does work for a couple of images (say 30% out 10,000) but for the majority I get an error message about minor (?) MakerNotes errors and the image does not change. Sometimes it does not work at the first time, but if I keep trying it is done afterall. I tried to delete the MakerNotes before I apply the above, then it runs through cleanly. But this I really do not want as I'd like to preserve the Makernotes.

Can I jist use the -m option and trust that all will be well (for 10,000) images? Any help appreciated-

Thanxx, Mixx

Archive

[Originally posted by exiftool on 2008-01-29 12:28:42-08]

When you use -m you run the risk of losing some information,
but it is likely that the information was corrupted to begin with.  I have
added a https://exiftool.org/faq.html#Q15" target="_blank">new
FAQ to help with this question.

I suggest looking at some of the images that are giving you errors.  Try
using exiftool to extract all information (with -a -u -G1) before
and after editing with the -m option, then look at the differences
to see what information, if any, was lost:

Code:
exiftool -a -u -G1 image.jpg > t1
 exiftool -m -alldates="2008:01:29 08:00:00" image.jpg
 exiftool -a -u -G1 image.jpg > t2
 diff t1 t2

A couple more comments about what you are doing:

1) Dates set by -alldates should be in the form "YYYY:MM:DD hh:mm:ss".
In your example, you leave out the time.

2) The -d option has no effect when writing, so you can remove
this from your command.

3) Any image that produces an error when writing will not be written, so
applying the same command again should have the same effect.  I don't
understand what you mean by "f I keep trying it is done afterall"
in this context.

4) The date/time shift of +1 hour must be done in a separate step after
writing the date/time values.

- Phil

Archive

[Originally posted by mixx on 2008-01-31 11:57:01-08]

Thanks Phil, there are some changes but I'll take the risk and jump.

I have now written a shell script and after much trouble (running a GNU shell script on Windows) got it working. I realized while doing this that I have two wishes if I may for exiftool.

I think a syntax exiftool -tag1=$tag2 a.jpg would be much more intuitive that exiftool -tag1<$tag2 (which is by the way  difficult to find in the option description).

I think it would be terrific if exiftool had built string manipulation functions such as substitute and substring. With those, one could work without shell or perl scripts and with just one command.

Thanxx, Mixx

Archive

[Originally posted by exiftool on 2008-01-31 12:03:38-08]

Hi Mixx,

Thanks for your comments.

"I think a syntax exiftool -tag1=$tag2 a.jpg would be much more intuitive..."

But then how would you set the value of tag1 to the string "$tag2" rather than the value of tag2?

"I think it would be terrific if exiftool had built string manipulation functions..."

I agree that these would be useful, but I haven't been able to think of a simple
way to add them.  My goal is to keep the exiftool command-line interface as
simple as possible (it is already way too complex!), since it is always possible
(and usually fairly simple) to do what you want in Perl and use the ExifTool API
instead of the command-line interface.

- Phil

Archive

[Originally posted by mixx on 2008-01-31 14:25:20-08]

Phil,

I am not an expert but suggestion 1 is just another problem of how to pass
arguments to an application and could be solved by quoting rules maybe
-tag1="$tag2" would do the value and -tag1="'$tag2'" the string. I do
not know if this works, but would not be anything unusual.

About string manipulation: exiftool gets a string as an argument anyway as in
Code:

exiftool "-example_date=$datetimeoriginal" a.jpg
(using the "new" syntax :-)). What's wrong with
Code:

exiftool "-example_date=substring($datetimeoriginal,1,10)" a.jpg
to assign the first 10 characters of the DateTimeOriginal flag to
example_date? And if that should use a different notation one could
Code:

exiftool "-example_date=replace(substring($datetimeoriginal,1,10),':','/'))" a.jpg
to get e.g. "2008/01/31" into example_date.

Just a thought, Mixx

Archive

[Originally posted by exiftool on 2008-01-31 14:55:08-08]

Hi Mixx,

An interesting thought, but I don't think the idea is comatible with the
current command line usage, and it could make things more complex
for the average user who just wants to a assign a simple value to a
tag (ie. "-License=Copyright(2008)" -- how would this be
differentiated from invoking the "Copyright" function?).

- Phil

Archive

[Originally posted by mixx on 2008-01-31 18:22:07-08]

Yup, I see the problem. Back to shell scripts then. -- Thanxx, Mixx