new (PDF::Writer::Graphics::ImageInfo)

        # File lib/pdf/writer/graphics/imageinfo.rb, line 54
    54:   def initialize(data, format = nil)
    55:     @data   = data.dup rescue data
    56:     @info   = {}
    57:
    58:     if @data.kind_of?(IO)
    59:       @top = @data.read(128)
    60:       @data.seek(0, 0)
    61:         # Define Singleton-method definition to IO (byte, offset)

    62:       def @data.read_o(length = 1, offset = nil)
    63:         self.seek(offset, 0) if offset
    64:         ret = self.read(length)
    65:         raise "cannot read!!" unless ret
    66:         ret
    67:       end
    68:     elsif @data.is_a?(String)
    69:       @top = @data[0, 128]
    70:         # Define Singleton-method definition to String (byte, offset)

    71:       @data.extend(PDF::Writer::OffsetReader)
    72:     else
    73:       raise "argument class error!! #{data.type}"
    74:     end
    75:
    76:     if format.nil?
    77:       @format = discover_format
    78:     else
    79:       match = false
    80:       Formats.constants.each { |t| match = true if format == t }
    81:       raise("format is failed. #{format}\n") unless match
    82:       @format = format
    83:     end
    84:
    85:     __send__("measure_#@format".intern) unless @format == Formats::OTHER
    86:
    87:     @data = data.dup
    88:   end