ag-psd 28.1.1 → 28.2.1

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.
@@ -1111,7 +1111,7 @@ function parseFilterFXItem(f, options) {
1111
1111
  removeJpegArtifact: f.Fltr.removeJPEGArtifact,
1112
1112
  reduceColorNoise: (0, descriptor_1.parsePercent)(f.Fltr.ClNs),
1113
1113
  sharpenDetails: (0, descriptor_1.parsePercent)(f.Fltr.Shrp),
1114
- channelDenoise: f.Fltr.channelDenoise.map(function (c) { return (__assign({ channels: c.Chnl.map(function (i) { return descriptor_1.Chnl.decode(i); }), amount: c.Amnt }, (c.EdgF ? { preserveDetails: c.EdgF } : {}))); }),
1114
+ channelDenoise: f.Fltr.channelDenoise.map(function (c) { return (__assign({ channels: c.Chnl.map(descriptor_1.Chnl.decode), amount: c.Amnt }, (c.EdgF ? { preserveDetails: c.EdgF } : {}))); }),
1115
1115
  } });
1116
1116
  case 'ClrH': return __assign(__assign({}, base), { type: 'color halftone', filter: {
1117
1117
  radius: f.Fltr['Rds '],
@@ -1338,10 +1338,9 @@ function parseFilterFXItem(f, options) {
1338
1338
  ;
1339
1339
  case 'Crvs':
1340
1340
  {
1341
- return __assign(__assign({}, base), { type: 'curves', filter: {
1342
- presetKind: descriptor_1.presetKindType.decode(f.Fltr.presetKind),
1341
+ return __assign(__assign({}, base), { type: 'curves', filter: __assign({ presetKind: descriptor_1.presetKindType.decode(f.Fltr.presetKind) }, (f.Fltr.Adjs ? {
1343
1342
  adjustments: f.Fltr.Adjs.map(function (a) {
1344
- var channels = a.Chnl.map(function (c) { return descriptor_1.Chnl.decode(c); });
1343
+ var channels = a.Chnl.map(descriptor_1.Chnl.decode);
1345
1344
  if (a['Crv ']) {
1346
1345
  return {
1347
1346
  channels: channels,
@@ -1359,12 +1358,22 @@ function parseFilterFXItem(f, options) {
1359
1358
  else {
1360
1359
  throw new Error("Unknown curve adjustment");
1361
1360
  }
1362
- }),
1361
+ })
1362
+ } : {})) });
1363
+ }
1364
+ ;
1365
+ case 'BrgC':
1366
+ {
1367
+ return __assign(__assign({}, base), { type: 'brightness/contrast', filter: {
1368
+ brightness: f.Fltr.Brgh,
1369
+ contrast: f.Fltr.Cntr,
1370
+ useLegacy: !!f.Fltr.useLegacy,
1363
1371
  } });
1364
1372
  }
1365
1373
  ;
1366
1374
  default:
1367
1375
  if (options.throwForMissingFeatures) {
1376
+ console.log('FILTER', require('util').inspect(f, false, 99, true));
1368
1377
  throw new Error("Unknown filter classId: ".concat(f.Fltr._classID));
1369
1378
  }
1370
1379
  return undefined;
@@ -1384,9 +1393,10 @@ function parseFilterFXItem(f, options) {
1384
1393
  case 1181639749: return __assign(__assign({}, base), { type: 'find edges' });
1385
1394
  case 1399616122: return __assign(__assign({}, base), { type: 'solarize' });
1386
1395
  case 1314149187: return __assign(__assign({}, base), { type: 'ntsc colors' });
1396
+ case 1231976050: return __assign(__assign({}, base), { type: 'invert' });
1387
1397
  default:
1388
1398
  if (options.throwForMissingFeatures) {
1389
- // console.log('FILTER', require('util').inspect(f, false, 99, true));
1399
+ console.log('FILTER', require('util').inspect(f, false, 99, true));
1390
1400
  throw new Error("Unknown filterID: ".concat(f.filterID));
1391
1401
  }
1392
1402
  }
@@ -1722,6 +1732,7 @@ function serializeFilterFXItem(f) {
1722
1732
  IntC: descriptor_1.IntC.encode(f.filter.newFieldsBy),
1723
1733
  }, filterID: 1148089458 });
1724
1734
  case 'ntsc colors': return __assign(__assign({}, base), { filterID: 1314149187 });
1735
+ case 'invert': return __assign(__assign({}, base), { filterID: 1231976050 });
1725
1736
  case 'custom': return __assign(__assign({}, base), { Fltr: {
1726
1737
  _name: 'Custom',
1727
1738
  _classID: 'Cstm',
@@ -1843,22 +1854,26 @@ function serializeFilterFXItem(f) {
1843
1854
  warpedVertices: f.filter.warpedVertices.map(pointToHrznVrtc),
1844
1855
  quads: f.filter.quads.map(function (indices) { return ({ indices: indices }); }),
1845
1856
  }, filterID: 442 });
1846
- case 'curves': return __assign(__assign({}, base), { Fltr: {
1847
- _name: 'Curves',
1848
- _classID: 'Crvs',
1849
- presetKind: descriptor_1.presetKindType.encode(f.filter.presetKind),
1857
+ case 'curves': return __assign(__assign({}, base), { Fltr: __assign({ _name: 'Curves', _classID: 'Crvs', presetKind: descriptor_1.presetKindType.encode(f.filter.presetKind) }, (f.filter.adjustments ? {
1850
1858
  Adjs: f.filter.adjustments.map(function (a) { return 'curve' in a ? {
1851
1859
  _name: '',
1852
1860
  _classID: 'CrvA',
1853
- Chnl: a.channels.map(function (c) { return descriptor_1.Chnl.encode(c); }),
1861
+ Chnl: a.channels.map(descriptor_1.Chnl.encode),
1854
1862
  'Crv ': a.curve.map(function (c) { return (__assign({ _name: '', _classID: 'Pnt ', Hrzn: c.x, Vrtc: c.y }, (c.curved ? { Cnty: true } : {}))); }),
1855
1863
  } : {
1856
1864
  _name: '',
1857
1865
  _classID: 'CrvA',
1858
- Chnl: a.channels.map(function (c) { return descriptor_1.Chnl.encode(c); }),
1866
+ Chnl: a.channels.map(descriptor_1.Chnl.encode),
1859
1867
  Mpng: a.values,
1860
- }; }),
1861
- }, filterID: 1131574899 });
1868
+ }; })
1869
+ } : {})), filterID: 1131574899 });
1870
+ case 'brightness/contrast': return __assign(__assign({}, base), { Fltr: {
1871
+ _name: 'Brightness/Contrast',
1872
+ _classID: 'BrgC',
1873
+ Brgh: f.filter.brightness,
1874
+ Cntr: f.filter.contrast,
1875
+ useLegacy: !!f.filter.useLegacy,
1876
+ }, filterID: 1114793795 });
1862
1877
  // case 'hsb/hsl': return {
1863
1878
  // TODO: ...
1864
1879
  // };