I upload many of my photos and RAW files to the Internet Archive, but its web-based uploader is slow and clunky.
Fortunately, the Internet Archive offers a command-line tool, so I've cobbled together a Bash script for uploading JPEG and RAW files.
#!/usr/bin/bash
if [ ! -x "$(command -v ia)" ] || [ ! -x "$(command -v yad)" ] || [ ! -x "$(command -v exiv2)" ]; then
echo "Make sure that ia, exiv2, and yad are installed."
exit 1
fi
creator="Your name goes here"
license="https://creativecommons.org/licenses/by/4.0/"
filename=$(basename -- "$1")
title="${filename%.*}"
keywords=$(exiv2 -g Keywords -Pv "$1" | tr '\n' ',')
subject=$(echo "$keywords" | yad --text-info --center --width=400 --height=200 --editable --wrap)
imagedescription=$(exiv2 -g Exif.Image.ImageDescription -Pv "$1")
description=$(echo "$imagedescription" | yad --text-info --center --width=400 --height=200 --editable --wrap)
dt=$(exiv2 -g Exif.Image.DateTimeOriginal -Pv $1 | cut -d' ' -f1 | tr ':' '-')
ia upload "$title" $1 $2 \
--metadata="mediatype:image" \
--metadata="collection:opensource_image" \
--metadata="title:$title" \
--metadata="description:$description" \
--metadata="subject:$subject" \
--metadata="creator:$creator" \
--metadata="date:$dt" \
--metadata="licenseurl:$license"
chmod +x ~/bin/ia.sh
command.To upload a JPEG+RAW pair, use the following command:
ia.sh img.JPG img.RAW
A few notes:
create
and license
values.