[LON-CAPA-cvs] cvs: loncom /interface printout.pl /localize/localize de.pm

droeschl droeschl@source.lon-capa.org
Tue, 08 Feb 2011 12:53:39 -0000


droeschl		Tue Feb  8 12:53:39 2011 EDT

  Modified files:              
    /loncom/localize/localize	de.pm 
    /loncom/interface	printout.pl 
  Log:
  Depending on the version of  convert  the tool might exit with an error (e.g.
  segmentation fault) when trying to convert certain image files.  This change is
  supposed to capture these errors and print a suitable message to the user.
  Usually saving the image with different settings (or a different program) is
  enough to avoid the segfaults.
  
  
Index: loncom/localize/localize/de.pm
diff -u loncom/localize/localize/de.pm:1.408 loncom/localize/localize/de.pm:1.409
--- loncom/localize/localize/de.pm:1.408	Tue Feb  8 10:31:26 2011
+++ loncom/localize/localize/de.pm	Tue Feb  8 12:53:33 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # German Localization Lexicon
 #
-# $Id: de.pm,v 1.408 2011/02/08 10:31:26 bisitz Exp $
+# $Id: de.pm,v 1.409 2011/02/08 12:53:33 droeschl Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -21449,6 +21449,9 @@
    'Size (MB)'
 => 'Größe (MB)',
 
+   'An error occured during the conversion of [_1].[_2]If possible try to save this image using different settings and republish it.'
+=> 'Es ist ein Fehler bei der Konvertierung von [_1] aufgetreten.[_2]Falls möglich, versuchen Sie bitte das Bild mit anderen Einstellungen zu speichern und veröffentlichen Sie es erneut.',
+
    ''
 => '',
 
Index: loncom/interface/printout.pl
diff -u loncom/interface/printout.pl:1.146 loncom/interface/printout.pl:1.147
--- loncom/interface/printout.pl:1.146	Thu Apr 29 10:51:37 2010
+++ loncom/interface/printout.pl	Tue Feb  8 12:53:39 2011
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 # CGI-script to run LaTeX, dvips, ps2ps, ps2pdf etc.
 #
-# $Id: printout.pl,v 1.146 2010/04/29 10:51:37 foxr Exp $
+# $Id: printout.pl,v 1.147 2011/02/08 12:53:39 droeschl Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -911,8 +911,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,
@@ -935,6 +935,13 @@
 	    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) {