Class: Identify::Image::PCX

Inherits:
Identify::Image show all
Defined in:
lib/identify.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Identify::Image

#as_hash, formats, identify, inherited, parse

Class Method Details

.handle?(data) ⇒ Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/identify.rb', line 41

def self.handle? data
  data[0].ord == 10
end

Instance Method Details

#parse(data) ⇒ Object



45
46
47
48
# File 'lib/identify.rb', line 45

def parse data
  header = data.unpack('C4S4')
  as_hash 'pcx', header[6] - header[4] + 1, header[7] - header[5] + 1
end