Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/psd/src/classes/Layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,8 @@ export class Layer
get clipping(): Clipping {
return this.layerFrame.layerProperties.clippingMask;
}

get layerId(): number {
return this.layerFrame.layerProperties.layerId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export interface LayerRecord {
/** If defined, containts extra text properties */
engineData?: EngineData;
maskData?: MaskData;
layerId: number;
}

export type LayerChannels = Map<ChannelKind, ChannelBytes>;
Expand Down Expand Up @@ -69,6 +70,7 @@ export interface LayerProperties {
textProperties?: EngineData;
maskData?: MaskData;
additionalLayerProperties: AdditionalLayerProperties;
layerId: number;
}

export const createLayerProperties = (
Expand All @@ -90,6 +92,7 @@ export const createLayerProperties = (
engineData,
maskData,
additionalLayerInfos,
layerId,
} = layerRecord;

const additionalLayerProperties = fromEntries(
Expand All @@ -112,6 +115,7 @@ export const createLayerProperties = (
textProperties: engineData,
maskData,
additionalLayerProperties,
layerId,
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ function readLayerRecord(
let dividerType: LayerRecord["dividerType"];
let layerText: LayerRecord["layerText"];
let engineData: LayerRecord["engineData"];
let layerId = -1;

for (const ali of additionalLayerInfos) {
if (ali._isUnknown) continue;
Expand Down Expand Up @@ -188,6 +189,9 @@ function readLayerRecord(
// Use unicode name instead of ASCII name
({name} = ali);
break;
case AliKey.LayerId:
layerId = ali.value;
break;
}
}

Expand All @@ -208,6 +212,7 @@ function readLayerRecord(
layerText,
engineData,
maskData,
layerId,
};
}

Expand Down