Skip to content

Got empty children from 16bit psd #168

@599316527

Description

@599316527

parseLayers: ->
layerInfoSize = Util.pad2 @file.readInt()
if layerInfoSize > 0
layerCount = @file.readShort()

Screen_Shot_2019-09-10_at_16_59_16

this.file.pos of reading layerInfoSize is wrong when the psd image mode is in "16bit/channel". I found pos is offseted by the length of image resource section correctly but somehow there are still 8 bytes of zero and "8BIMLr16" before layerInfoSize. According to Adobe's document,it makes no sense.

With extra offsets of 12, layerInfoSize is read correctly. It works to me.

layerInfoSize = Util.pad2(this.file.readInt());
if (layerInfoSize === 0 && this.header.depth === 16 
    && this.file.data.slice(this.file.pos + 4, this.file.pos + 12)
             .compare(Buffer.from('8BIMLr16')) === 0) {
  this.file.pos += 12;
  layerInfoSize = Util.pad2(this.file.readInt());
}
if (layerInfoSize > 0) {

16bit_psd_saved_from_ps_cc_20_0_4.psd.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions