Sha256: 0ccd6eced47552732d3142884939e37eb8fa0b75d1646fb58ff4083c47cc2b43

Contents?: true

Size: 769 Bytes

Versions: 15

Compression:

Stored size: 769 Bytes

Contents

require_relative '../layer_info'

class PSD
  class MetadataSetting < LayerInfo
    @key = 'shmd'

    def parse
      count = @file.read_int

      count.times do
        @file.seek 4, IO::SEEK_CUR # signature, always 8BIM
        
        key = @file.read_string(4)
        copy_on_sheet_dup = @file.read(1).bytes.to_a[0]
        @file.seek 3, IO::SEEK_CUR # Padding

        len = @file.read_int
        data_end = @file.tell + len

        PSD.logger.debug "Layer metadata: key = #{key}, length = #{len}"

        parse_layer_comp_setting if key == 'cmls'

        @file.seek data_end
      end
    end

    private

    def parse_layer_comp_setting
      @file.seek 4, IO::SEEK_CUR # Version
      @data[:layer_comp] = Descriptor.new(@file).parse
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
bench9000-0.1 vendor/psd.rb/lib/psd/layer_info/metadata_setting.rb
psd-2.1.2 lib/psd/layer_info/metadata_setting.rb
psd-2.1.1 lib/psd/layer_info/metadata_setting.rb
psd-2.1.0 lib/psd/layer_info/metadata_setting.rb
psd-2.0.0 lib/psd/layer_info/metadata_setting.rb
psd-1.5.0 lib/psd/layer_info/metadata_setting.rb
psd-1.4.5 lib/psd/layer_info/metadata_setting.rb
psd-1.4.4 lib/psd/layer_info/metadata_setting.rb
psd-1.4.3 lib/psd/layer_info/metadata_setting.rb
psd-1.4.2 lib/psd/layer_info/metadata_setting.rb
psd-1.4.1 lib/psd/layer_info/metadata_setting.rb
psd-1.4.0 lib/psd/layer_info/metadata_setting.rb
psd-1.3.3 lib/psd/layer_info/metadata_setting.rb
psd-1.3.2 lib/psd/layer_info/metadata_setting.rb
psd-1.3.0 lib/psd/layer_info/metadata_setting.rb