Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/prawn/images.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ def embed_image(pdf_obj, info, options)

def verify_and_open_image(io_or_path)
# File or IO
if io_or_path.respond_to?(:rewind)
if io_or_path.respond_to?(:read)
io = io_or_path
# Rewind if the object we're passed is an IO, so that multiple embeds of
# the same IO object will work
io.rewind
io.rewind if io.respond_to?(:rewind)
# read the file as binary so the size is calculated correctly
# guard binmode because some objects acting io-like don't implement it
io.binmode if io.respond_to?(:binmode)
Expand Down