forked from tykayn/mapillary_download
use a with statement to update image metadata
This commit is contained in:
parent
b9060bc2ed
commit
4fcb62f893
22
download.py
22
download.py
@ -99,21 +99,13 @@ def write_exif(picture, img_metadata):
|
|||||||
#{'thumb_original_url': 'https://scontent-cdg4-2.xx.fbcdn.net/m1/v/t6/An9Zy2SrH9vXJIF01QkBODyUbg7XSKfwL48UwHyvihSwvECGjVbG0vSw9uhxe2-Dq-k2eUcigb83buO6zo-7eVbykfp5aQIe1kgd-MJr66nU_H-o_mwBLZXgVbj5I_5WX-C9c6FxJruHkV962F228O0?ccb=10-5&oh=00_AfDOKD869DxL-4ZNCbVo8Rn29vsc0JyjMAU2ctx4aAFVMQ&oe=65256C25&_nc_sid=201bca',
|
#{'thumb_original_url': 'https://scontent-cdg4-2.xx.fbcdn.net/m1/v/t6/An9Zy2SrH9vXJIF01QkBODyUbg7XSKfwL48UwHyvihSwvECGjVbG0vSw9uhxe2-Dq-k2eUcigb83buO6zo-7eVbykfp5aQIe1kgd-MJr66nU_H-o_mwBLZXgVbj5I_5WX-C9c6FxJruHkV962F228O0?ccb=10-5&oh=00_AfDOKD869DxL-4ZNCbVo8Rn29vsc0JyjMAU2ctx4aAFVMQ&oe=65256C25&_nc_sid=201bca',
|
||||||
# 'captured_at': 1603459736644, 'geometry': {'type': 'Point', 'coordinates': [2.5174596904057, 48.777089857534]}, 'id': '485924785946693'}
|
# 'captured_at': 1603459736644, 'geometry': {'type': 'Point', 'coordinates': [2.5174596904057, 48.777089857534]}, 'id': '485924785946693'}
|
||||||
|
|
||||||
#picture = writer.writePictureMetadata(picture, img_metadata)
|
with writer.Writer(picture) as image:
|
||||||
#picture = writer.add_altitude(picture, img_metadata)
|
image.writePictureMetadata(img_metadata)
|
||||||
#picture = writer.add_direction(picture, img_metadata)
|
image.add_altitude(img_metadata)
|
||||||
image = writer.Writer(picture)
|
image.add_direction(img_metadata)
|
||||||
image.writePictureMetadata(img_metadata)
|
image.apply()
|
||||||
image.add_altitude(img_metadata)
|
updated_image = image.get_Bytes()
|
||||||
image.add_direction(img_metadata)
|
|
||||||
image.apply()
|
|
||||||
import copy
|
|
||||||
#bb = copy.copy(updated_image.get_Bytes())
|
|
||||||
#updated_image.close()
|
|
||||||
#TODO voir si j'ai encore besoin d'une copie et d'un .close() si j'ajoute la methode __exit__ à la classe Writer
|
|
||||||
#return updated_image.get_Bytes()
|
|
||||||
updated_image = image.get_Bytes()
|
|
||||||
image.close()
|
|
||||||
return updated_image
|
return updated_image
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
Reference in New Issue
Block a user