lib/fn/pdf/writer.rb in fn_document-0.9.17 vs lib/fn/pdf/writer.rb in fn_document-0.9.18
- old
+ new
@@ -114,10 +114,10 @@
begin
context.inject_at_page(block.page_number) do
# image = doc.resource(block.src).path_from(root)
# tmp = Magick::Image::read(image).first
# http://stackoverflow.com/questions/7264895/rmagick-can-not-read-remote-image
- image = open(doc.resource(block.src))
+ image = open(doc.resource(block.src).path_from(root))
tmp = Magick::Image::from_blob(image.read).first
dims = [tmp.columns.to_f, tmp.rows.to_f]
x, y, width, height = calculate(block, dims)
context.add LoadImage(image, "tmp")
context.add FitImage("{tmp}", x, y, :fitmethod => "meet",
\ No newline at end of file