ag-psd 17.0.0 → 17.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -566,6 +566,19 @@ addHandler(
566
566
  },
567
567
  );
568
568
 
569
+ MOCK_HANDLERS && addHandler(
570
+ 1092, // ???
571
+ target => (target as any)._ir1092 !== undefined,
572
+ (reader, target, left) => {
573
+ LOG_MOCK_HANDLERS && console.log('image resource 1092', left());
574
+ // 16 bytes, seems to be 4 integers
575
+ (target as any)._ir1092 = readBytes(reader, left());
576
+ },
577
+ (writer, target) => {
578
+ writeBytes(writer, (target as any)._ir1092);
579
+ },
580
+ );
581
+
569
582
  interface OnionSkinsDescriptor {
570
583
  Vrsn: 1;
571
584
  enab: boolean;
@@ -908,10 +921,10 @@ addHandler(
908
921
  const associatedLayerId = origin == 'layer' ? readUint32(reader) : 0;
909
922
  const name = readUnicodeString(reader);
910
923
  const type = clamped(sliceTypes, readUint32(reader));
911
- const top = readInt32(reader);
912
924
  const left = readInt32(reader);
913
- const bottom = readInt32(reader);
925
+ const top = readInt32(reader);
914
926
  const right = readInt32(reader);
927
+ const bottom = readInt32(reader);
915
928
  const url = readUnicodeString(reader);
916
929
  const target = readUnicodeString(reader);
917
930
  const message = readUnicodeString(reader);
@@ -1005,10 +1018,10 @@ addHandler(
1005
1018
  if (slice.origin === 'layer') writeUint32(writer, slice.associatedLayerId);
1006
1019
  writeUnicodeString(writer, slice.name);
1007
1020
  writeUint32(writer, sliceTypes.indexOf(slice.type));
1008
- writeInt32(writer, slice.bounds.top);
1009
1021
  writeInt32(writer, slice.bounds.left);
1010
- writeInt32(writer, slice.bounds.bottom);
1022
+ writeInt32(writer, slice.bounds.top);
1011
1023
  writeInt32(writer, slice.bounds.right);
1024
+ writeInt32(writer, slice.bounds.bottom);
1012
1025
  writeUnicodeString(writer, slice.url);
1013
1026
  writeUnicodeString(writer, slice.target);
1014
1027
  writeUnicodeString(writer, slice.message);
package/src/psd.ts CHANGED
@@ -380,6 +380,13 @@ export interface TextGridInfo {
380
380
  alignLineHeightToGridFlags?: boolean;
381
381
  }
382
382
 
383
+ export interface UnitsBounds {
384
+ top: UnitsValue;
385
+ left: UnitsValue;
386
+ right: UnitsValue;
387
+ bottom: UnitsValue;
388
+ }
389
+
383
390
  export interface LayerTextData {
384
391
  text: string;
385
392
  transform?: number[]; // 2d transform matrix [xx, xy, yx, yy, tx, ty]
@@ -409,6 +416,9 @@ export interface LayerTextData {
409
416
  shapeType?: 'point' | 'box';
410
417
  pointBase?: number[];
411
418
  boxBounds?: number[];
419
+
420
+ bounds?: UnitsBounds;
421
+ boundingBox?: UnitsBounds;
412
422
  }
413
423
 
414
424
  export interface PatternInfo {
package/src/psdWriter.ts CHANGED
@@ -112,6 +112,7 @@ export function writePascalString(writer: PsdWriter, text: string, padTo: number
112
112
 
113
113
  for (let i = 0; i < length; i++) {
114
114
  const code = text.charCodeAt(i);
115
+ // writeUint8(writer, code); // for testing
115
116
  writeUint8(writer, code < 128 ? code : '?'.charCodeAt(0));
116
117
  }
117
118