Menu

Error when changing timezone

2 days ago
1 day ago
  • Colin Brander

    Colin Brander - 2 days ago

    I have many files taken with a Samsung Galaxy phone. On some images, the time zone default to Africa/Abidjan. When I try to change the timezone to the correct one, I get the following error:

    Error: Error reading OtherImageStart data in IFD0

    Is there a simple way to fix this? If I strip out all the meta data and re-add it, then it saves correctly, but that is tedious and a lot of extra work.

    Thank you,

    Colin

     
  • StarGeek

    StarGeek - 2 days ago

    Sourceforge stripped away all the metadata in that file. Can you upload it to something like Dropbox/OneDrive/GoogleDrive and provide a link? Note that if you use Google drive, you have to right click->Share->Share and change the Access to "Anyone with a link" because Google Drive is set to "Restricted" by default.

     
  • StarGeek

    StarGeek - 2 days ago

    The metadata in that file is a mess. I'm assuming that it was edited by some program, as there is metadata in there that wouldn't be directly from a camera.

    Here's the output from exiftool's -validate check. Samsung cameras are really bad at writing proper EXIF data, so I don't know if the problem here originates with the original image or whatever program edited the metadata.

    Most programs that read EXIF data are robust enough to deal with these warnings, so this mostly goes to show the lack of attention to the standard for the programs that wrote/edited the file.

    C:\>exiftool -g1 -a -s -warning -validate -error Y:\!temp\x\y\Z\test\20260215_063144.jpg
    ---- ExifTool ----
    Warning                         : Entries in IFD0 are out of order [x5]
    Warning                         : Tag ID 0x0101 ImageHeight out of sequence in IFD0
    Warning                         : Entries in GPS are out of order
    Warning                         : Tag ID 0x0001 GPSLatitudeRef out of sequence in GPS
    Warning                         : Tag ID 0x011b YResolution out of sequence in IFD0
    Warning                         : Tag ID 0x011a XResolution out of sequence in IFD0
    Warning                         : Tag ID 0x0100 ImageWidth out of sequence in IFD0
    Warning                         : [minor] Odd offset for IFD0 tag 0x0131 Software
    Warning                         : [minor] Odd offset for ExifIFD tag 0x9202 ApertureValue
    Warning                         : Entries in ExifIFD are out of order [x13]
    Warning                         : Non-standard format (string) for ExifIFD 0x9000 ExifVersion
    Warning                         : [minor] Odd offset for ExifIFD tag 0x9000 ExifVersion
    Warning                         : Tag ID 0x9000 ExifVersion out of sequence in ExifIFD
    Warning                         : Tag ID 0x8822 ExposureProgram out of sequence in ExifIFD
    Warning                         : Tag ID 0x9205 MaxApertureValue out of sequence in ExifIFD
    Warning                         : Tag ID 0x9203 BrightnessValue out of sequence in ExifIFD
    Warning                         : Tag ID 0x9003 DateTimeOriginal out of sequence in ExifIFD
    Warning                         : Tag ID 0xa402 ExposureMode out of sequence in ExifIFD
    Warning                         : Tag ID 0x829a ExposureTime out of sequence in ExifIFD
    Warning                         : [minor] Odd offset for ExifIFD tag 0x829d FNumber
    Warning                         : Tag ID 0x829d FNumber out of sequence in ExifIFD
    Warning                         : Tag ID 0x9292 SubSecTimeDigitized out of sequence in ExifIFD
    Warning                         : [minor] Odd offset for ExifIFD tag 0xa404 DigitalZoomRatio
    Warning                         : [minor] Odd offset for ExifIFD tag 0x9004 CreateDate
    Warning                         : Tag ID 0x9004 CreateDate out of sequence in ExifIFD
    Warning                         : [minor] Odd offset for ExifIFD tag 0x9201 ShutterSpeedValue
    Warning                         : [minor] Odd offset for ExifIFD tag 0x920a FocalLength
    Warning                         : Tag ID 0x9207 MeteringMode out of sequence in ExifIFD
    Warning                         : [minor] Odd offset for ExifIFD tag 0x9011 OffsetTimeOriginal
    Warning                         : Tag ID 0x9011 OffsetTimeOriginal out of sequence in ExifIFD
    Warning                         : Tag ID 0x9208 LightSource out of sequence in ExifIFD
    Warning                         : Tag ID 0x0128 ResolutionUnit out of sequence in IFD0
    Warning                         : ExifIFD tag 0x9010 OffsetTime requires ExifVersion 0231 or higher
    Warning                         : ExifIFD tag 0x9011 OffsetTimeOriginal requires ExifVersion 0231 or higher
    Warning                         : Missing required JPEG ExifIFD tag 0x9101 ComponentsConfiguration
    Warning                         : Missing required JPEG GPS tag 0x0000 GPSVersionID
    Warning                         : [minor] IFD0 tag 0x0100 ImageWidth is not allowed in JPEG
    Warning                         : [minor] IFD0 tag 0x0101 ImageHeight is not allowed in JPEG
    Warning                         : [minor] IFD0 tag 0x0103 Compression is not allowed in JPEG
    Warning                         : [minor] IFD0 tag 0x0201 OtherImageStart is not allowed in JPEG
    Warning                         : [minor] IFD0 tag 0x0202 OtherImageLength is not allowed in JPEG
    Validate                        : 41 Warnings (14 minor)
    

    Additionally, the JFIF block appears after the EXIF block, which is something I don't think I've seen before and I'm pretty sure isn't supposed to happen.

    The problem, as listed in your original post, lies with the OtherImage, which is supposed to be an embedded JPEG to be used as a preview image (which will be bigger than the ThumbnailImage). In this file it is completely corrupted.

    The file can be fixed by rebuilding the EXIF block, which will drop the OtherImage data. The second command in FAQ #20 "How do I repair corrupted EXIF?" would be the one to use.

    Here's the differences between the original and the fixed file

    C:\>exiftool -P -overwrite_original -exif:all= -tagsfromfile @ -exif:all -unsafe -F Y:\!temp\x\y\Z\test\20260215_063144-Edited.jpg
        1 image files updated
    
    C:\>exiftool --system:all -e -G1 -a -s -diff Y:\!temp\x\y\Z\test\20260215_063144-Edited.jpg Y:\!temp\x\y\Z\test\20260215_063144-Original.jpg
    ======== diff < Y:/!temp/x/y/Z/test/20260215_063144-Original.jpg > Y:/!temp/x/y/Z/test/20260215_063144-Edited.jpg
    < [IFD0]          Compression                     : JPEG (old-style)
    < [IFD0]          OtherImageStart                 : 964
    < [IFD0]          OtherImageLength                : 62375
    < [IFD0]          ImageHeight                     : 3024
    < [IFD0]          ImageWidth                      : 3024
    > [GPS]           GPSVersionID                    : 2.3.0.0
    > [ExifIFD]       ComponentsConfiguration         : Y, Cb, Cr, -
    

    The IDF0 data listed is all the data dealing with the OtherImage and has been removed. The required GPS and ExifIFD tags have been added.

    The OffsetTime* tags can now be edited.

    C:\>exiftool -P -overwrite_original -OffsetTime*=-07:00 Y:\!temp\x\y\Z\test\20260215_063144-Edited.jpg
        1 image files updated
    
    C:\>exiftool -e -EXIF:Time:All --system:all -G1 -a -s Y:\!temp\x\y\Z\test\20260215_063144-Edited.jpg
    [IFD0]          ModifyDate                      : 2026:02:15 06:31:44
    [ExifIFD]       DateTimeOriginal                : 2026:02:15 06:31:44
    [ExifIFD]       CreateDate                      : 2026:02:15 06:31:44
    [ExifIFD]       OffsetTime                      : -07:00
    [ExifIFD]       OffsetTimeOriginal              : -07:00
    [ExifIFD]       OffsetTimeDigitized             : -07:00
    [ExifIFD]       SubSecTime                      : 328
    [ExifIFD]       SubSecTimeOriginal              : 328
    [ExifIFD]       SubSecTimeDigitized             : 328
    

    If you don't mind losing the OtherImage on files where there isn't a problem, then the easiest thing to do would be to pass entire directories to exiftool so it can rewrite the EXIF, e.g.
    exiftool -P -overwrite_original -exif:all= -tagsfromfile @ -exif:all -unsafe -F /path/to/files/

    The problem with trying to target only the files with this error is that exiftool can't see the error until it tries to write data to the file. For this, the only way I can think of to fix it would be to run two commands.

    First, you would run your normal command to fix the OffsetTime* tags, but you would add the -efile option. Something like this
    exiftool -P -overwrite_original -OffsetTime*=-07:00 -efile ErrorList.txt /path/to/files/

    This will write a list of all the problem files to a text file.

    Then, you would use that list to fix the problem files. You could also update the OffsetTime* tags at the same time. You would use the -@ (Argfile) option to read the files in the error list.
    exiftool -P -overwrite_original -exif:all= -tagsfromfile @ -exif:all -unsafe -F -OffsetTime*=-07:00 -@ ErrorList.txt

     
  • Colin Brander

    Colin Brander - 1 day ago

    Thank you, that's very helpful. They are my partner's photos. The only thing she may have done is crop them. I use Geosetter for updating the timezone and geolocation. Most save fine, some don't. I've never run into this problem before on my own files, so found it odd. I've since found that I can create a copy of the files, strip the metadata out and copy location and time from the original with no issues.

    Thanks again.

     

Log in to post a comment.