Method: Prawn::ImageHandler#find

Defined in:
lib/prawn/image_handler.rb

#find(image_blob) ⇒ Object

Find an image handler for an image.

Parameters:

  • image_blob (String)

Returns:

  • (Object)

Raises:



52
53
54
55
56
57
58
59
# File 'lib/prawn/image_handler.rb', line 52

def find(image_blob)
  handler = @handlers.find { |h| h.can_render?(image_blob) }

  return handler if handler

  raise Prawn::Errors::UnsupportedImageType,
    'image file is an unrecognised format'
end