Photo border copyright script

A little hack to add a copyright border to photos.. and make them max 604px for Facebook uploading.

This is a (very random) low quality jpg, but you get the idea:

example-border


#!/bin/sh

# Get photos ready for Facebook upload
# Resize to max 604px, add border, add copyright

mkdir fb

for photos in $(ls *.jpg);
do base=$(basename $photos .jpg);

echo -n $base.. ;

imgx=$(identify $photos |cut -d ' ' -f 3|cut -d '+' -f 1|cut -d 'x' -f 1);
imgy=$(identify $photos |cut -d ' ' -f 3|cut -d '+' -f 1|cut -d 'x' -f 2);

if [ $imgx -lt $imgy ]; then
resize=588
else
resize=600
fi

convert $photos -resize "$resize"x"$resize" -bordercolor black -background black \
-border 2 -gravity SouthEast -splice 0x12 -fill white -annotate 0 \
"(c) joebotha.com" fb/fb-"$base".jpg

echo done.;

done

1 thought on “Photo border copyright script

  1. btw. you may want to set the quality/compression so your uploads go faster..

    convert $photos -resize “$resize”x”$resize” -quality 70 \
    -bordercolor black -background black -border 2 -gravity SouthEast \
    -splice 0x12 -fill white -annotate 0 \ “(c) joebotha.com” fb/fb-“$base”.jpg

Comments are closed.