Diff for /loncom/homework/convertjme.pl between versions 1.13 and 1.16

version 1.13, 2005/02/09 21:50:06 version 1.16, 2011/07/04 09:24:54
Line 34  use strict; Line 34  use strict;
 ### For standalone operation, set $loncapa to 0, and comment out both uses  ### For standalone operation, set $loncapa to 0, and comment out both uses
 my $loncapa=1;  my $loncapa=1;
 use lib '/home/httpd/lib/perl';  use lib '/home/httpd/lib/perl';
 use LONCAPA::loncgi();  use LONCAPA::loncgi;
   use LONCAPA;
   
 use GD;  use GD;
 use PostScript::Simple;  use PostScript::Simple;
Line 66  sub unescape { Line 66  sub unescape {
 my ($id,$width,$ps,$png,@JMEstring);  my ($id,$width,$ps,$png,@JMEstring);
 if ($loncapa) {  if ($loncapa) {
     $id=$ENV{'QUERY_STRING'};      $id=$ENV{'QUERY_STRING'};
     $width = $ENV{'cgi.'.$id.'.WIDTH'};      $width = $Apache::lonnet::env{'cgi.'.$id.'.WIDTH'};
     if (!$width) { $width = 400; }      if (!$width) { $width = 400; }
     $png = $ENV{'cgi.'.$id.'.PNG'};      $png = $Apache::lonnet::env{'cgi.'.$id.'.PNG'};
     $ps = $ENV{'cgi.'.$id.'.PS'};      $ps = $Apache::lonnet::env{'cgi.'.$id.'.PS'};
     @JMEstring=&unescape($ENV{'cgi.'.$id.'.JME'});      @JMEstring=&unescape($Apache::lonnet::env{'cgi.'.$id.'.JME'});
 } else {  } else {
     @JMEstring = @ARGV;      @JMEstring = @ARGV;
     $width = shift @JMEstring;      $width = shift @JMEstring;
Line 431  if ($loncapa) { Line 431  if ($loncapa) {
  print "Content-type: image/png\n\n";   print "Content-type: image/png\n\n";
  print $im->png;   print $im->png;
     } elsif ($ps) {      } elsif ($ps) {
  my $psfile = "/home/httpd/perl/tmp/".$id.'.eps';   my $psfile = LONCAPA::tempdir().$id.'.eps';
  $im->output($psfile);   $im->output($psfile);
  print "Content-type: text/html\n\n";   print "Content-type: text/html\n\n";
  print (<<HTML)   print (<<HTML)

Removed from v.1.13  
changed lines
  Added in v.1.16


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>