Python shell call to exiftool -
i have image, 1.tiff, want copy exif data 2 other images, 2.tiff , 3.tiff. normal shell can write same exif data multiple images typing
exiftool -m -overwrite_original -tagsfromfile "1.tiff" {"2.tiff","3.tiff"}
for reason, not able form pyton. if execute same shell command python script, i.e.
os.system('exiftool -m -overwrite_original -tagsfromfile "1.tiff" {"2.tiff","3.tiff"}')
i following error:
error: file not found - {2.tiff,3.tiff}
it works, however, if call command every single image, written to. i.e.
os.system('exiftool -m -overwrite_original -tagsfromfile "1.tiff" "2.tiff"') os.system('exiftool -m -overwrite_original -tagsfromfile "1.tiff" "3.tiff"')
but, going call command several thousand times, reading exif data 1.tiff on , on again slow. have suggesting on how copy exif data 1 source image multiple images while reading source image once?
the following zip-file contain working bash-script , non-working python equivalent: https://www.dropbox.com/s/nm8fdkdfq7hqi8m/folder.zip?dl=1
os.system
tends act that, on windows. you'll have more success subprocess.call
:
subprocess.call(['exiftool','-m','-overwrite_original','-tagsfromfile','1.tiff','{"2.tiff","3.tiff"}'])
Comments
Post a Comment