From 26e5e47cb281d7ee98abcc619332b87b321aaed0 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 3 Jun 2012 14:39:42 -0400 Subject: v3: images, regular & sisupod --- lib/sisu/v3/epub.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/sisu/v3/epub.rb') diff --git a/lib/sisu/v3/epub.rb b/lib/sisu/v3/epub.rb index 70b86f25..a2530cbb 100644 --- a/lib/sisu/v3/epub.rb +++ b/lib/sisu/v3/epub.rb @@ -631,13 +631,20 @@ module SiSU_EPUB end def images img_pth=@md.env.path.image_source_include + img_src_pth=unless @md.opt.f_pth[:pth] =~/\/\S+?\/sisupod\/\S+?\/sisupod\/doc/ + @md.file.output_path.epub.rel_image + else + pt=/(\/\S+?\/sisupod\/\S+?\/sisupod)\/doc/.match(@md.opt.f_pth[:pth])[1] + pt + '/image' + end @md.ec[:image].each do |x| if FileTest.directory?("#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image") \ - && FileTest.file?("#{@md.file.output_path.epub.rel_image}/#{x}") - FileUtils::cp("#{@md.file.output_path.epub.rel_image}/#{x}","#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image") + && FileTest.file?("#{img_src_pth}/#{x}") + FileUtils::cp("#{img_src_pth}/#{x}","#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image") elsif FileTest.directory?("#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image") \ && FileTest.file?("#{img_pth}/#{x}") FileUtils::cp("#{img_pth}/#{x}","#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image") + else STDERR.puts %{\t*WARN* did not find image - "#{x}" in #{img_src_pth} or #{img_pth} [#{__FILE__}:#{__LINE__}]} end end end -- cgit v1.2.3