From c7f4ff94b232adac607f0a8ad4ca00ee619a4bec Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 8 Oct 2010 11:35:43 -0400 Subject: texpdf, scaling of images (below the set max size), fix (+changelog) (requested fix) --- lib/sisu/v2/texpdf_format.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v2/texpdf_format.rb b/lib/sisu/v2/texpdf_format.rb index 8eff07b9..36366c9b 100644 --- a/lib/sisu/v2/texpdf_format.rb +++ b/lib/sisu/v2/texpdf_format.rb @@ -339,7 +339,7 @@ module SiSU_TeX_Pdf image=z[/(\S+?\.(?:png|jpg|gif)\b)/m] image.gsub!(/\\/,'') width=if z =~ /\d+x\d*/ - w=(z[/(\d+)x\d*/,1]).to_i + w=(z[/\s(\d+)x\d*/,1]).to_i w*0.8 else '100' #revisit, is bug for small images/icons end @@ -498,7 +498,7 @@ module SiSU_TeX_Pdf and images_hash[ps]=~/\s+\d+x\d+(\s+|\s*#{Mx[:lnk_c]})/m image,x,y=z.scan(/\S+/) image.gsub!(/\\/,'') - w=((z =~/(\d+)x\d*/) ? z[/(\d+)x\d*/,1] : 200) + w=((z =~/\s(\d+)x\d*/) ? z[/\s(\d+)x\d*/,1] : 200) width={} width['a4'] = ((w.to_i > @dm['a4']) ? @dm['a4'] : w) width['letter'] = ((w.to_i > @dm['letter']) ? @dm['letter'] : w) -- cgit v1.2.3