Sha256: 0ba4a97f3d496f9c1f931e46ec0a6537be14b394688daa3816bf01d747edab3c

Contents?: true

Size: 708 Bytes

Versions: 18

Compression:

Stored size: 708 Bytes

Contents

require 'psd/layer_info'

class PSD
  # Not 100% sure what the purpose of this key is, but it seems to exist
  # whenever the lsct key doesn't. Parsing this like a layer section
  # divider seems to solve a lot of parsing issues with folders.
  #
  # See https://github.com/layervault/psd.rb/issues/38
  class NestedLayerDivider < LayerInfo
    def self.should_parse?(key)
      key == 'lsdk'
    end

    attr_reader :is_folder, :is_hidden

    def initialize(file, length)
      super

      @is_folder = false
      @is_hidden = false
    end

    def parse
      code = @file.read_int

      case code
      when 1, 2 then @is_folder = true
      when 3 then @is_hidden = true
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
psd-3.9.0 lib/psd/layer/info/layer_group.rb
psd-3.8.0 lib/psd/layer/info/layer_group.rb
psd-3.7.0 lib/psd/layer/info/layer_group.rb
psd-3.6.0 lib/psd/layer/info/layer_group.rb
psd-3.5.0 lib/psd/layer/info/layer_group.rb
psd-3.4.0 lib/psd/layer/info/layer_group.rb
psd-3.3.3 lib/psd/layer/info/layer_group.rb
psd-3.3.2 lib/psd/layer/info/layer_group.rb
psd-3.3.1 lib/psd/layer/info/layer_group.rb
psd-3.2.4 lib/psd/layer_info/layer_group.rb
psd-3.2.3 lib/psd/layer_info/layer_group.rb
psd-3.2.2 lib/psd/layer_info/layer_group.rb
psd-3.2.1 lib/psd/layer_info/layer_group.rb
psd-3.2.0 lib/psd/layer_info/layer_group.rb
psd-3.1.5 lib/psd/layer_info/layer_group.rb
psd-3.1.4 lib/psd/layer_info/layer_group.rb
psd-3.1.3 lib/psd/layer_info/layer_group.rb
psd-3.1.2 lib/psd/layer_info/layer_group.rb