[LON-CAPA-cvs] cvs: loncom(version_2_10_X) /interface printout.pl

raeburn raeburn@source.lon-capa.org
Fri, 04 Mar 2011 16:53:06 -0000


raeburn		Fri Mar  4 16:53:06 2011 EDT

  Modified files:              (Branch: version_2_10_X)
    /loncom/interface	printout.pl 
  Log:
  - Backport 1.147.
  
  
Index: loncom/interface/printout.pl
diff -u loncom/interface/printout.pl:1.146.4.1 loncom/interface/printout.pl:1.146.4.2
--- loncom/interface/printout.pl:1.146.4.1	Thu Aug 26 08:32:58 2010
+++ loncom/interface/printout.pl	Fri Mar  4 16:53:06 2011
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 # CGI-script to run LaTeX, dvips, ps2ps, ps2pdf etc.
 #
-# $Id: printout.pl,v 1.146.4.1 2010/08/26 08:32:58 raeburn Exp $
+# $Id: printout.pl,v 1.146.4.2 2011/03/04 16:53:06 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -904,8 +904,8 @@
 	$not_eps =~ s/^\s+//;
 	$not_eps =~ s/\s+$//;
 	$not_eps =~ s/ /\\ /g;
+        my $prettyname=$not_eps;
 	if ($advanced_role) {
-	    my $prettyname=$not_eps;
 	    $prettyname=~s|/home/([^/]+)/public_html|/priv/$1|;
 	    $prettyname=~s|$perlvar{'lonDocRoot'}/|/|;
 	    &Apache::lonhtmlcommon::Update_PrgWin('',\%prog_state,
@@ -928,6 +928,12 @@
 	    system("pdftops $not_eps $eps_f");
 	} else {
 	    system("convert $not_eps $eps_f");
+            if ($? and $advanced_role) {
+                print '<p class="LC_warning">'
+                      .&mt('An error occured during the conversion of [_1].[_2]If possible try to save this image using different settings and republish it.',
+                      '<span class="LC_filename">'.$prettyname.'</span>','<br/>')
+                      .'</p>';
+            }
 	}
 
 	if (not -e $eps_f) {