Permalink
Browse files

rotate the picture from our new cam

  • Loading branch information...
1 parent ca4baa6 commit 04c0d0391646ac73c4653a8f1c4bb1606f964e6d @lukec lukec committed Oct 9, 2009
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/VHS.pm
View
@@ -50,6 +50,10 @@ sub take_picture {
my $pic_base = $self->config->{picture_base};
my $filename = "$pic_base/$short_hash.jpeg";
system("streamer -c /dev/video0 -b 16 -o $filename");
+ my $tmp = $filename . ".tmp";
+ system("jpegtran -rotate 180 $filename > $tmp");
+ rename $tmp => $filename if -e $tmp;
+
(my $short_name = $filename) =~ s#.+/(.+).jpeg#$1.jpg#;
my $short_file = "$pic_base/$short_name";
rename $filename => $short_file;

0 comments on commit 04c0d03

Please sign in to comment.