Skip to content

Commit d9bed0b

Browse files
author
James Campbell
committed
updates to iptcinfo to clean it up a bit
1 parent 0e43abf commit d9bed0b

File tree

3 files changed

+96
-33
lines changed

3 files changed

+96
-33
lines changed

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ xlrd = "*"
4444
pyicu = "*"
4545
pprint = "*"
4646
iptcinfo3 = "*"
47+
bpython = "*"
4748

4849
[requires]
4950
python_version = "3.7"

Pipfile.lock

Lines changed: 91 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

iptcinfo3-example.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@
33
Author: James Campbell
44
Date: 5 July 2019
55
"""
6-
import sys
7-
86
import iptcinfo3
97

10-
im = open(sys.argv[1])
118
try:
12-
info = iptcinfo3.IPTCInfo(sys.argv[1])
9+
info = iptcinfo3.IPTCInfo('assets/guy881.jpg', inp_charset="cp1250",
10+
out_charset='cp1250', force=True)
1311
print('-------IPTC DATA FOUND-------')
12+
print(info.packedIIMData())
1413
for k, v in info._data.items():
15-
print(k, v)
14+
print(f"KEY: {k} VALUE: {str(v)}")
1615
# info['city'] = '#magistræde #🇩🇰'
1716
# info.save()
1817
except Exception as e:

0 commit comments

Comments
 (0)