aboutsummaryrefslogtreecommitdiffstats
path: root/nph-png
blob: 0240b64fb76736937486edc3069e23e802d3235d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/perl

use strict;
use vars qw ($file $DELAY);
########## CONFIG
  $file = "lcd4linux"; # .png is appended
  $DELAY = 0;          # delay in seconds
                       # if delay is zero, file is sent when modified.
#################

use CGI qw/:push -nph/;
$| = 1;
my ($mtime, $nmtime, $size, $nsize);
(undef, undef, undef, undef, undef, undef, undef, $size, undef,
   $mtime) = stat "$file.png";
print multipart_init(-boundary=>'----------------here we go!');
while (1) {
  print multipart_start(-type=>'image/png');
  undef $/;
  open(IN, "$file.png") or die("Can't read '$file.png'");
  $_ = <IN>;
  print $_;
  close(IN);
  print multipart_end;
  if ($DELAY) {
    sleep $DELAY;
  }  
  else {
    W: while (1) {
  #    sleep(1);
      (undef, undef, undef, undef, undef, undef, undef, $nsize, undef,
         $nmtime) = stat "$file.png";
      if($mtime != $nmtime || $size != $nsize) {	 
        $mtime = $nmtime;
	$size = $nsize;
	last W;
      }	
    }	 
  }	
}
t6-29/+50 corrected a off-by-one bug with sensors 2001-03-13[lcd4linux @ 2001-03-13 08:03:41 by reinelt]reinelt3-1/+35 added missing autoheader files 2001-03-13[lcd4linux @ 2001-03-13 07:53:00 by reinelt]reinelt2-13/+15 added several files for the distribution 2001-03-13[lcd4linux @ 2001-03-13 07:41:22 by reinelt]reinelt3-2/+52 added NEWS file 2001-03-12[lcd4linux @ 2001-03-12 13:44:58 by reinelt]reinelt8-58/+232 new udelay() using Time Stamp Counters 2001-03-12[lcd4linux @ 2001-03-12 12:49:24 by reinelt]reinelt2-63/+71 even better configure handling... 2001-03-12[lcd4linux @ 2001-03-12 12:39:36 by reinelt]reinelt14-448/+830 reworked autoconf a lot: drivers may be excluded, #define's went to config.h 2001-03-09[lcd4linux @ 2001-03-09 16:24:30 by ltoetsch]ltoetsch2-155/+345 disable driver in configure 2001-03-09[lcd4linux @ 2001-03-09 15:04:53 by reinelt]reinelt3-103/+109 rename 'raster' to 'Text in Text.c added TOTO item 2001-03-09[lcd4linux @ 2001-03-09 14:30:01 by reinelt]reinelt1-0/+7 new ideas for TODO 2001-03-09[lcd4linux @ 2001-03-09 14:24:49 by ltoetsch]ltoetsch3-7/+18 exec: Scale_x ->Min/Max_x 2001-03-09[lcd4linux @ 2001-03-09 13:08:11 by ltoetsch]ltoetsch12-86/+384 Added Text driver 2001-03-09[lcd4linux @ 2001-03-09 12:14:24 by reinelt]reinelt4-21/+34 minor cleanups 2001-03-08[lcd4linux @ 2001-03-08 15:25:38 by ltoetsch]ltoetsch9-93/+214 improved exec 2001-03-08[lcd4linux @ 2001-03-08 09:02:04 by reinelt]reinelt4-133/+21 seti client cleanup 2001-03-08[lcd4linux @ 2001-03-08 08:39:54 by reinelt]reinelt2-4/+12 fixed two typos 2001-03-07[lcd4linux @ 2001-03-07 18:10:21 by ltoetsch]ltoetsch10-110/+319 added e(x)ec commands 2001-03-05[lcd4linux @ 2001-03-05 18:20:21 by reinelt]reinelt2-13/+25 TOTO list update 2001-03-04[lcd4linux @ 2001-03-04 15:01:12 by ltoetsch]ltoetsch1-3/+3 Added PNG 2001-03-02[lcd4linux @ 2001-03-02 20:18:12 by reinelt]reinelt3-36/+89 allow compile on systems without net/if_ppp.h