Remove darktable HEIF adapter
darktable supports reading HEIF as of v3.8.
This commit is contained in:
parent
4ba55dd943
commit
78555d9c04
2 changed files with 1 additions and 71 deletions
|
@ -13,9 +13,6 @@ let
|
|||
|
||||
# Packages
|
||||
add-words = pkgs.callPackage ../packages/add-words.nix { };
|
||||
darktable-heif = pkgs.callPackage ../packages/darktable-heif.nix {
|
||||
inherit (pkgs.gnome) zenity;
|
||||
};
|
||||
gh = pkgs.callPackage ../packages/gh.nix { };
|
||||
git-diff-image = pkgs.callPackage ../packages/git-diff-image.nix { };
|
||||
gopass-await = pkgs.callPackage ../packages/gopass-await.nix {
|
||||
|
@ -73,7 +70,6 @@ in
|
|||
add-words
|
||||
corefonts
|
||||
darktable
|
||||
darktable-heif
|
||||
delta
|
||||
dnsutils
|
||||
exiftool
|
||||
|
@ -481,6 +477,7 @@ in
|
|||
xdg.mimeApps = {
|
||||
enable = true;
|
||||
associations.added = {
|
||||
# Pending https://github.com/darktable-org/darktable/pull/12218
|
||||
"image/heif" = [ "darktable-heif.desktop" ];
|
||||
};
|
||||
defaultApplications = {
|
||||
|
|
|
@ -1,67 +0,0 @@
|
|||
{ makeDesktopItem
|
||||
, writeShellScriptBin
|
||||
|
||||
# Dependencies
|
||||
, darktable
|
||||
, exiftool
|
||||
, ffmpeg
|
||||
, imagemagick
|
||||
, libheif
|
||||
, zenity
|
||||
}:
|
||||
|
||||
let
|
||||
core = writeShellScriptBin "darktable-heif" ''
|
||||
set -Eeuxo pipefail
|
||||
|
||||
heifs=( "$@" )
|
||||
total="''${#heifs[@]}"
|
||||
|
||||
exec 3> >(${zenity}/bin/zenity --width 600 --progress --percentage=0 --auto-close)
|
||||
|
||||
steps='3'
|
||||
links=(); for i in "''${!heifs[@]}"; do
|
||||
heif="''${heifs[$i]}"
|
||||
link="$heif.tif"
|
||||
tiff="/tmp/heif-darktable$heif.tif"
|
||||
|
||||
echo "# Extracting $(basename "$heif")" >&3
|
||||
echo "$(( (steps * i + 0) * 100 / (steps * total) ))" >&3
|
||||
|
||||
if [ ! -f "$tiff" ]; then
|
||||
y4m="$(mktemp --tmpdir=/dev/shm --suffix=.y4m)"; trap 'rm -f "$y4m"' EXIT
|
||||
exif="$(mktemp -u --tmpdir=/dev/shm --suffix=.tif)"; trap 'rm -f "$exif"' EXIT
|
||||
|
||||
nice ${libheif}/bin/heif-convert "$heif" "$y4m"
|
||||
|
||||
echo "$(( (steps * i + 1) * 100 / (steps * total) ))" >&3
|
||||
${ffmpeg}/bin/ffmpeg -i "$y4m" -c:v 'ppm' -f 'image2pipe' - \
|
||||
| nice ${imagemagick}/bin/convert ppm:- "$exif"
|
||||
rm "$y4m"
|
||||
|
||||
echo "$(( (steps * i + 2) * 100 / (steps * total) ))" >&3
|
||||
${exiftool}/bin/exiftool -overwrite_original -TagsFromFile "$heif" -all:all -ICC_Profile -Orientation= "$exif"
|
||||
|
||||
mkdir -p "$(dirname "$tiff")"
|
||||
mv "$exif" "$tiff"
|
||||
fi
|
||||
|
||||
if [ ! -L "$link" ]; then
|
||||
ln -s "$tiff" "$link"
|
||||
fi
|
||||
|
||||
links+=("$link")
|
||||
done
|
||||
|
||||
exec 3>&-
|
||||
|
||||
exec ${darktable}/bin/darktable "''${links[@]}"
|
||||
'';
|
||||
in
|
||||
makeDesktopItem {
|
||||
name = "darktable-heif";
|
||||
desktopName = "Darktable (HEIF)";
|
||||
icon = "darktable";
|
||||
mimeTypes = [ "image/heif" ];
|
||||
exec = "${core}/bin/darktable-heif %F";
|
||||
}
|
Loading…
Reference in a new issue