[LON-CAPA-cvs] cvs: loncom /cgi barcode.gif graph.gif

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 13 Dec 2002 21:33:30 -0000


albertel		Fri Dec 13 16:33:30 2002 EDT

  Modified files:              
    /loncom/cgi	graph.gif barcode.gif 
  Log:
  - output png instead
  
  
Index: loncom/cgi/graph.gif
diff -u loncom/cgi/graph.gif:1.15 loncom/cgi/graph.gif:1.16
--- loncom/cgi/graph.gif:1.15	Fri Nov  1 17:12:46 2002
+++ loncom/cgi/graph.gif	Fri Dec 13 16:33:30 2002
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 #
-# $Id: graph.gif,v 1.15 2002/11/01 22:12:46 minaeibi Exp $
+# $Id: graph.gif,v 1.16 2002/12/13 21:33:30 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -104,9 +104,9 @@
 #}
 
 
-# Tell the server we are sending a gif graphic
+# Tell the server we are sending a png graphic
 print <<END;
-Content-type: image/gif
+Content-type: image/png
 
 END
 
@@ -122,7 +122,8 @@
 my $BinaryData=$MyGraph->plot(\@data)->png;
 undef $MyGraph;
 binmode(STDOUT);
-open IMG,"|pngtopnm|ppmtogif 2>/dev/null"; # convert into a gif image
-print IMG $BinaryData; # output image
-$|=1; # be sure to flush before closing
-close IMG;
+#open IMG,"|pngtopnm|ppmtogif 2>/dev/null"; # convert into a gif image
+#print IMG $BinaryData; # output image
+#$|=1; # be sure to flush before closing
+#close IMG;
+print $BinaryData;
Index: loncom/cgi/barcode.gif
diff -u loncom/cgi/barcode.gif:1.9 loncom/cgi/barcode.gif:1.10
--- loncom/cgi/barcode.gif:1.9	Thu Jan  3 09:47:23 2002
+++ loncom/cgi/barcode.gif	Fri Dec 13 16:33:30 2002
@@ -1,9 +1,9 @@
 #!/usr/bin/perl
 
 # The LearningOnline Network with CAPA
-# barcode.gif - A CGI script that dynamically outputs a barcode.
+# barcode.png - A CGI script that dynamically outputs a barcode.
 #
-# $Id: barcode.gif,v 1.9 2002/01/03 14:47:23 matthew Exp $
+# $Id: barcode.gif,v 1.10 2002/12/13 21:33:30 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -53,9 +53,9 @@
     }
 }
 
-# Tell the server we are sending a gif graphic
+# Tell the server we are sending a png graphic
 print <<END;
-Content-type: image/gif
+Content-type: image/png
 
 END
 
@@ -71,7 +71,8 @@
 my $bindata=$oGdBar->plot->png; # create barcode image
 undef $oGdBar;
 binmode(STDOUT);
-open OUT,"|pngtopnm|ppmtogif 2>/dev/null"; # convert into gif image
-print OUT $bindata; # output image
-$|=1; # be sure to flush before closing
-close OUT;
+#open OUT,"|pngtopnm|ppmtogif 2>/dev/null"; # convert into gif image
+#print OUT $bindata; # output image
+#$|=1; # be sure to flush before closing
+#close OUT;
+print $bindata;