mirror of
https://github.com/Brandon-Rozek/website.git
synced 2025-08-03 23:31:59 +00:00
Updated Imagemagick scripts
This commit is contained in:
parent
ab76252cd4
commit
d3438d98a0
2 changed files with 9 additions and 9 deletions
|
@ -15,16 +15,16 @@ if [ "$#" -ne 1 ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check that relevant command exist
|
# Check that relevant command exist
|
||||||
if ! command -v identify > /dev/null; then
|
if ! command -v magick > /dev/null; then
|
||||||
echo "Command identify from imagemagick not found. Exiting..."
|
echo "Command magick from imagemagick not found. Exiting..."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
IMAGE_FILE="$1"
|
IMAGE_FILE="$1"
|
||||||
LAT=$(identify -format "%[EXIF:GPSLatitude]\n" "$IMAGE_FILE")
|
LAT=$(magick identify -format "%[EXIF:GPSLatitude]\n" "$IMAGE_FILE")
|
||||||
LAT_DIR=$(identify -format "%[EXIF:GPSLatitudeRef]\n" "$IMAGE_FILE")
|
LAT_DIR=$(magick identify -format "%[EXIF:GPSLatitudeRef]\n" "$IMAGE_FILE")
|
||||||
LON=$(identify -format "%[EXIF:GPSLongitude]\n" "$IMAGE_FILE")
|
LON=$(magick identify -format "%[EXIF:GPSLongitude]\n" "$IMAGE_FILE")
|
||||||
LON_DIR=$(identify -format "%[EXIF:GPSLongitudeRef]\n" "$IMAGE_FILE")
|
LON_DIR=$(magick identify -format "%[EXIF:GPSLongitudeRef]\n" "$IMAGE_FILE")
|
||||||
ALT=$(identify -format "%[EXIF:GPSAltitude]\n" "$IMAGE_FILE")
|
ALT=$(magick identify -format "%[EXIF:GPSAltitude]\n" "$IMAGE_FILE")
|
||||||
|
|
||||||
DegreesToDecimal() {
|
DegreesToDecimal() {
|
||||||
L0=$(echo "$1" | cut -d "," -f 1)
|
L0=$(echo "$1" | cut -d "," -f 1)
|
||||||
|
|
|
@ -24,7 +24,7 @@ if [[ "$1" != *.jpg ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check that relevant commands exist
|
# Check that relevant commands exist
|
||||||
if ! command -v mogrify > /dev/null; then
|
if ! command -v magick > /dev/null; then
|
||||||
echo "Command magick not found. Exiting..."
|
echo "Command magick not found. Exiting..."
|
||||||
fi
|
fi
|
||||||
if ! command -v jpegoptim > /dev/null; then
|
if ! command -v jpegoptim > /dev/null; then
|
||||||
|
@ -32,6 +32,6 @@ if ! command -v jpegoptim > /dev/null; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp "$1" "$1.bak"
|
cp "$1" "$1.bak"
|
||||||
mogrify -resize "$WIDTH" "$1"
|
magick mogrify -resize "$WIDTH" "$1"
|
||||||
jpegoptim "$1"
|
jpegoptim "$1"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue