version 1.133, 2008/03/18 09:48:11
|
version 1.134, 2008/03/18 10:29:56
|
Line 977 sub create_missing_fonts {
|
Line 977 sub create_missing_fonts {
|
sub convert_figure { |
sub convert_figure { |
my ($not_eps) = @_; |
my ($not_eps) = @_; |
|
|
|
|
my $status_statement='EPS picture for '.$not_eps; |
my $status_statement='EPS picture for '.$not_eps; |
my $eps_f = $not_eps; |
my $eps_f = $not_eps; |
|
|
if ($eps_f=~/\/home\/([^\/]+)\/public_html\//) { |
if ($eps_f=~/\/home\/([^\/]+)\/public_html\//) { |
$eps_f=~s/\/home\/([^\/]+)\/public_html/$1/; |
$eps_f=~s/\/home\/([^\/]+)\/public_html/$1/; |
$eps_f = $perlvar{'lonPrtDir'}.'/'.$eps_f; |
|
} elsif ($eps_f=~/$perlvar{'lonDocRoot'}\/res\//) { |
} elsif ($eps_f=~/$perlvar{'lonDocRoot'}\/res\//) { |
$eps_f=~m/$perlvar{'lonDocRoot'}\/res\/(.+)/; |
$eps_f=~ s/$perlvar{'lonDocRoot'}\/res\/(.+)/$1/; |
$eps_f = $perlvar{'lonPrtDir'}.'/'.$1; |
|
} elsif ($eps_f=~/$perlvar{'lonUsersDir'}\//) { |
} elsif ($eps_f=~/$perlvar{'lonUsersDir'}\//) { |
$eps_f=~/$perlvar{'lonUsersDir'}\/([^\/]+)\/\w\/\w\/\w\/(.+)/; |
$eps_f=~ s/$perlvar{'lonUsersDir'}\/([^\/]+)\/\w\/\w\/\w\/(.+)/$1\/$2/; |
$eps_f = $perlvar{'lonPrtDir'}.'/'.$1.'/'.$2; |
|
} |
} |
$eps_f =~ s/ /\_/g; # Spaces are problematic for system commands and LaTeX. |
|
|
$eps_f = $perlvar{'lonPrtDir'}.'/'.$eps_f; |
|
|
|
# Spaces are problematic for system commands and LaTeX, replace with _ |
|
|
|
$eps_f =~ s/ /\_/g; |
|
|
# |
# |
# If the file is already an .eps or .ps file, |
# If the file is already an .eps or .ps file (eps_f still has the original |
|
# file type), |
# We really just need to copy it from where it was to prtspool |
# We really just need to copy it from where it was to prtspool |
# but with the spaces substituted to _'s. |
# but with the spaces substituted to _'s. |
# |
# |
my ($nsname,$path, $sext) = &fileparse($not_eps, qr/\.(ps|eps)/i); |
my ($nsname,$path, $sext) = &fileparse($eps_f, qr/\.(ps|eps)/i); |
if ($sext =~/ps$/i) { |
if ($sext =~/ps$/i) { |
&File::Path::mkpath($path,0,0777); |
&File::Path::mkpath($path,0,0777); |
copy("$not_eps", "$eps_f"); |
copy("$not_eps", "$eps_f"); |
} else { |
} else { |
|
|
$eps_f .= '.eps'; # Just append the eps ext. |
$eps_f .= '.eps'; # Just append the eps ext. |
my $path=$eps_f; |
my $path= &dirname($eps_f); |
$path =~ s/\/([^\/]+)\.eps$//; |
|
&File::Path::mkpath($path,0,0777); |
&File::Path::mkpath($path,0,0777); |
$not_eps =~ s/^\s+//; |
$not_eps =~ s/^\s+//; |
$not_eps =~ s/\s+$//; |
$not_eps =~ s/\s+$//; |
Line 1017 sub convert_figure {
|
Line 1020 sub convert_figure {
|
'Converting to EPS '.$prettyname); |
'Converting to EPS '.$prettyname); |
} |
} |
system("convert $not_eps $eps_f"); |
system("convert $not_eps $eps_f"); |
|
|
if (not -e $eps_f) { |
if (not -e $eps_f) { |
# converting an animated gif creates either: |
# converting an animated gif creates either: |
# anim.gif.eps.0 |
# anim.gif.eps.0 |