Merge pull request #606 from paulinus/fix-resize-exif

Fix x,y dimensions in exif after resize.

Former-commit-id: 2f3b723dcf
pull/1161/head
Dakota Benjamin 2017-06-19 10:09:39 -04:00 zatwierdzone przez GitHub
commit 9eebb41653
1 zmienionych plików z 6 dodań i 6 usunięć

Wyświetl plik

@ -37,13 +37,13 @@ def resize(src_dir, target_dir, resize_to, rerun_cell, photo):
# copy metadata
old_meta.copy(new_meta)
# update metadata size
new_meta['Exif.Photo.PixelXDimension'] = img_r.shape[0]
new_meta['Exif.Photo.PixelYDimension'] = img_r.shape[1]
new_meta['Exif.Photo.PixelXDimension'] = img_r.shape[1]
new_meta['Exif.Photo.PixelYDimension'] = img_r.shape[0]
new_meta.write()
# update photos array with new values
photo.path_file = new_path_file
photo.width = img_r.shape[0]
photo.height = img_r.shape[1]
photo.width = img_r.shape[1]
photo.height = img_r.shape[0]
photo.update_focal()
# log message
@ -69,8 +69,8 @@ def no_resize(src_dir,target_dir,rerun_cell,photo):
img = cv2.imread(path_file)
io.copy(path_file, new_path_file)
photo.path_file = new_path_file
photo.width = img.shape[0]
photo.height = img.shape[1]
photo.width = img.shape[1]
photo.height = img.shape[0]
photo.update_focal()
# log message