diff --git a/README.md b/README.md index 32d3661..a9f2a86 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,9 @@ Installation ------------ ``` -sudo apt-get install ufraw-batch imagemagick -git submodule update --init --recursive +sudo apt-get install ufraw-batch imagemagick libheif-examples pipenv install pipenv shell -cd heic2jpeg -pipenv install -cd .. ``` License diff --git a/edit.py b/edit.py index 95d00ee..11f1f15 100755 --- a/edit.py +++ b/edit.py @@ -7,7 +7,6 @@ import exif from geopy.geocoders import Nominatim from datetime import datetime import pathlib -from heic2jpeg import heic2jpeg def wait_with_check_closing(win_name): """ @@ -35,9 +34,6 @@ class Image: print("editing", path) self.w = w self.h = h - if pathlib.Path(path).suffix.lower() == ".heic": - h2j = heic2jpeg.Heic2Jpeg(path) - path = h2j.safe() self.path = path self.image = cv2.imread(self.path) self.geolocator = Nominatim(user_agent="jeena-synology-pictures") diff --git a/synology.py b/synology.py index a9c7f61..a8344f7 100755 --- a/synology.py +++ b/synology.py @@ -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()