diff options
author | Ralph Amissah <ralph@amissah.com> | 2012-06-03 14:39:42 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2012-06-03 14:39:42 -0400 |
commit | 26e5e47cb281d7ee98abcc619332b87b321aaed0 (patch) | |
tree | 10cc58f649f2569992fbbde9730baa3ee74054da /lib/sisu/v3/epub.rb | |
parent | v3: manifest, paths, (for command line selection of output type) fix (diff) |
v3: images, regular & sisupod
Diffstat (limited to 'lib/sisu/v3/epub.rb')
-rw-r--r-- | lib/sisu/v3/epub.rb | 11 |
1 files changed, 9 insertions, 2 deletions
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 |