Sha256: 4bc48ca26ac236b6a68f64b2cad2e1891011e173deff81fb326c07e0590c916b

Contents?: true

Size: 434 Bytes

Versions: 11

Compression:

Stored size: 434 Bytes

Contents

# frozen_string_literal: true

Prawn::SVG::Elements::Image.prepend (Module.new do
  def image_dimensions data
    unless (handler = find_image_handler data)
      raise Prawn::SVG::Elements::Base::SkipElementError, 'Unsupported image type supplied to image tag'
    end
    image = handler.new data
    [image.width.to_f, image.height.to_f]
  end

  def find_image_handler data
    Prawn.image_handler.find data rescue nil
  end
end)

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
asciidoctor-pdf-2.3.19 lib/asciidoctor/pdf/ext/prawn-svg/elements/image.rb
asciidoctor-pdf-2.3.18 lib/asciidoctor/pdf/ext/prawn-svg/elements/image.rb
asciidoctor-pdf-2.3.17 lib/asciidoctor/pdf/ext/prawn-svg/elements/image.rb
asciidoctor-pdf-2.3.16 lib/asciidoctor/pdf/ext/prawn-svg/elements/image.rb
asciidoctor-pdf-2.3.15 lib/asciidoctor/pdf/ext/prawn-svg/elements/image.rb
asciidoctor-pdf-2.3.14 lib/asciidoctor/pdf/ext/prawn-svg/elements/image.rb
asciidoctor-pdf-2.3.13 lib/asciidoctor/pdf/ext/prawn-svg/elements/image.rb
asciidoctor-pdf-2.3.12 lib/asciidoctor/pdf/ext/prawn-svg/elements/image.rb
asciidoctor-pdf-2.3.11 lib/asciidoctor/pdf/ext/prawn-svg/elements/image.rb
asciidoctor-pdf-2.3.10 lib/asciidoctor/pdf/ext/prawn-svg/elements/image.rb
asciidoctor-pdf-2.3.9 lib/asciidoctor/pdf/ext/prawn-svg/elements/image.rb