How to use the psd.fromFile function in psd

To help you get started, we’ve selected a few psd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zprodev / psd2json / index.js View on Github external
let outImgDir = '';
  let outJsonDir = '';
  if (typeof options === 'string') {
    outImgDir = options;
    outJsonDir = options;
  } else {
    if (options.outImgDir) {
      outImgDir = options.outImgDir;
    }
    if (options.outJsonDir) {
      outJsonDir = options.outJsonDir;
    }
  }

  // get root node.
  const psdData = psd.fromFile(psdFilePath);
  psdData.parse();
  const rootNode = psdData.tree();

  const queueNodes = [];
  const queueNodesIndex = [];
  const queueNodesName = [];
  const queueNodesStructure = [];

  queueNodes.push(rootNode._children);
  queueNodesIndex.push(0);
  queueNodesName.push(undefined);
  const psdStructure = {
    'group' : []
  };
  queueNodesStructure.push(psdStructure);
github safareli / psd-extractor / lib / psd-extractor.js View on Github external
var LayersfromPathes = R.reduce(function(acc,path){
  var psd = PSD.fromFile(path);
  psd.parse();
  var psdChildren = psd.tree().children()
  return R.concat(acc, psdChildren.map(metaAdder(path)));
}, []);

psd

A general purpose Photoshop file parser.

MIT
Latest version published 3 years ago

Package Health Score

57 / 100
Full package analysis

Popular psd functions