[LON-CAPA-cvs] cvs: loncom /xml londefdef.pm

foxr lon-capa-cvs@mail.lon-capa.org
Thu, 11 Aug 2005 22:04:11 -0000


foxr		Thu Aug 11 18:04:11 2005 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  Re bug 3954 - ensure that get_eps_image also pulls in the
  source image immediately so that <IMG> won't substitute the
  ALT text if the source image has not yet been replicated.
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.284 loncom/xml/londefdef.pm:1.285
--- loncom/xml/londefdef.pm:1.284	Sun Aug  7 12:53:07 2005
+++ loncom/xml/londefdef.pm	Thu Aug 11 18:04:09 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.284 2005/08/07 16:53:07 albertel Exp $
+# $Id: londefdef.pm,v 1.285 2005/08/11 22:04:09 foxr Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -3965,6 +3965,13 @@
 sub get_eps_image {
     my ($src)=@_;
     my $orig_src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1], $src);
+
+    # In order to prevent the substitution of the alt text, we need to
+    # be sure the orig_src file is on system now so:
+
+    if (! -e $orig_src) {
+	&Apache::lonnet::repcopy($orig_src); # Failure is not completely fatal.
+    }
     &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;