Class: Pdf::Reader::ExtractImages::Tiff

Inherits:
Object
  • Object
show all
Defined in:
lib/pdf/reader/extract_images/tiff.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stream) ⇒ Tiff

Returns a new instance of Tiff.



5
6
7
# File 'lib/pdf/reader/extract_images/tiff.rb', line 5

def initialize(stream)
  @stream = stream
end

Instance Attribute Details

#streamObject (readonly)

Returns the value of attribute stream.



3
4
5
# File 'lib/pdf/reader/extract_images/tiff.rb', line 3

def stream
  @stream
end

Instance Method Details

#save(filename) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/pdf/reader/extract_images/tiff.rb', line 9

def save(filename)
  k = stream.hash[:DecodeParms][:K]
  if !k.nil? && stream.hash[:DecodeParms][:K] <= 0
    save_group_four(filename)
  else
    warn "#{filename}: CCITT non-group 4/2D image."
  end
end