Invalid Atom Size warning

Started by akosprime, October 31, 2022, 01:13:30 PM

Previous topic - Next topic

akosprime

I'm testing things out with a batch of about 200'ish sample mp4 files, out of those one of them generates a warning about 'Invalid atom size'

I'm using ver 12.42 on a CentOS-7 Linux machine

This is the command that I'm using:
exiftool -s3 -d '%Y%m%d%H%M%S' [filename]

For the rest of the files it generates expected output.

I've used 'exiftool -f [filename]' on it and it doesn't generate much output (compared to other files that don't have this issue.) Other than munging the filename in order to maintain privacy, I'm attaching the results of that command.

Is there any other output that I can provide to help identify the issue?

Also, even though the output is 'Warning: Invalid atom size - [filename]' the command returns success (0) when checking $? Which I know makes sense since the tool didn't fail per se, but makes it slightly more difficult to automate checking for this error/warning. While I can suppress the warning with '-q -q' and then check for an empty result, I was hoping that there might be a way to streamline it by having the tool return a non-zero result on a warning like this.


akosprime

Here's the output of that command

Phil Harvey

You usually see the "Invalid atom size" warning if there is some garbage at the end of the file.  If it occurs before that, then the file is corrupted somehow.

I think you forgot a tag name in the command you mentioned.  Generally the warning will be suppressed if the tag is found, but since you see the warning the tag wasn't found in that file.

Having ExifTool return a non-zero if the tag isn't found opens a whole Pandora's box... what happens if 2 tags were requested but only 1 was returned?  Instead, you could use the -if option and take advantage of the fact that ExifTool returns 2 if the -if condition is false.

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

akosprime

Fair enough  ;)

The -if condition seems like a good fit then. Is there a way to use it as a simple 'if exists' logic?

I found that I could use it by doing something like:
exiftool -ModifyDate -if '$ModifyDate ge "1970:01:01"' [filename]

and that seems to correctly deal with the file with 'Invalid atom size' file since it doesn't have a ModifyDate field in its metadata. It just would have been nice if the syntax could have been:

exiftool -ModifyDate -if '$ModifyDate' [filename]

That's just me being whiny and lazy though  ;)  :D

I appreciate all the help, especially so quickly too!

Phil Harvey

Quote from: akosprime on October 31, 2022, 01:49:38 PMIt just would have been nice if the syntax could have been:

exiftool -ModifyDate -if '$ModifyDate' [filename]

This should work fine.

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

akosprime

Yes, it does. Apparently how I was calling it in the script caused an issue, but fixed that and it now works.

And I even managed to figure out to use the '-q' option all my myself to suppress the "1 files failed condition" output without suppressing the output on files that don't have problems.

Thanks again for the help! This tool is fantastic!