version 1.341, 2006/11/06 11:39:02
|
version 1.343, 2006/11/06 23:45:00
|
Line 2860 sub start_img {
|
Line 2860 sub start_img {
|
my ($height_param,$width_param)= |
my ($height_param,$width_param)= |
&image_size($origsrc,0.3,$parstack,$safeeval); |
&image_size($origsrc,0.3,$parstack,$safeeval); |
my $destpath = $path; |
my $destpath = $path; |
$destpath =~ s/ /\_/g; # Spaces in path cause LaTex to vomit. |
|
my $destfile = $file; |
my $destfile = $file; |
$destfile =~ s/ /\_/g; |
|
my $size; |
my $size; |
if ($width_param) { $size.='width='.$width_param.' mm,'; } |
if ($width_param) { $size.='width='.$width_param.' mm,'; } |
if ($height_param) { $size.='height='.$height_param.' mm]'; } |
if ($height_param) { $size.='height='.$height_param.' mm]'; } |
# Default size if not able to extract that (e.g. eps image). |
# Default size if not able to extract that (e.g. eps image). |
|
|
# &Apache::lonnet::logthis("Size = $size"); |
# &Apache::lonnet::logthis("Size = $size"); |
if ($size eq "0 mm") { |
|
$size = "50 mm]"; # Default to 1 column width for 2 column. |
|
} |
|
|
|
$size='['.$size; |
$size='['.$size; |
$size=~s/,$/]/; |
$size=~s/,$/]/; |
Line 4248 sub get_eps_image {
|
Line 4243 sub get_eps_image {
|
$src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$src); |
$src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$src); |
&Apache::lonxml::debug("Filelocation gives: $src"); |
&Apache::lonxml::debug("Filelocation gives: $src"); |
if (! -e $src) { |
if (! -e $src) { |
# &Apache::lonnet::logthis("$src does not exist...repcopying"); |
|
&Apache::lonxml::debug("$src does not exist"); |
&Apache::lonxml::debug("$src does not exist"); |
if (&Apache::lonnet::repcopy($src) ne 'ok' ) { |
if (&Apache::lonnet::repcopy($src) ne 'ok' ) { |
&Apache::lonxml::debug("Repcopy of $src failed (1)"); |
&Apache::lonxml::debug("Repcopy of $src failed (1)"); |
Line 4260 sub get_eps_image {
|
Line 4254 sub get_eps_image {
|
&Apache::lonxml::debug("repcopy of $src ... $didrepcopy"); |
&Apache::lonxml::debug("repcopy of $src ... $didrepcopy"); |
if ( (not -e $src) || |
if ( (not -e $src) || |
($didrepcopy ne 'ok')) { |
($didrepcopy ne 'ok')) { |
# &Apache::lonnet::logthis("queuing $orig_src for dynamic eps gen"); |
|
&Apache::lonxml::debug("Failed to find or replicate $src"); |
&Apache::lonxml::debug("Failed to find or replicate $src"); |
|
|
#if replication failed try to produce eps file dynamically |
#if replication failed try to produce eps file dynamically |
Line 4279 sub get_eps_image {
|
Line 4272 sub get_eps_image {
|
} |
} |
|
|
} |
} |
|
|
} |
} |
} else { |
} else { |
# &Apache::lonnet::logthis("$src exists. queueing for copy."); |
|
# &Apache::lonnet::logthis("Got eps already.. queue for copy"); |
|
# If the postscript file has spaces in its name, |
# If the postscript file has spaces in its name, |
# LaTeX will gratuitiously vomit. Therefore |
# LaTeX will gratuitiously vomit. Therefore |
# queue such files for copy with " " replaced by "_". |
# queue such files for copy with " " replaced by "_". |
Line 4290 sub get_eps_image {
|
Line 4282 sub get_eps_image {
|
my $newsrc = $orig_src; |
my $newsrc = $orig_src; |
$newsrc =~ s|(.*)/res/|/home/httpd/html/res/|; |
$newsrc =~ s|(.*)/res/|/home/httpd/html/res/|; |
open(FILE,">>/home/httpd/prtspool/$env{'user.name'}_$env{'user.domain'}_printout.dat"); |
open(FILE,">>/home/httpd/prtspool/$env{'user.name'}_$env{'user.domain'}_printout.dat"); |
# &Apache::lonnet::logthis("Queueing $newsrc for copy"); |
print FILE "$src\n"; |
print FILE "$newsrc\n"; |
|
close FILE; |
close FILE; |
$src=~s|/home/httpd/html/res|/home/httpd/prtspool|; |
$src=~s|/home/httpd/html/res|/home/httpd/prtspool|; |
$src=~s|/home/([^/]*)/public_html/|/home/httpd/prtspool/$1/|; |
$src=~s|/home/([^/]*)/public_html/|/home/httpd/prtspool/$1/|; |
} |
} |
my ($path,$file)=($src=~m|(.*)/([^/]*)$|); |
my ($path,$file)=($src=~m|(.*)/([^/]*)$|); |
|
$file =~ s/ /\_/g; |
&Apache::lonxml::debug("get_eps_image returning: $path / $file<BR />"); |
&Apache::lonxml::debug("get_eps_image returning: $path / $file<BR />"); |
return ($path.'/',$file); |
return ($path.'/',$file); |
} |
} |