Remove heic2jpeg and add libheif-examples instead
This commit is contained in:
parent
1d8defc5bb
commit
2c3425c94d
3 changed files with 10 additions and 11 deletions
|
@ -9,13 +9,9 @@ Installation
|
||||||
------------
|
------------
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo apt-get install ufraw-batch imagemagick
|
sudo apt-get install ufraw-batch imagemagick libheif-examples
|
||||||
git submodule update --init --recursive
|
|
||||||
pipenv install
|
pipenv install
|
||||||
pipenv shell
|
pipenv shell
|
||||||
cd heic2jpeg
|
|
||||||
pipenv install
|
|
||||||
cd ..
|
|
||||||
```
|
```
|
||||||
|
|
||||||
License
|
License
|
||||||
|
|
4
edit.py
4
edit.py
|
@ -7,7 +7,6 @@ import exif
|
||||||
from geopy.geocoders import Nominatim
|
from geopy.geocoders import Nominatim
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import pathlib
|
import pathlib
|
||||||
from heic2jpeg import heic2jpeg
|
|
||||||
|
|
||||||
def wait_with_check_closing(win_name):
|
def wait_with_check_closing(win_name):
|
||||||
"""
|
"""
|
||||||
|
@ -35,9 +34,6 @@ class Image:
|
||||||
print("editing", path)
|
print("editing", path)
|
||||||
self.w = w
|
self.w = w
|
||||||
self.h = h
|
self.h = h
|
||||||
if pathlib.Path(path).suffix.lower() == ".heic":
|
|
||||||
h2j = heic2jpeg.Heic2Jpeg(path)
|
|
||||||
path = h2j.safe()
|
|
||||||
self.path = path
|
self.path = path
|
||||||
self.image = cv2.imread(self.path)
|
self.image = cv2.imread(self.path)
|
||||||
self.geolocator = Nominatim(user_agent="jeena-synology-pictures")
|
self.geolocator = Nominatim(user_agent="jeena-synology-pictures")
|
||||||
|
|
11
synology.py
11
synology.py
|
@ -53,9 +53,16 @@ def fetch_files(remotehost, pictures):
|
||||||
escaped_remotefile = helper.escape_file_path(remotefile)
|
escaped_remotefile = helper.escape_file_path(remotefile)
|
||||||
cmd = 'scp -P 23 "' + remotehost + ':' + escaped_remotefile + '" "' + localfile + '"'
|
cmd = 'scp -P 23 "' + remotehost + ':' + escaped_remotefile + '" "' + localfile + '"'
|
||||||
if os.system(cmd) == 0:
|
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
|
# Get .xmp file if available
|
||||||
cmd = 'scp -P 23 "' + remotehost + ':' + escaped_remotefile + '.xmp" "' + localfile + '.xmp"'
|
cmd = 'scp -P 23 "' + remotehost + ':' + escaped_remotefile + '.xmp" "' + localfile + '.xmp"'
|
||||||
if os.system(cmd) == 0:
|
if os.system(cmd) == 0:
|
||||||
# Use darktable
|
# Use darktable
|
||||||
d = Darktable(localfile)
|
d = Darktable(localfile)
|
||||||
d.export()
|
d.export()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue