Fix metadata to write tags

Started by sparrow, May 30, 2018, 05:03:55 AM

Previous topic - Next topic

sparrow

Hi there

I'm trying to add tags to this picture (see attached below) but i get an error 0x80070216: Arithmetic result exceeded 32 bits.

I know deleting metadata will work as wiping everything and starting from scratch but I want to keep the camera data and time taken, which is very useful for me

I have used this:
exiftool -all= -tagsfromfile @ -all:all -unsafe -icc_profile bad.jpg

the command above works for some pictures but doesn't work for every picture like the one attached below

i need some reliable way to do this so i don't get stuck after collecting a couple thousands of images :)
I'm on windows 10

Can you help me
thanks in advanced to all the wonderful people that will be willing to look into this

Hayo Baan

There's quite a lot of stuff wrong with that file:
$ exiftool -warning -validate bad.jpg
[ExifTool]      Warning                         : [minor] Non-standard IFD0 tag 0xea1c Padding
[ExifTool]      Warning                         : Entries in IFD0 are out of order
[ExifTool]      Warning                         : Tag ID 0x8769 out of sequence in IFD0
[ExifTool]      Warning                         : [minor] Non-standard ExifIFD tag 0xea1c Padding
[ExifTool]      Warning                         : Missing required JPEG ExifIFD tag 0x9101 ComponentsConfiguration
[ExifTool]      Warning                         : Missing required JPEG ExifIFD tag 0xa000 FlashpixVersion
[ExifTool]      Warning                         : [minor] IFD0 tag 0x0100 ImageWidth is not allowed in JPEG
[ExifTool]      Warning                         : [minor] IFD0 tag 0x0101 ImageHeight is not allowed in JPEG
[ExifTool]      Warning                         : [minor] IFD0 tag 0x0102 BitsPerSample is not allowed in JPEG
[ExifTool]      Warning                         : [minor] IFD0 tag 0x0106 PhotometricInterpretation is not allowed in JPEG
[ExifTool]      Warning                         : [minor] IFD0 tag 0x0115 SamplesPerPixel is not allowed in JPEG
[ExifTool]      Warning                         : [minor] Missing required JPEG IFD0 tag 0x0213 YCbCrPositioning
[ExifTool]      Validate                        : 12 Warnings (8 minor)


However, the command you specified gave me no problems (running on a Mac):
$ exiftool -all= -tagsfromfile @ -all:all -unsafe -icc_profile bad.jpg
    1 image files updated


After that command most validation warnings have gone too:
$ exiftool -warning -validate bad.jpg
[ExifTool]      Warning                         : [minor] Non-standard ExifIFD tag 0xea1c Padding
[ExifTool]      Warning                         : [minor] Non-standard IFD0 tag 0xea1c Padding
[ExifTool]      Validate                        : 2 Warnings (all minor)


I think the arithmetic error you are seeing is related to the errors in the file. Perhaps I don't get the error on my system because it uses different (64 bit?) math libraries? Also have you already tried the latest (10.99) exiftool?
Hayo Baan – Photography
Web: www.hayobaan.nl

sparrow

Yes i have the latest exiftool-10.99

after running the command when I try to add more tags it gives me the same error

Phil Harvey

Apparently you can get this error when just setting properties in (64-bit) Windows 7:  link  Do you see the same problem?

I can't replicate this here.

If you run "exiftool -v3" on this file do you get any such errors?  If so, where do they occur in the output?

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

sparrow

that's what I get

Phil Harvey

OK, so no errors when just extracting.  Pity.

Try adding -v3 to the command that gives the error.

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

Phil Harvey

#6
I found this:

Error 0x80070216 Arithmetic Result Exceeded 32 Bits Error Codes are caused in one way or another by misconfigured system files in your windows operating system.

Advanced Computer User Solution (manual update):
1) Start your computer and log on as an administrator.
2) Click the Start button then select All Programs, Accessories, System Tools, and then click System Restore.
3) In the new window, select "Restore my computer to an earlier time" option and then click Next.
4) Select the most recent system restore point from the "On this list, click a restore point" list, and then click Next.
5) Click Next on the confirmation window.
6) Restarts the computer when the restoration is finished.


I can't vouch for the accuracy of these instructions.

- Phil

Edit:  Hmmm.  These instructions may not apply to Windows 10, although that page was updated just a few days ago.

Edit2: Remove links as recommended by Oliver
...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 ($).

sparrow

#7
thank you for your help so far :)

I think I will delete all the metadata from internet pictures
AND
Keep the metadata on my own original raw pictures

Q1:
Can you provide a command to safely delete metadata so it can be filled from scratch and explain the command a bit so i know what it does?

Q2:
I usually use "BatchPurifier" to delete metadata of JPGs, have you used it before? If yes what do you think about it?

Q3:
ALSO Can you provide a command to display the errors so i can see if there are any problems with JPGs
Is this good enough?
exiftool -warning -validate bad.jpg


