aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2010-10-08 11:38:07 -0400
committerRalph Amissah <ralph@amissah.com>2010-10-08 11:38:12 -0400
commit20d511b8b4113c76619875920f50a04758bfba00 (patch)
tree94c3d1b1f2cda04374c0a828df8d61d673a2675b /lib
parenttexpdf, scaling of images (below the set max size), fix (+changelog) (diff)
odf:odt, incorporation and scaling of images, fix (+changelog)
(requested fix)
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v2/odf.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/sisu/v2/odf.rb b/lib/sisu/v2/odf.rb
index bb071683..41229249 100644
--- a/lib/sisu/v2/odf.rb
+++ b/lib/sisu/v2/odf.rb
@@ -197,7 +197,7 @@ module SiSU_ODF
m,u=img[1],img[2]
i=/^(\S+?\.(?:png|jpg|gif))/.match(m).captures.join if m =~/^(\S+?\.(?:png|jpg|gif))/
c=/^\S+?\.(?:png|jpg|gif)\s+.+?"(.*?)"/.match(m).captures.join if m =~/^\S+?\.(?:png|jpg|gif)\s+.+?"(.*?)"/
- w,h=/(\d+)x(\d+)/.match(m).captures if m =~/\d+x\d+/
+ w,h=/\s(\d+)x(\d+)/.match(m).captures if m =~/\s\d+x\d+/
w=(w.to_i/37.79485).to_s
h=(h.to_i/37.79485).to_s
h=/([0-9]+\.\d{0,3})/.match(h).captures.join
@@ -225,7 +225,8 @@ module SiSU_ODF
cont.gsub!(/([)(\]\[])/,"\\\\\\1")
cont.gsub!(/([+?])/,"\\\\\\1") # incorrect handling of +
url.gsub!(/([+?])/,"\\\\\\1")
- dob.obj.sub!(/#{Mx[:lnk_o]}[ ]*#{cont}[ ]*#{Mx[:lnk_c]}#{Mx[:url_o]}#{url}#{Mx[:url_c]}/m,image_odf(i)) #watch
+ dob.obj.sub!(/#{Mx[:lnk_o]}[ ]*#{cont}[ ]*#{Mx[:lnk_c]}image/m,image_odf(i))
+ dob.obj.sub!(/#{Mx[:lnk_o]}[ ]*#{cont}[ ]*#{Mx[:lnk_c]}#{Mx[:url_o]}#{url}#{Mx[:url_c]}/m,image_odf(i))
dob.obj.gsub!(/\\([)(\]\[?])/,'\1') #clumsy fix
end
m=nil