Diff for /loncom/homework/randomlylabel.pm between versions 1.3 and 1.5

version 1.3, 2002/11/17 09:43:40 version 1.5, 2003/01/23 18:26:10
Line 39  use GD; Line 39  use GD;
 sub get_image {  sub get_image {
     my ($imgsrc,$set_trans)=@_;      my ($imgsrc,$set_trans)=@_;
     my $image;      my $image;
     if ($imgsrc !~ /\.(png|jpg|jpeg)$/) {      if ($imgsrc !~ /\.(png|jpg|jpeg)$/i) {
  my $conv_image = Image::Magick->new;   my $conv_image = Image::Magick->new;
  my $current_figure = $conv_image->Read('filename'=>$imgsrc);   my $current_figure = $conv_image->Read('filename'=>$imgsrc);
  $conv_image->Set('magick'=>'png');   $conv_image->Set('magick'=>'png');
Line 64  sub handler { Line 64  sub handler {
                &Apache::lonnet::unescape($ENV{'imagerequest.'.$token}));                 &Apache::lonnet::unescape($ENV{'imagerequest.'.$token}));
     &Apache::lonnet::delenv('imagerequest\.'.$token);      &Apache::lonnet::delenv('imagerequest\.'.$token);
     my $image=&get_image($ENV{"form.BGIMG"},0);      my $image=&get_image($ENV{"form.BGIMG"},0);
       if (! defined($image)) {
           &Apache::lonnet::logthis('Unable to create image object for '.$ENV{"form.BGIMG"});
           return OK;
       }
     #binmode(STDOUT);      #binmode(STDOUT);
     my $black = $image->colorAllocate(0,0,0);      my $black = $image->colorAllocate(0,0,0);
     for(my $i=0;$i<$ENV{"form.ICOUNT"};$i++) {      for(my $i=0;$i<$ENV{"form.ICOUNT"};$i++) {

Removed from v.1.3  
changed lines
  Added in v.1.5


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