One thing I don't get is when I delete the metadata, it says:
Validate                        : OK
AND
When I retype the tags again, it shows the same Warnings:
Warning                         : [minor] Non-standard ExifIFD tag 0xea1c Padding
Validate                        : 13 Warnings (3 minor)
BUT
With the difference that I can type in TAGs without an error message :)

What would be a good practice to clean up JPGs and store TAGs in them?

Thank you in advance :)

Phil Harvey

Quote from: sparrow on May 31, 2018, 03:28:53 AM
Q1:
Can you provide a command to safely delete metadata so it can be filled from scratch and explain the command a bit so i know what it does?

This will delete metadata from JPEG images:

exiftool -all= FILE

The syntax -TAG= is used to delete a tag, and the special tag name of All applies to all tags.

QuoteQ2:
I usually use "BatchPurifier" to delete metadata of JPGs, have you used it before? If yes what do you think about it?

I've never tried it.

QuoteQ3:
ALSO Can you provide a command to display the errors so i can see if there are any problems with JPGs
Is this good enough?
exiftool -warning -validate bad.jpg

Yes.

QuoteOne thing I don't get is when I delete the metadata, it says:
Validate                        : OK
AND
When I retype the tags again, it shows the same Warnings:
Warning                         : [minor] Non-standard ExifIFD tag 0xea1c Padding
Validate                        : 13 Warnings (3 minor)
BUT
With the difference that I can type in TAGs without an error message :)

Microsoft adds a Padding tag that isn't standard EXIF.  This isn't anything to worry about.

QuoteWhat would be a good practice to clean up JPGs and store TAGs in them?

Personally I don't worry about cleaning them up unless there are errors when you try to write them.  Usually, extra garbage doesn't cause problems except that it may use up some unnecessary disk space.

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

sparrow

#9
Thank you for your answers Phil

Q1:
This command works nicely BUT with the picture I've provided 183dpi turns to 96dpi, is it supposed to?
exiftool -all= FILE

Q2:
Where can I store URL in the metadata, I store URLs as a  "Subject"

Q3:
Is it safe to tag raw TIFF-based files (.NEF)? How do you do it, because right clicking the image and going into 'Properties' -> 'Details' and entering tags doesn't work, it won't let me

Phil Harvey

Quote from: sparrow on June 01, 2018, 03:17:02 AM
Q1:
This command works nicely BUT with the picture I've provided 183dpi turns to 96dpi, is it supposed to?

96dpi must be the default resolution.  -all= will delete the resolution metdata.

QuoteQ2:
Where can I store URL in the metadata, I store URLs as a  "Subject"

exiftool -subject="http://some_url" FILE

QuoteQ3:
Is it safe to tag raw TIFF-based files (.NEF)? How do you do it, because right clicking the image and going into 'Properties' -> 'Details' and entering tags doesn't work, it won't let me

I always recommend making backups, but tagging NEF with ExifTool is certainly much safer than using Nikon software to transfer the NEF's from your camera.

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

sparrow

Q1:
96 dpi is what you have set it up as default
OR
its the original dpi of the picture (meaning someone else manually changed it to a wrong dpi)
In that case if I decide to print it out, will the quality degrade?

Q2:
by saying "I always recommend making backups"
You mean when you use exiftool it makes a backup "bad.jpg_original" file
Did you mean that one

Q3:
How do you restore "bad.jpg_original" file to its original, what command do you use

Thank you

StarGeek

Quote from: sparrow on June 01, 2018, 07:02:52 PM
Q1:
96 dpi is what you have set it up as default
OR
its the original dpi of the picture (meaning someone else manually changed it to a wrong dpi)

It's the default of whatever program you are using to view it.  Adobe might use a different default than Word, which might be different than OpenOffice.  When the data is deleted by exiftool, it's gone.  I am unable to comment on quality of the printout, but there is no degradation in the image itself.

QuoteQ2:
by saying "I always recommend making backups"
You mean when you use exiftool it makes a backup "bad.jpg_original" file
Did you mean that one

If the images are important to you, then you should have a system to back up the images.  More than just relying upon the backup file that exiftool makes.

QuoteQ3:
How do you restore "bad.jpg_original" file to its original, what command do you use

See the -restore_original docs.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

sparrow

#13
Thank you for your help guys :)

What command to use to just delete the "ICC Profile"?

ALSO

Can you udjust this command to delete metadata as it does but without doing anything to the horizontal a vertical resolution?
"exiftool -all= FILE"

Phil Harvey

Quote from: sparrow on June 02, 2018, 09:51:50 AM
What command to use to just delete the "ICC Profile"?

exiftool -icc_profile= FILE

QuoteCan you udjust this command to delete metadata as it does but without doing anything to the horizontal a vertical resolution?
"exiftool -all= FILE"

exiftool -all= -tagsfromfile @ -xresolution -yresolution -resolutionunit FILE

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