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