Sha256: 020b4fbd87cbc2ef14dfd2dc5711ccd636fadd755f25a826a1d4640a71197713

Contents?: true

Size: 396 Bytes

Versions: 5

Compression:

Stored size: 396 Bytes

Contents

require_relative '../layer_info'

class PSD
  class UnicodeName < LayerInfo
    @key = 'luni'

    def parse
      pos = @file.tell
      len = @file.read_int * 2
      @data = @file.read(len).unpack("A#{len}")[0].encode('UTF-8').delete("\000")

      # The name seems to be padded with null bytes. This is the easiest solution.
      @file.seek pos + @length

      return self
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
psd-0.4.0 lib/psd/layer_info/unicode_name.rb
psd-0.3.5 lib/psd/layer_info/unicode_name.rb
psd-0.3.4 lib/psd/layer_info/unicode_name.rb
psd-0.3.3 lib/psd/layer_info/unicode_name.rb
psd-0.3.2 lib/psd/layer_info/unicode_name.rb