Sha256: 5232fe873ba311c62b2dbf0f0decc98c8cb24446001e4d0cfa0856ed607f7357

Contents?: true

Size: 273 Bytes

Versions: 1

Compression:

Stored size: 273 Bytes

Contents

module FastImageParsing
  class Ico < ImageBase
    def dimensions
      icons = @stream.read(6)[4..5].unpack('v').first
      sizes = icons.times.map { @stream.read(16).unpack('C2').map { |x| x == 0 ? 256 : x } }.sort_by { |w,h| w * h }
      sizes.last
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fastimage-2.4.0 lib/fastimage/fastimage_parsing/ico.rb