--- loncom/xml/londefdef.pm 2005/07/12 21:05:49 1.281 +++ loncom/xml/londefdef.pm 2005/08/02 15:22:56 1.283 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.281 2005/07/12 21:05:49 foxr Exp $ +# $Id: londefdef.pm,v 1.283 2005/08/02 15:22:56 albertel Exp $ # # # Copyright Michigan State University Board of Trustees @@ -47,7 +47,7 @@ use Image::Magick; use Apache::lonmenu(); use Apache::lonmeta(); use Apache::Constants qw(:common); - +use File::Basename; BEGIN { @@ -3962,6 +3962,7 @@ sub get_eps_image { my ($src)=@_; my $orig_src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1], $src); &Apache::lonxml::debug("get_eps_image: Original image: $orig_src"); + my ($spath, $sname, $sext) = fileparse($src, qr/\.(gif|png|jpg|jpeg)/i); $src=~s/\.(gif|png|jpg|jpeg)$/\.eps/i; $src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$src); &Apache::lonxml::debug("Filelocation gives: $src"); @@ -3990,6 +3991,9 @@ sub get_eps_image { close FILE; $src=~s|/home/httpd/html/res|/home/httpd/prtspool|; $src=~s|/home/([^/]*)/public_html/|/home/httpd/prtspool/$1/|; + if ($sext ne "") { # Put the ext. back in to uniquify. + $src =~ s/\.eps$/$sext.eps/; + } } } }