Operation Embiggen

in the website


I enlarged all of my site’s thumbnails to match the new default width of 600px.

#!/bin/bash -x
new_size="600"

embiggen() {
    med_folder="m"

    if [[ ! -d "$1/$med_folder" ]]; then
        return 1
    fi

    cd "$1"

    for img in $(find . -maxdepth 1 -iname "*.jpg" -prune); do
        img=$(echo "$img" | sed 's/\.\///')
        echo "$img"
        cp "$img" "$med_folder"
        mogrify -resize "$2"x+0+0\\> "$med_folder/$img"
    done

    cd ~-
}

if [[ -d "$1" ]]; then
    work_dir="$1"
else
    exit 1
fi

cd "$work_dir"

for dir in $(find * -maxdepth 0 -type d); do
    dir="$(realpath $dir)"
    embiggen "$dir" "$new_size"
done

exit 0


The Reykjavik Marathon

in running

A Summer of Running

in running

Achill Half Marathon

in running


Your email address will not be published. Required fields are marked *