diff --git a/bin/review-epubmaker b/bin/review-epubmaker index 8895d77ff..1da25bf1d 100755 --- a/bin/review-epubmaker +++ b/bin/review-epubmaker @@ -92,7 +92,8 @@ def main if File.exist?("images") Dir.mkdir("#{@bookdir}/OEBPS/images") - image_files = ReVIEW::MakerHelper.copy_images_to_dir("images", "#{@bookdir}/OEBPS/images") + image_files = ReVIEW::MakerHelper.copy_images_to_dir("images", "#{@bookdir}/OEBPS/images", + :convert => {:eps => :png}) image_files.each do |image_file| dirname = File.dirname(image_file) fname = File.basename(image_file) diff --git a/lib/review/htmlbuilder.rb b/lib/review/htmlbuilder.rb index fb123bd35..31ca61914 100644 --- a/lib/review/htmlbuilder.rb +++ b/lib/review/htmlbuilder.rb @@ -613,10 +613,14 @@ def result_metric(array) " #{array.join(' ')}" end + + def image_image(id, caption, metric) metrics = parse_metric("html", metric) + img_path = @chapter.image(id).path.sub(/\A\.\//, "") + img_path = img_path + ".png" if img_path =~ /\.eps\Z/ puts %Q[
] - puts %Q[#{escape_html(compile_inline(caption))}] + puts %Q[#{escape_html(compile_inline(caption))}] image_header id, caption puts %Q[
] end diff --git a/test/test_htmlbuilder.rb b/test/test_htmlbuilder.rb index 45c5ca4c1..76abe2ff9 100644 --- a/test/test_htmlbuilder.rb +++ b/test/test_htmlbuilder.rb @@ -195,6 +195,17 @@ def @chapter.image(id) assert_equal %Q|
\nsample photo\n

\n図1.1: sample photo\n

\n
\n|, @builder.raw_result end + def test_image_eps + def @chapter.image(id) + item = Book::ImageIndex::Item.new("sampleimg",1) + item.instance_eval{@pathes=["./images/chap1-sampleimg.eps"]} + item + end + + @builder.image_image("sampleimg","sample photo",nil) + assert_equal %Q|
\nsample photo\n

\n図1.1: sample photo\n

\n
\n|, @builder.raw_result + end + def test_image_with_metric def @chapter.image(id) item = Book::ImageIndex::Item.new("sampleimg",1)