Remove heic2jpeg and add libheif-examples instead

This commit is contained in:
Jeena 2022-10-22 22:11:01 +09:00
parent 1d8defc5bb
commit 2c3425c94d
3 changed files with 10 additions and 11 deletions

View file

@ -53,9 +53,16 @@ def fetch_files(remotehost, pictures):
escaped_remotefile = helper.escape_file_path(remotefile)
cmd = 'scp -P 23 "' + remotehost + ':' + escaped_remotefile + '" "' + localfile + '"'
if os.system(cmd) == 0:
(p, e) = os.path.splitext(localfile)
if e == ".HEIC":
old_localfile = localfile
localfile = old_localfile + ".jpg"
cmd = 'heif-convert "' + old_localfile + '" "' + localfile + '"'
os.system(cmd)
os.remove(old_localfile)
# Get .xmp file if available
cmd = 'scp -P 23 "' + remotehost + ':' + escaped_remotefile + '.xmp" "' + localfile + '.xmp"'
if os.system(cmd) == 0:
cmd = 'scp -P 23 "' + remotehost + ':' + escaped_remotefile + '.xmp" "' + localfile + '.xmp"'
if os.system(cmd) == 0:
# Use darktable
d = Darktable(localfile)
d.export()