-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3aa77d3
commit 2d8955c
Showing
9 changed files
with
86 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
#!/usr/bin/env python | ||
|
||
from __future__ import print_function | ||
from pexif import JpegFile | ||
import sys | ||
|
||
usage = """Usage: dump_exif.py filename.jpg""" | ||
|
||
if len(sys.argv) != 2: | ||
print >> sys.stderr, usage | ||
print(usage, file=sys.stderr) | ||
sys.exit(1) | ||
|
||
try: | ||
ef = JpegFile.fromFile(sys.argv[1]) | ||
ef.dump() | ||
except IOError: | ||
type, value, traceback = sys.exc_info() | ||
print >> sys.stderr, "Error opening file:", value | ||
print("Error opening file: {0}".format(value), file=sys.stderr) | ||
except JpegFile.InvalidFile: | ||
type, value, traceback = sys.exc_info() | ||
print >> sys.stderr, "Error opening file:", value | ||
print("Error opening file: {0}".format(value), file=sys.stderr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
#!/usr/bin/env python | ||
|
||
from __future__ import print_function | ||
from pexif import JpegFile | ||
import sys | ||
|
||
usage = """Usage: dump_timestamp.py filename.jpg""" | ||
|
||
if len(sys.argv) != 2: | ||
print >> sys.stderr, usage | ||
print(usage, file=sys.stderr) | ||
sys.exit(1) | ||
|
||
try: | ||
ef = JpegFile.fromFile(sys.argv[1]) | ||
primary = ef.get_exif().get_primary() | ||
print "Primary DateTime :", primary.DateTime | ||
print "Extended DateTimeOriginal :", primary.ExtendedEXIF.DateTimeOriginal | ||
print "Extended DateTimeDigitized:", primary.ExtendedEXIF.DateTimeDigitized | ||
print("Primary DateTime : {0}".format(primary.DateTime)) | ||
print("Extended DateTimeOriginal : {0}".format(primary.ExtendedEXIF.DateTimeOriginal)) | ||
print("Extended DateTimeDigitized: {0}".format(primary.ExtendedEXIF.DateTimeDigitized)) | ||
except IOError: | ||
type, value, traceback = sys.exc_info() | ||
print >> sys.stderr, "Error opening file:", value | ||
print("Error opening file: {0}".format(value), file=sys.stderr) | ||
except JpegFile.InvalidFile: | ||
type, value, traceback = sys.exc_info() | ||
print >> sys.stderr, "Error opening file:", value | ||
print("Error opening file: {0}".format(value), file=sys.stderr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
#!/usr/bin/env python | ||
|
||
from __future__ import print_function | ||
from pexif import JpegFile | ||
import sys | ||
|
||
usage = """Usage: getgps.py filename.jpg""" | ||
|
||
if len(sys.argv) != 2: | ||
print >> sys.stderr, usage | ||
print(usage, file=sys.stderr) | ||
sys.exit(1) | ||
|
||
try: | ||
ef = JpegFile.fromFile(sys.argv[1]) | ||
print ef.get_geo() | ||
print(ef.get_geo()) | ||
except IOError: | ||
type, value, traceback = sys.exc_info() | ||
print >> sys.stderr, "Error opening file:", value | ||
print("Error opening file: {0}".format(value), file=sys.stderr) | ||
except JpegFile.NoSection: | ||
type, value, traceback = sys.exc_info() | ||
print >> sys.stderr, "Error get GPS info:", value | ||
print("Error get GPS info: {0}".format(value), file=sys.stderr) | ||
except JpegFile.InvalidFile: | ||
type, value, traceback = sys.exc_info() | ||
print >> sys.stderr, "Error opening file:", value | ||
print("Error opening file: {0}".format(value), file=sys.stderr) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,29 @@ | ||
#!/usr/bin/env python | ||
|
||
from __future__ import print_function | ||
from pexif import JpegFile | ||
import sys | ||
|
||
usage = """Usage: dump_exif.py filename.jpg out.jpg""" | ||
|
||
if len(sys.argv) != 3: | ||
print >> sys.stderr, usage | ||
print(usage, file=sys.stderr) | ||
sys.exit(1) | ||
|
||
try: | ||
ef = JpegFile.fromFile(sys.argv[1]) | ||
except IOError: | ||
type, value, traceback = sys.exc_info() | ||
print >> sys.stderr, "Error opening file:", value | ||
print("Error opening file: {0}".format(value), file=sys.stderr) | ||
sys.exit(1) | ||
except JpegFile.InvalidFile: | ||
type, value, traceback = sys.exc_info() | ||
print >> sys.stderr, "Error opening file:", value | ||
print("Error opening file: {0}".format(value), file=sys.stderr) | ||
sys.exit(1) | ||
|
||
try: | ||
ef.writeFile(sys.argv[2]) | ||
except IOError: | ||
type, value, traceback = sys.exc_info() | ||
print >> sys.stderr, "Error saving file:", value | ||
print("Error saving file: {0}".format(value), file=sys.stderr) | ||
sys.exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
#!/usr/bin/env python | ||
|
||
from __future__ import print_function | ||
from pexif import JpegFile | ||
import sys | ||
|
||
usage = """Usage: remove_metadata.py filename.jpg""" | ||
|
||
if len(sys.argv) != 4: | ||
print >> sys.stderr, usage | ||
print(usage, file=sys.stderr) | ||
sys.exit(1) | ||
|
||
try: | ||
ef = JpegFile.fromFile(sys.argv[1]) | ||
ef.remove_metadata(paranoid=True) | ||
except IOError: | ||
type, value, traceback = sys.exc_info() | ||
print >> sys.stderr, "Error opening file:", value | ||
print("Error opening file: {0}".format(value), file=sys.stderr) | ||
except JpegFile.InvalidFile: | ||
type, value, traceback = sys.exc_info() | ||
print >> sys.stderr, "Error opening file:", value | ||
print("Error opening file: {0}".format(value), file=sys.stderr) | ||
|
||
try: | ||
ef.writeFile(sys.argv[1]) | ||
except IOError: | ||
type, value, traceback = sys.exc_info() | ||
print >> sys.stderr, "Error saving file:", value | ||
print("Error saving file: {0}".format(value), file=sys.stderr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
#!/usr/bin/env python | ||
from __future__ import print_function | ||
from pexif import JpegFile | ||
import sys | ||
|
||
usage = """Usage: setgps.py filename.jpg lat lng""" | ||
|
||
if len(sys.argv) != 4: | ||
print >> sys.stderr, usage | ||
print(usage, file=sys.stderr) | ||
sys.exit(1) | ||
|
||
try: | ||
ef = JpegFile.fromFile(sys.argv[1]) | ||
ef.set_geo(float(sys.argv[2]), float(sys.argv[3])) | ||
except IOError: | ||
type, value, traceback = sys.exc_info() | ||
print >> sys.stderr, "Error opening file:", value | ||
print("Error opening file: {0}".format(value), file=sys.stderr) | ||
except JpegFile.InvalidFile: | ||
type, value, traceback = sys.exc_info() | ||
print >> sys.stderr, "Error opening file:", value | ||
print("Error opening file: {0}".format(value), file=sys.stderr) | ||
|
||
try: | ||
ef.writeFile(sys.argv[1]) | ||
except IOError: | ||
type, value, traceback = sys.exc_info() | ||
print >> sys.stderr, "Error saving file:", value | ||
print("Error saving file: {0}".format(value), file=sys.stderr) | ||
|
Oops, something went wrong.