Altered to work with Pictures without these tags.

From the tutorial of pyexif2:
'''
As a handy shortcut, you can always assign a value for a given key regardless of whether it’s already present in the metadata. If a tag was present, its value is overwritten. If the tag was not present, one is created and its value is set:

>>> metadata[key] = value

'''
http://tilloy.net/dev/pyexiv2/tutorial.html
pull/347/head
Fi156 2016-04-17 13:46:29 +02:00 zatwierdzone przez Dakota Benjamin
rodzic 4e17a87897
commit 23794a62d6
1 zmienionych plików z 3 dodań i 2 usunięć
scripts

Wyświetl plik

@ -78,8 +78,8 @@ class ODMResizeCell(ecto.Cell):
# copy metadata
old_meta.copy(new_meta)
# update metadata size
new_meta['Exif.Photo.PixelXDimension'].value = img_r.shape[0]
new_meta['Exif.Photo.PixelYDimension'].value = img_r.shape[1]
new_meta['Exif.Photo.PixelXDimension'] = img_r.shape[0]
new_meta['Exif.Photo.PixelYDimension'] = img_r.shape[1]
new_meta.write()
# update photos array with new values
photo.path_file = new_path_file
@ -105,3 +105,4 @@ class ODMResizeCell(ecto.Cell):
log.ODM_INFO('Running ODM Resize Cell - Finished')
return ecto.OK if args.end_with != 'resize' else ecto.QUIT