View Single Post
Posts: 167 | Thanked: 204 times | Joined on Jul 2010
#3
Use case 2: post-processing camera images with ImageMagick

For some reason let's say we want smaller images, whether that's for web or e-mail use or whatever. Perhaps we just want to save on our upload bandwidth when we backup / publish our images. Anyway, we can tell incron to call ImageMagick on any newly-created photo, placing the smaller image under /media/mmc1/vga/ (which we've created manually beforehand)

Code:
/media/mmc1/DCIM IN_CLOSE_WRITE nice -n 19 convert $@/$# -resize 640x /media/mmc1/vga/$#
/media/mmc1/vga IN_CLOSE_WRITE curl -T $@/$# http://<user:pass>@files.memotoo.com/webFolder/DCIM/
Then we (optionally) trigger an upload of the VGA-resolution image when it arrives in the ImageMagick output dir (second line). Or we could do whatever else with it...if we install 'mailcmd' then we have a command-line approach to sending e-mail from the default account in modest.

Code:
/media/mmc1/DCIM IN_CLOSE_WRITE nice -n 19 convert $@/$# -resize 640x /media/mmc1/vga/$# 
/media/mmc1/vga IN_CLOSE_WRITE run-standalone.sh mailcmd -s $# -a $@/$# user@email.host </dev/null
It takes typically 12-15 seconds to shrink the photo, attach it to an e-mail and dump it in Modest's outbox for sending.

Last edited by magick777; 2013-06-12 at 23:22.
 

The Following 6 Users Say Thank You to magick777 For This Useful Post: