projects
/
treecutter.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
image: improving xmp support
[treecutter.git]
/
treecutter
/
image.py
diff --git
a/treecutter/image.py
b/treecutter/image.py
index d031e2650a26ec7f6fc2d172db5288e1b54c241f..6136a0d62fcd81a5ad65da48c7db84027ba4f3e7 100644
(file)
--- a/
treecutter/image.py
+++ b/
treecutter/image.py
@@
-51,6
+51,12
@@
class Image():
if retcode:
print 'Error: '+' '.join(cmd)+' Returncode ['+str(retcode)+']'
exit
if retcode:
print 'Error: '+' '.join(cmd)+' Returncode ['+str(retcode)+']'
exit
+ else:
+ cmd = ['exiftool', '-XMP:CreatorTool=treecutter','-quiet','-overwrite_original', outfile]
+ retcode = subprocess.call(cmd)
+ if retcode:
+ print 'Error: '+' '.join(cmd)+' Returncode ['+str(retcode)+']'
+ exit
xmpfile.close_file()
self._format[size] = outfile
return outfile
xmpfile.close_file()
self._format[size] = outfile
return outfile
@@
-58,6
+64,8
@@
class Image():
def generated(self):
xmpfile = XMPFiles(file_path=self._filename)
xmp = xmpfile.get_xmp()
def generated(self):
xmpfile = XMPFiles(file_path=self._filename)
xmp = xmpfile.get_xmp()
+ if not xmp:
+ return False
cr = None
if xmp.does_property_exist(consts.XMP_NS_XMP, u'CreatorTool'):
cr = xmp.get_property(consts.XMP_NS_XMP, u'CreatorTool')
cr = None
if xmp.does_property_exist(consts.XMP_NS_XMP, u'CreatorTool'):
cr = xmp.get_property(consts.XMP_NS_XMP, u'CreatorTool')