aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/epub.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3/epub.rb')
-rw-r--r--lib/sisu/v3/epub.rb11
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