mirror of
https://github.com/Brandon-Rozek/website.git
synced 2025-07-31 14:12:01 +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
|
||||
|
||||
# Check that relevant command exist
|
||||
if ! command -v identify > /dev/null; then
|
||||
echo "Command identify from imagemagick not found. Exiting..."
|
||||
if ! command -v magick > /dev/null; then
|
||||
echo "Command magick from imagemagick not found. Exiting..."
|
||||
fi
|
||||
|
||||
IMAGE_FILE="$1"
|
||||
LAT=$(identify -format "%[EXIF:GPSLatitude]\n" "$IMAGE_FILE")
|
||||
LAT_DIR=$(identify -format "%[EXIF:GPSLatitudeRef]\n" "$IMAGE_FILE")
|
||||
LON=$(identify -format "%[EXIF:GPSLongitude]\n" "$IMAGE_FILE")
|
||||
LON_DIR=$(identify -format "%[EXIF:GPSLongitudeRef]\n" "$IMAGE_FILE")
|
||||
ALT=$(identify -format "%[EXIF:GPSAltitude]\n" "$IMAGE_FILE")
|
||||
LAT=$(magick identify -format "%[EXIF:GPSLatitude]\n" "$IMAGE_FILE")
|
||||
LAT_DIR=$(magick identify -format "%[EXIF:GPSLatitudeRef]\n" "$IMAGE_FILE")
|
||||
LON=$(magick identify -format "%[EXIF:GPSLongitude]\n" "$IMAGE_FILE")
|
||||
LON_DIR=$(magick identify -format "%[EXIF:GPSLongitudeRef]\n" "$IMAGE_FILE")
|
||||
ALT=$(magick identify -format "%[EXIF:GPSAltitude]\n" "$IMAGE_FILE")
|
||||
|
||||
DegreesToDecimal() {
|
||||
L0=$(echo "$1" | cut -d "," -f 1)
|
||||
|
|
|
@ -24,7 +24,7 @@ if [[ "$1" != *.jpg ]]; then
|
|||
fi
|
||||
|
||||
# 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..."
|
||||
fi
|
||||
if ! command -v jpegoptim > /dev/null; then
|
||||
|
@ -32,6 +32,6 @@ if ! command -v jpegoptim > /dev/null; then
|
|||
fi
|
||||
|
||||
cp "$1" "$1.bak"
|
||||
mogrify -resize "$WIDTH" "$1"
|
||||
magick mogrify -resize "$WIDTH" "$1"
|
||||
jpegoptim "$1"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue