[๐Ÿ›] `mapillary_tools` breaks TIFF directory structure

How to reproduce:

  1. Run process and zip commands on any image
  2. Extract an image from the zip file
  3. Examine the JPEG fileโ€™s TIFF directory structure, e.g. with exiv2
$ exiv2 -pv zip_extracted_file.jpg
Warning: Directory Photo has an unexpected next pointer; ignored.   # mapillary_tools creates a dangling pointer
Warning: Directory GPSInfo has an unexpected next pointer; ignored. # mapillary_tools creates a dangling pointer
0x0100 Image        ImageWidth                  Long        1  1920
0x0101 Image        ImageLength                 Long        1  1440
0x010e Image        ImageDescription            Ascii     196  {"MAPLatitude": 0.1234567, "MAPLongitude": 0.1234567, "MAPCaptureTime": "2025_02_10_11_56_23_900", "MAPCompassHeading": {"TrueHeading": 351.336, "MagneticHeading": 351.336}, "MAPOrientation": 1}
0x0132 Image        DateTime                    Ascii      20  2025:02:10 12:56:23
0x8769 Image        ExifTag                     Long        1  302
0x9000 Photo        ExifVersion                 Undefined   4  48 50 51 49
0x9003 Photo        DateTimeOriginal            Ascii      20  2025:02:10 12:56:23
0x9004 Photo        DateTimeDigitized           Ascii      20  2025:02:10 12:56:23
0x9010 Photo        OffsetTime                  Ascii       7  +01:00
0x9011 Photo        OffsetTimeOriginal          Ascii       7  +01:00
0x9012 Photo        OffsetTimeDigitized         Ascii       7  +01:00
0x920a Photo        FocalLength                 Rational    1  3/1
0x9290 Photo        SubSecTime                  Ascii       7  626625
0x9291 Photo        SubSecTimeOriginal          Ascii       7  626625
0x9292 Photo        SubSecTimeDigitized         Ascii       7  626625
0xa002 Photo        PixelXDimension             Long        1  1920
0xa003 Photo        PixelYDimension             Long        1  1440
0xa20e Photo        FocalPlaneXResolution       Rational    1  1016000/69
0xa20f Photo        FocalPlaneYResolution       Rational    1  1016000/69
0xa210 Photo        FocalPlaneResolutionUnit    Short       1  2
0xa405 Photo        FocalLengthIn35mmFilm       Short       1  31
0x8825 Image        GPSTag                      Long        1  602
0x0000 GPSInfo      GPSVersionID                Byte        4  2 3 0 0
0x0001 GPSInfo      GPSLatitudeRef              Ascii       2  N
0x0002 GPSInfo      GPSLatitude                 Rational    3  0/1 0/1 1234567/1000000
0x0003 GPSInfo      GPSLongitudeRef             Ascii       2  E
0x0004 GPSInfo      GPSLongitude                Rational    3  0/1 0/1 1234567/1000000
0x0007 GPSInfo      GPSTimeStamp                Rational    3  11/1 56/1 23/1
0x0009 GPSInfo      GPSStatus                   Ascii       2  A
0x0010 GPSInfo      GPSImgDirectionRef          Ascii       2  T
0x0011 GPSInfo      GPSImgDirection             Rational    1  3650731/10391
0x0012 GPSInfo      GPSMapDatum                 Ascii       7  WGS-84
0x001d GPSInfo      GPSDateStamp                Ascii      11  2025:02:10