Skip to content

Commit

Permalink
Check if file is corrupt.
Browse files Browse the repository at this point in the history
  • Loading branch information
arknoll committed Nov 10, 2021
1 parent aa5b1bf commit 34a18aa
Show file tree
Hide file tree
Showing 11 changed files with 645 additions and 640 deletions.
462 changes: 231 additions & 231 deletions build/exifwrite/Analysis-00.toc

Large diffs are not rendered by default.

314 changes: 157 additions & 157 deletions build/exifwrite/EXE-00.toc

Large diffs are not rendered by default.

Binary file modified build/exifwrite/PKG-00.pkg
Binary file not shown.
312 changes: 156 additions & 156 deletions build/exifwrite/PKG-00.toc

Large diffs are not rendered by default.

Binary file modified build/exifwrite/PYZ-00.pyz
Binary file not shown.
154 changes: 77 additions & 77 deletions build/exifwrite/PYZ-00.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
('Y:\\rockrobotic\\exifwriter\\build\\exifwrite\\PYZ-00.pyz',
('Z:\\rockrobotic\\exifwriter\\build\\exifwrite\\PYZ-00.pyz',
[('ssl',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\ssl.py',
'PYMODULE'),
Expand Down Expand Up @@ -1545,56 +1545,80 @@
('PIL.Image',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\Image.py',
'PYMODULE'),
('PIL.Hdf5StubImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\Hdf5StubImagePlugin.py',
('PIL.ImImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\ImImagePlugin.py',
'PYMODULE'),
('PIL.ImageFile',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\ImageFile.py',
'PYMODULE'),
('PIL.FtexImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\FtexImagePlugin.py',
('PIL.XbmImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\XbmImagePlugin.py',
'PYMODULE'),
('PIL.BlpImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\BlpImagePlugin.py',
('PIL.PcxImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\PcxImagePlugin.py',
'PYMODULE'),
('PIL.EpsImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\EpsImagePlugin.py',
('PIL.McIdasImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\McIdasImagePlugin.py',
'PYMODULE'),
('PIL.SunImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\SunImagePlugin.py',
'PYMODULE'),
('PIL.PcdImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\PcdImagePlugin.py',
'PYMODULE'),
('PIL.SgiImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\SgiImagePlugin.py',
'PYMODULE'),
('PIL.MpegImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\MpegImagePlugin.py',
'PYMODULE'),
('PIL.BlpImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\BlpImagePlugin.py',
'PYMODULE'),
('PIL.XpmImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\XpmImagePlugin.py',
'PYMODULE'),
('PIL.GribStubImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\GribStubImagePlugin.py',
'PYMODULE'),
('PIL.MpoImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\MpoImagePlugin.py',
'PYMODULE'),
('PIL.WebPImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\WebPImagePlugin.py',
'PYMODULE'),
('PIL.PcxImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\PcxImagePlugin.py',
('PIL.DcxImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\DcxImagePlugin.py',
'PYMODULE'),
('PIL.FpxImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\FpxImagePlugin.py',
('PIL.PixarImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\PixarImagePlugin.py',
'PYMODULE'),
('PIL.CurImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\CurImagePlugin.py',
('PIL.BufrStubImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\BufrStubImagePlugin.py',
'PYMODULE'),
('PIL.SgiImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\SgiImagePlugin.py',
('PIL.MspImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\MspImagePlugin.py',
'PYMODULE'),
('PIL.XVThumbImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\XVThumbImagePlugin.py',
('PIL.IcoImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\IcoImagePlugin.py',
'PYMODULE'),
('PIL.IcnsImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\IcnsImagePlugin.py',
('PIL.MicImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\MicImagePlugin.py',
'PYMODULE'),
('PIL.features',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\features.py',
('PIL.WmfImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\WmfImagePlugin.py',
'PYMODULE'),
('PIL.ImtImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\ImtImagePlugin.py',
('PIL.Hdf5StubImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\Hdf5StubImagePlugin.py',
'PYMODULE'),
('PIL.FitsStubImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\FitsStubImagePlugin.py',
'PYMODULE'),
('PIL.McIdasImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\McIdasImagePlugin.py',
('PIL.FpxImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\FpxImagePlugin.py',
'PYMODULE'),
('PIL.EpsImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\EpsImagePlugin.py',
'PYMODULE'),
('PIL.PdfImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\PdfImagePlugin.py',
Expand All @@ -1605,77 +1629,53 @@
('PIL.ImageSequence',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\ImageSequence.py',
'PYMODULE'),
('PIL.WmfImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\WmfImagePlugin.py',
'PYMODULE'),
('PIL.SpiderImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\SpiderImagePlugin.py',
'PYMODULE'),
('PIL.ImageTk',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\ImageTk.py',
'PYMODULE'),
('PIL.XpmImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\XpmImagePlugin.py',
'PYMODULE'),
('PIL.Jpeg2KImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\Jpeg2KImagePlugin.py',
'PYMODULE'),
('PIL.FliImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\FliImagePlugin.py',
'PYMODULE'),
('PIL.PixarImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\PixarImagePlugin.py',
'PYMODULE'),
('PIL.DdsImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\DdsImagePlugin.py',
'PYMODULE'),
('PIL.PcdImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\PcdImagePlugin.py',
('PIL.TgaImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\TgaImagePlugin.py',
'PYMODULE'),
('PIL.IcoImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\IcoImagePlugin.py',
('PIL.PsdImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\PsdImagePlugin.py',
'PYMODULE'),
('PIL.BufrStubImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\BufrStubImagePlugin.py',
('PIL.SpiderImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\SpiderImagePlugin.py',
'PYMODULE'),
('PIL.XbmImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\XbmImagePlugin.py',
('PIL.ImageTk',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\ImageTk.py',
'PYMODULE'),
('PIL.PalmImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\PalmImagePlugin.py',
'PYMODULE'),
('PIL.ImImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\ImImagePlugin.py',
'PYMODULE'),
('PIL.MspImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\MspImagePlugin.py',
'PYMODULE'),
('PIL.TgaImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\TgaImagePlugin.py',
'PYMODULE'),
('PIL.PsdImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\PsdImagePlugin.py',
('PIL.FliImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\FliImagePlugin.py',
'PYMODULE'),
('PIL.GribStubImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\GribStubImagePlugin.py',
('PIL.IcnsImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\IcnsImagePlugin.py',
'PYMODULE'),
('PIL.SunImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\SunImagePlugin.py',
('PIL.features',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\features.py',
'PYMODULE'),
('PIL.MicImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\MicImagePlugin.py',
('PIL.ImtImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\ImtImagePlugin.py',
'PYMODULE'),
('PIL.GbrImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\GbrImagePlugin.py',
'PYMODULE'),
('PIL.IptcImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\IptcImagePlugin.py',
'PYMODULE'),
('PIL.DcxImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\DcxImagePlugin.py',
('PIL.CurImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\CurImagePlugin.py',
'PYMODULE'),
('PIL.MpoImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\MpoImagePlugin.py',
('PIL.XVThumbImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\XVThumbImagePlugin.py',
'PYMODULE'),
('PIL.DdsImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\DdsImagePlugin.py',
'PYMODULE'),
('PIL.FtexImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\FtexImagePlugin.py',
'PYMODULE'),
('PIL.TiffImagePlugin',
'c:\\users\\alexknoll\\miniconda3\\envs\\exifwriter\\lib\\site-packages\\PIL\\TiffImagePlugin.py',
Expand Down
6 changes: 3 additions & 3 deletions build/exifwrite/warn-exifwrite.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Types if import:
IMPORTANT: Do NOT post this list to the issue-tracker. Use it as a basis for
yourself tracking down the missing module. Thanks!

missing module named 'org.python' - imported by copy (optional), xml.sax (delayed, conditional), setuptools.sandbox (conditional)
missing module named org - imported by copy (optional)
missing module named _frozen_importlib_external - imported by importlib._bootstrap (delayed), importlib (optional), importlib.abc (optional), zipimport (top-level)
excluded module named _frozen_importlib - imported by importlib (optional), importlib.abc (optional), zipimport (top-level), PyInstaller.loader.pyimod02_archive (delayed)
missing module named urllib.quote - imported by urllib (delayed), py._path.svnwc (delayed)
Expand All @@ -35,7 +35,7 @@ missing module named vms_lib - imported by platform (delayed, conditional, optio
missing module named java - imported by platform (delayed)
missing module named _winreg - imported by platform (delayed, optional), pkg_resources._vendor.appdirs (delayed, conditional)
missing module named readline - imported by cmd (delayed, conditional, optional), code (delayed, conditional, optional), pdb (delayed, optional), _pytest.capture (delayed, conditional, optional)
missing module named org - imported by pickle (optional)
missing module named 'org.python' - imported by pickle (optional), xml.sax (delayed, conditional), setuptools.sandbox (conditional)
missing module named posix - imported by os (conditional, optional), shutil (conditional)
missing module named resource - imported by posix (top-level), test.support (optional), psutil._pslinux (optional)
missing module named grp - imported by shutil (optional), tarfile (optional), pathlib (delayed), distutils.archive_util (optional), py._path.local (delayed)
Expand Down Expand Up @@ -138,7 +138,7 @@ missing module named winxptheme - imported by wx.lib.agw.aui.dockart (conditiona
missing module named 'Carbon.Appearance' - imported by wx.lib.agw.aui.aui_utilities (conditional, optional), wx.lib.agw.aui.tabart (conditional, optional)
missing module named __builtin__ - imported by wx.py.sliceshell (delayed, conditional), pyparsing (conditional), py._builtin (conditional), pkg_resources._vendor.pyparsing (conditional), setuptools._vendor.pyparsing (conditional)
runtime module named six.moves - imported by wx.py.interpreter (delayed, conditional), wx.py.shell (delayed)
missing module named olefile - imported by PIL.MicImagePlugin (top-level), PIL.FpxImagePlugin (top-level)
missing module named olefile - imported by PIL.FpxImagePlugin (top-level), PIL.MicImagePlugin (top-level)
missing module named IPython - imported by PIL.ImageShow (optional)
missing module named 'PySide2.QtGui' - imported by PIL.ImageQt (conditional, optional)
missing module named PySide2 - imported by PIL.ImageQt (conditional, optional)
Expand Down
16 changes: 9 additions & 7 deletions build/exifwrite/xref-exifwrite.html
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ <h1>modulegraph cross reference for exifwrite.py, pyi_rth_certifi.py, pyi_rth_mu
<a target="code" href="" type="text/plain"><tt>'org.python'</tt></a>
<span class="moduletype">MissingModule</span> <div class="import">
imported by:
<a href="#copy">copy</a>
<a href="#pickle">pickle</a>
&#8226; <a href="#setuptools.sandbox">setuptools.sandbox</a>
&#8226; <a href="#xml.sax">xml.sax</a>

Expand Down Expand Up @@ -400,6 +400,7 @@ <h1>modulegraph cross reference for exifwrite.py, pyi_rth_certifi.py, pyi_rth_mu
&#8226; <a href="#PIL.ImageSequence">PIL.ImageSequence</a>
&#8226; <a href="#PIL.ImageShow">PIL.ImageShow</a>
&#8226; <a href="#PIL.ImageTk">PIL.ImageTk</a>
&#8226; <a href="#PIL.Jpeg2KImagePlugin">PIL.Jpeg2KImagePlugin</a>
&#8226; <a href="#PIL.JpegImagePlugin">PIL.JpegImagePlugin</a>
&#8226; <a href="#PIL.PaletteFile">PIL.PaletteFile</a>
&#8226; <a href="#PIL.PdfParser">PIL.PdfParser</a>
Expand Down Expand Up @@ -1383,7 +1384,8 @@ <h1>modulegraph cross reference for exifwrite.py, pyi_rth_certifi.py, pyi_rth_mu
</div>
<div class="import">
imported by:
<a href="#PIL.IcnsImagePlugin">PIL.IcnsImagePlugin</a>
<a href="#PIL">PIL</a>
&#8226; <a href="#PIL.IcnsImagePlugin">PIL.IcnsImagePlugin</a>
&#8226; <a href="#PIL.Image">PIL.Image</a>

</div>
Expand Down Expand Up @@ -5412,8 +5414,8 @@ <h1>modulegraph cross reference for exifwrite.py, pyi_rth_certifi.py, pyi_rth_mu
<a target="code" href="///C:/users/alexknoll/miniconda3/envs/exifwriter/lib/copy.py" type="text/plain"><tt>copy</tt></a>
<span class="moduletype">SourceModule</span> <div class="import">
imports:
<a href="#'org.python'">'org.python'</a>
&#8226; <a href="#copyreg">copyreg</a>
<a href="#copyreg">copyreg</a>
&#8226; <a href="#org">org</a>
&#8226; <a href="#types">types</a>
&#8226; <a href="#weakref">weakref</a>

Expand Down Expand Up @@ -17862,7 +17864,7 @@ <h1>modulegraph cross reference for exifwrite.py, pyi_rth_certifi.py, pyi_rth_mu
<a target="code" href="" type="text/plain"><tt>org</tt></a>
<span class="moduletype">MissingModule</span> <div class="import">
imported by:
<a href="#pickle">pickle</a>
<a href="#copy">copy</a>

</div>

Expand Down Expand Up @@ -18354,15 +18356,15 @@ <h1>modulegraph cross reference for exifwrite.py, pyi_rth_certifi.py, pyi_rth_mu
<a target="code" href="///C:/users/alexknoll/miniconda3/envs/exifwriter/lib/pickle.py" type="text/plain"><tt>pickle</tt></a>
<span class="moduletype">SourceModule</span> <div class="import">
imports:
<a href="#_compat_pickle">_compat_pickle</a>
<a href="#'org.python'">'org.python'</a>
&#8226; <a href="#_compat_pickle">_compat_pickle</a>
&#8226; <a href="#_pickle">_pickle</a>
&#8226; <a href="#codecs">codecs</a>
&#8226; <a href="#copyreg">copyreg</a>
&#8226; <a href="#doctest">doctest</a>
&#8226; <a href="#functools">functools</a>
&#8226; <a href="#io">io</a>
&#8226; <a href="#itertools">itertools</a>
&#8226; <a href="#org">org</a>
&#8226; <a href="#pprint">pprint</a>
&#8226; <a href="#re">re</a>
&#8226; <a href="#struct">struct</a>
Expand Down
Binary file modified dist/exifwrite.exe
Binary file not shown.
19 changes: 11 additions & 8 deletions exifwrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,16 +202,19 @@ def set_gps_location(file_name, lat, lng, altitude, photo_date):
}

# get original exif data first!
exif_data = piexif.load(file_name)
try:
exif_data = piexif.load(file_name)

# update original exif data to include GPS tag
exif_data.update(gps_exif)
exif_data["0th"][piexif.ImageIFD.DateTime] = photo_date
exif_data["Exif"][piexif.ExifIFD.DateTimeOriginal] = photo_date
exif_data["Exif"][piexif.ExifIFD.DateTimeDigitized] = photo_date
exif_bytes = piexif.dump(exif_data)
# update original exif data to include GPS tag
exif_data.update(gps_exif)
exif_data["0th"][piexif.ImageIFD.DateTime] = photo_date
exif_data["Exif"][piexif.ExifIFD.DateTimeOriginal] = photo_date
exif_data["Exif"][piexif.ExifIFD.DateTimeDigitized] = photo_date
exif_bytes = piexif.dump(exif_data)

piexif.insert(exif_bytes, file_name)
piexif.insert(exif_bytes, file_name)
except:
print("Could not open " + str(file_name))

if __name__ == '__main__':
main()
2 changes: 1 addition & 1 deletion exifwrite.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ block_cipher = None


a = Analysis(['exifwrite.py'],
pathex=['Y:\\rockrobotic\\exifwriter'],
pathex=['Z:\\rockrobotic\\exifwriter'],
binaries=[],
datas=[],
hiddenimports=[],
Expand Down

0 comments on commit 34a18aa

Please sign in to comment.