SlackwareThis Forum is for the discussion of Slackware Linux.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Yes, I issued "man date" just after posting that. And I made me a little script to do my videos, also. I can probably put it in the same script, but haven't yet. When I get some time I'll check out "convert" or something in the Imagemagick app and give you a line to replace that one.
If you get there before me, in a Slackware system we have:
mount /mnt/usbdrive # this works
mv /mnt/usbdrive/dcim/100_fuji/* ./ # The "./" is NOT a typo
for file in *.jpg # go through every file...
convert -size 800x600 $file # ...and resize it
umount /mnt/usbdisk # only if you want to
this allows you to type cd instead of /bin/cd on the command line or in scripts.
the $(...) on line 2 is equivalent to `...`, but can be quoted safely.
See man strftime for how to format date.
All characters are safe for file or directory names. You just need to escape special ones with a backslash (\).
finally, you can get ImageMajick from imagemajick.org.
mount /mnt/usbdrive # mounts usb device which is defined in fstab:
# /dev/sda1 /mnt/usbdrive vfat noauto,user,rw 0 0
newdir="$(date +%a-%b%d-%Y-%H-%M-%S)" # creates date string with format: Mon-Apr17-2006-17-36-29
mkdir $HOME/images/$newdir # makes directory with name = date string
cd $HOME/images/$newdir # change to new directory
mv /mnt/usbdrive/dcim/100_fuji/* ./ # move photo images to new directory, using camera specific path, empties camera
mkdir ./web # create a new directory to put web optimized images
for filename in *.jpg # go through every file
convert $filename -sample 800x600 -quality 75 web/$filename #resize, compress, save to web directory
umount /mnt/usbdrive #unmount usb device
It removes images from the camera, puts them in a date/timestamped directory, makes a web directory underneath it, then reduces the size and compresses the images, saving them in the web directory.