Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

First drafts of camera tools.

  • Loading branch information...
commit 100413ad7b872020515755c94e3f0f753a31f848 1 parent 6687be4
@pmichaud authored
View
27 bin/arcp
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+export PHOTO_HOME=${PHOTO_HOME:-/zip/photo}
+
+arcphoto () {
+ IMG=$1
+ IMGDATE=$(exiftool -p '$DateTimeOriginal' -d '%Y/%Y-%m-%d' $IMG)
+ [ -z "$IMGDATE" ] && return 1
+ DESTDIR="$PHOTO_HOME/$IMGDATE"
+ mkdir -p $DESTDIR
+ DESTFILE=$(echo "$DESTDIR/$(basename $IMG)" | tr A-Z a-z )
+ [ $IMG -ef $DESTFILE ] && return 0
+ if cmp -s $IMG DESTFILE
+ then
+ echo rm -f $IMG
+ rm -f $IMG
+ elif [ -d $DESTDIR ]
+ then
+ echo mv -iu $IMG $DESTFILE
+ mv -iu $IMG $DESTFILE
+ fi
+}
+
+for f in "$@"
+do
+ arcphoto $f
+done
View
33 bin/arcwatch
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+declare -A SEEN
+
+fixtag() {
+ IMG=$1
+ exiftool -P '-FileModifyDate>DateTimeOriginal' -if 'not $DateTimeOriginal' $IMG
+}
+
+fixname() {
+ exiftool '-DateTimeOriginal>FileName' -d 'img-%Y%m%d-%H%M%S%%-c.%%e' $1
+}
+
+while true
+do
+ SLEEP=2
+ for img in $(find . -maxdepth 1 -regex '.*\.\(jpg\|png\)' '!' -newermt -5sec )
+ do
+ [ -z ${SEEN["$img"]} ] || continue;
+ SEEN["$img"]="$img"
+ echo $img
+ if [[ $img == ./Image-*.jpg ]]
+ then
+ fixtag $img
+ fixname $img
+ SLEEP=0
+ continue
+ fi
+ bin/arcp $img
+ done
+ sleep $SLEEP
+done
+
View
3  bin/mplayer-uvc
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+mplayer -geometry 800x600+100+100 tv:// -tv driver=v4l2:device=/dev/video1:width=800:height=600 $*
View
3  bin/mplayer-uvc-noborder
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+mplayer -geometry 800x600+100+100 tv:// -tv driver=v4l2:device=/dev/video1:width=800:height=600 -noborder $*
View
3  bin/mplayer-uvc-portrait
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+mplayer -geometry 600x800+200-0 tv:// -tv driver=v4l2:device=/dev/video1:width=800:height=600 -vf rotate=1 $*
View
3  bin/mplayer-webcam-noborder
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+mplayer -geometry 800x600+100+100 tv:// -tv driver=v4l2:device=/dev/video0:width=800:height=600 -noborder $*
Please sign in to comment.
Something went wrong with that request. Please try again.