See below for version 3 of the script.
The heavy lifting was done by schragge at the Ubuntu Forum's Programming sub-forum.
So - I wrote a VERY simple script to pull everything off.
It puts the images in a folder labeled with the date.
It resizes the images for posting on my website.
(I live in Sweden, but am from the US, my wife is from Japan - so we have a website devoted to our kids. Both sets of Grandparents love it.)
It puts the videos in a folder I use to store clips until I can edit them.
It removes all the thumbnail (.THM) files from the camera.
Anyway, here it is:
The heavy lifting was done by schragge at the Ubuntu Forum's Programming sub-forum.
So - I wrote a VERY simple script to pull everything off.
It puts the images in a folder labeled with the date.
It resizes the images for posting on my website.
(I live in Sweden, but am from the US, my wife is from Japan - so we have a website devoted to our kids. Both sets of Grandparents love it.)
It puts the videos in a folder I use to store clips until I can edit them.
It removes all the thumbnail (.THM) files from the camera.
Anyway, here it is:
Code Select
### Unload_camera ###
### By Grouchy Gaijin ###
### Tweaked by Sector_11 ###
### This is really simple. You only need to install GraphicsMagick to resize the images and then adjust
###the paths of the folders. ###
### Make the script executable chmod +x Unload_camera and call the script from the camera. ###
#!/bin/bash
echo "Are you SURE you are in the right folder??"
##### Because I am a dumbass and sometimes run this from the wrong folder. #####
echo "ALL files in the clips folder will be deleted."
#### Because I always forget to delete them after I post a video #####
read -p "If so, press the [Enter] key continue..."
# now is the folder where the script will put your photos #
# I have the date set in the format of 15-Apr-2013 #
now=$(date +"%d-%b-%Y")
# gm mogrify is the GraphicsMagick command to resize all jpeg files in the source direcory #
gm mogrify -resize 720x720 *.jpg *.JPG
# change the path of mkdir to where ever you want the new direcory to be #
mkdir ~/path/to/$now &&
mv *.JPG ~/path/to/$now
mv *.jpg ~/path/to/$now
# The script will pull any videos off your camera and put them in the assigned direcory #
# My direcory is called clips. Before moving new videos into the clips direcory, the script will delete # # anything it finds there. #
rm -f /path/to/the/direcory/where/you/store/all/of/your/clips/before/editing/*
# The script also removes any video thumbnail files from the camera #
# I added .MOV and .mov in case you pull from a drive with Mac files on it (iPhone, cough cough) #
rm *.THM
mv *.MPG /path/to/destination/folder/
mv *.MOV /path/to/destination/folder/
mv *.mov /path/to/destination/folder/