-
Notifications
You must be signed in to change notification settings - Fork 399
Open
Description
psd.js/lib/psd/layer_mask.coffee
Lines 38 to 42 in 333dd14
| parseLayers: -> | |
| layerInfoSize = Util.pad2 @file.readInt() | |
| if layerInfoSize > 0 | |
| layerCount = @file.readShort() |
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) {liz282907, aleczratiu, Justineo and velara3
Metadata
Metadata
Assignees
Labels
No labels
