[LON-CAPA-cvs] cvs: loncom /homework randomlylabel.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 15 Jul 2004 18:06:09 -0000


albertel		Thu Jul 15 14:06:09 2004 EDT

  Modified files:              
    /loncom/homework	randomlylabel.pm 
  Log:
  - BUG#3213, Fedora Core 2 GD isn't reading pallatized PNGs corectly, force them to truecolor mode 
  
  
Index: loncom/homework/randomlylabel.pm
diff -u loncom/homework/randomlylabel.pm:1.19 loncom/homework/randomlylabel.pm:1.20
--- loncom/homework/randomlylabel.pm:1.19	Tue Mar 16 18:08:23 2004
+++ loncom/homework/randomlylabel.pm	Thu Jul 15 14:06:09 2004
@@ -2,7 +2,7 @@
 # The LearningOnline Network with CAPA
 # randomlabel.png: composite together text and images into 1 image
 #
-# $Id: randomlylabel.pm,v 1.19 2004/03/16 23:08:23 albertel Exp $
+# $Id: randomlylabel.pm,v 1.20 2004/07/15 18:06:09 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -54,6 +54,7 @@
 	    if ($response->content_type !~ m-/(png|jpg|jpeg)$-i) {
 		my $conv_image = Image::Magick->new;
 		my $current_figure = $conv_image->Read('filename'=>$file);
+		$conv_image->Set('type'=>'TrueColor');
 		$conv_image->Set('magick'=>'png');
 		my @blobs=$conv_image->ImageToBlob();
 		undef $conv_image;
@@ -66,6 +67,7 @@
     } elsif ($imgsrc !~ /\.(png|jpg|jpeg)$/i) {
 	my $conv_image = Image::Magick->new;
 	my $current_figure = $conv_image->Read('filename'=>$imgsrc);
+	$conv_image->Set('type'=>'TrueColor');
 	$conv_image->Set('magick'=>'png');
 	my @blobs=$conv_image->ImageToBlob();
 	undef $conv_image;