aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--find_magick.sh12
-rwxr-xr-xmkcube1
-rwxr-xr-xmkheart1
-rwxr-xr-xmkthoughts1
4 files changed, 15 insertions, 0 deletions
diff --git a/find_magick.sh b/find_magick.sh
new file mode 100644
index 00000000..4bedd384
--- /dev/null
+++ b/find_magick.sh
@@ -0,0 +1,12 @@
+if ! command -v magick > /dev/null; then magick() {
+ for i in \
+ convert identify mogrify composite montage \
+ compare stream display animate import conjure
+ do
+ if test "$1" = "$i"; then
+ "$@"
+ return
+ fi
+ done
+ convert "$@";
+}; fi
diff --git a/mkcube b/mkcube
index 79c0d990..42521264 100755
--- a/mkcube
+++ b/mkcube
@@ -5,6 +5,7 @@ outfile="$2"
avifile="$(mktemp --suffix=.avi)"
ppmfile="$(mktemp --suffix=.ppm)"
vktools="tools/Vulkan-Tools"
+. ./find_magick.sh
magick "$infile" -strip "$ppmfile"
"$vktools/build/cube/vkcube" --texture "$ppmfile" --width 100 --height 100 &
vkcube_pid=$!
diff --git a/mkheart b/mkheart
index 537a39e4..80bf8663 100755
--- a/mkheart
+++ b/mkheart
@@ -1,2 +1,3 @@
#!/bin/sh
+. ./find_magick.sh
magick "$1" \( heart.png -resize $(magick identify -ping -format '%wx%h' "$1") \) -compose copy-opacity -composite "$2"
diff --git a/mkthoughts b/mkthoughts
index 773529e4..fd0709a0 100755
--- a/mkthoughts
+++ b/mkthoughts
@@ -1,4 +1,5 @@
#!/bin/sh
+. ./find_magick.sh
magick \
-size 127x128 xc:"${3:-white}" \
"$1" -geometry x74+26+3 -composite \