add git-annex-compute-imageconvert
This commit is contained in:
parent
825a648670
commit
138421449e
3 changed files with 33 additions and 2 deletions
24
doc/special_remotes/compute/git-annex-compute-imageconvert
Executable file
24
doc/special_remotes/compute/git-annex-compute-imageconvert
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/sh
|
||||
# git-annex compute special remote program that uses imagemagic's convert
|
||||
# to convert one type of image format into another. Eg, jpeg to gif.
|
||||
#
|
||||
# Copyright 2025 Joey Hess; licenced under the GNU GPL version 3 or higher.
|
||||
set -e
|
||||
|
||||
if [ -z "$1" ] || [ -z "$2" ]; then
|
||||
echo "Specify the input image file, followed by the output image file." >&2
|
||||
echo "Example: foo.jpg foo.gif" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "INPUT $1"
|
||||
read input
|
||||
echo "OUTPUT $2"
|
||||
|
||||
if [ -n "$input" ]; then
|
||||
# Prefixing the filenames with "./" makes sure that they are processed
|
||||
# as files, even if they look like dashed options.
|
||||
mkdir -p "$(dirname "./$2")"
|
||||
ln -s "$input" "./$1"
|
||||
convert "./$1" "./$2"
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue