lib/fn/pdf/writer.rb in fn_document-0.9.14 vs lib/fn/pdf/writer.rb in fn_document-0.9.15
- old
+ new
@@ -115,10 +115,10 @@
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
urlimage = open(block.src)
- tmp = Magick::Image::from_blob(urlimage.read)
+ tmp = Magick::Image::from_blob(urlimage.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",
:boxsize => [width, height])
\ No newline at end of file