Bad format (0) for ExifIFD entry 0

Started by mads, May 10, 2015, 06:39:45 PM

Previous topic - Next topic

mads

Hi Phil,

I ran in to a problem using my standard workflow batch file that I use to batch rename and tag all my photos.

The problem is with burst photos taken with the new Samsung Galaxy S6 phone.

My script works fine with burst photos shot with the Samsung Galaxy S5 phone and a bunch of others.

I get this error:

Warning: [minor] Entries in ExifIFD were out of sequence. Fixed. - ./20150510_084110_001.jpg
Error: Bad format (0) for ExifIFD entry 0 - ./20150510_084110_001.jpg
    1 directories scanned
    0 image files updated
    1 files weren't updated due to errors
Warning: [minor] Entries in ExifIFD were out of sequence. Fixed. - ./20150510_084110_001.jpg
Error: Bad format (0) for ExifIFD entry 0 - ./20150510_084110_001.jpg
    1 directories scanned
    0 image files updated
    1 files weren't updated due to errors
    1 directories scanned
    1 files failed condition
    0 image files read
********** ALL DONE ***********
Press any key to continue . . .


Any clue what's going on?

I will post a normal picture which works and one from burst mode which fails, maybe it will be links as the attachments seems to be rejected.

http://s000.tinyupload.com/download.php?file_id=96937931917411082576&t=9693793191741108257648756

http://s000.tinyupload.com/download.php?file_id=30377542207243871288&t=3037754220724387128819006

Best Regards,
Mads

exiftool version : 9.95

Phil Harvey

Hi Mads,

I can take a look at the picture tomorrow, but usually the only solution for significant errors like this is to rebuild the EXIF.  For help with this, see FAQ 20.

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

mads

#2
Hi Phil,

Thank you for pointing me to the FAQ which helped me and apparently solves the problem.

After fixing the file the size is obviously a bit smaller, I don't intend to keep the original backup so I hope nothing vital exif data is missing in the fixed file, but it will have to do for now.

Here is my script before:


REM stamp the copyright filed + the documentName fiels with the original filename without extension
%EXIFTOOL% -if "$DocumentName eq ''" "-DocumentName<$BaseName" -Artist="%ARTIST%" -Copyright="%COPYRIGHT%" "-fileModifyDate<${MyCreateDate}" -overwrite_original -ext %PROCESS_FILE_TYPE% %PROCESS_DIR%
REM re-stamp if stamp did not happen by removing usercomment as it is possible a samsung size issue.
%EXIFTOOL% -if "$DocumentName eq ''" "-UserComment=" "-DocumentName<$BaseName" -Artist="%ARTIST%" -Copyright="%COPYRIGHT%" "-fileModifyDate<${MyCreateDate}" -overwrite_original -ext %PROCESS_FILE_TYPE% %PROCESS_DIR%
REM rename using MyCreateDate which may return ModifyDate if CreateDate is missing and thereby fixing the PANO issue
rem %EXIFTOOL% -if "$DocumentName ne ''" -d "%%Y-%%m-%%d %%H.%%M.%%S" "-filename<$MyCreateDate [$MyFileName].%%e" -overwrite_original -ext %PROCESS_FILE_TYPE% %PROCESS_DIR%
%EXIFTOOL% -if "$DocumentName ne ''" -d "%%Y-%%m-%%d %%H.%%M.%%S" "-filename<$ModifyDate [$MyFileName].%%e" "-filename<$CreateDate [$MyFileName].%%e" -overwrite_original -ext %PROCESS_FILE_TYPE% %PROCESS_DIR%


And after:


REM 2015-05-11 - fix the samsung galaxy s6 burst shots
%EXIFTOOL% -if "$DocumentName eq '' and $Model eq '%MODEL_SAMSUNG_G920F%' and ${Filename;$_=substr($_,15,1)} eq '_'" -all= -tagsfromfile @ -all:all -unsafe -icc_profile -overwrite_original -ext %PROCESS_FILE_TYPE% %PROCESS_DIR%
REM 2015-05-11 - fix the samsung galaxy s6 edge burst shots
%EXIFTOOL% -if "$DocumentName eq '' and $Model eq '%MODEL_SAMSUNG_G925F%' and ${Filename;$_=substr($_,15,1)} eq '_'" -all= -tagsfromfile @ -all:all -unsafe -icc_profile -overwrite_original -ext %PROCESS_FILE_TYPE% %PROCESS_DIR%
REM stamp the copyright filed + the documentName fiels with the original filename without extension
%EXIFTOOL% -if "$DocumentName eq ''" "-DocumentName<$BaseName" -Artist="%ARTIST%" -Copyright="%COPYRIGHT%" "-fileModifyDate<${MyCreateDate}" -overwrite_original -ext %PROCESS_FILE_TYPE% %PROCESS_DIR%
REM re-stamp if stamp did not happen by removing usercomment as it is possible a samsung size issue.
%EXIFTOOL% -if "$DocumentName eq ''" "-UserComment=" "-DocumentName<$BaseName" -Artist="%ARTIST%" -Copyright="%COPYRIGHT%" "-fileModifyDate<${MyCreateDate}" -overwrite_original -ext %PROCESS_FILE_TYPE% %PROCESS_DIR%
REM rename using MyCreateDate which may return ModifyDate if CreateDate is missing and thereby fixing the PANO issue
rem %EXIFTOOL% -if "$DocumentName ne ''" -d "%%Y-%%m-%%d %%H.%%M.%%S" "-filename<$MyCreateDate [$MyFileName].%%e" -overwrite_original -ext %PROCESS_FILE_TYPE% %PROCESS_DIR%
%EXIFTOOL% -if "$DocumentName ne ''" -d "%%Y-%%m-%%d %%H.%%M.%%S" "-filename<$ModifyDate [$MyFileName].%%e" "-filename<$CreateDate [$MyFileName].%%e" -overwrite_original -ext %PROCESS_FILE_TYPE% %PROCESS_DIR%


Thanks!
Mads

Phil Harvey

Hi Mads,

Yes.  Samsung really messed up the ExifIFD in this image.  The file is smaller after rebuilding due to an unknown APP4 segment that is deleted.  If you want to preserve this, you can rebuild only the EXIF:

exiftool -exif:all= -tagsfromfile @ -all:all -unsafe FILE

Also, if you just delete the EXIF, you don't need to copy back the ICC_Profile.

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

mads

Thanks Phil!

I added your suggested changes and the file size of the fixed file is now even closer to the original.

So to sum it up... The following will preserve most information in my file?


REM 2015-05-11 - fix the samsung galaxy s6 burst shots
%EXIFTOOL% -if "$DocumentName eq '' and $Model eq '%MODEL_SAMSUNG_G920F%' and ${Filename;$_=substr($_,15,1)} eq '_'" -exif:all= -tagsfromfile @ -all:all -unsafe -overwrite_original -ext %PROCESS_FILE_TYPE% %PROCESS_DIR%
REM 2015-05-11 - fix the samsung galaxy s6 edge burst shots
%EXIFTOOL% -if "$DocumentName eq '' and $Model eq '%MODEL_SAMSUNG_G925F%' and ${Filename;$_=substr($_,15,1)} eq '_'" -exif:all= -tagsfromfile @ -all:all -unsafe -overwrite_original -ext %PROCESS_FILE_TYPE% %PROCESS_DIR%


/Mads

Phil Harvey

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