Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
造个轮子
官方psd文档,部分有错 Adobe Photoshop File Formats Specification
翻译文档(不完整) Adobe Photoshop File Formats Specification
coffee版 psd.js
ruby版 psd.rb
c版 psdump
因为 ruby 版与 c 版对于前端来讲不好直接拿来用呐,coffee版输出的对象很庞大,同时运行时还要先编译一下,于是 生命不息,折腾不止 ,有了这个版本;
npm install psd-parser
var PSD = require('psd-parser');
var psd = PSD.parse('./test.psd');
console.log(psd)
psd.getDescendants() //扁平化的图层数组
psd.getTree() //树型结构的图层数组,与psd中结构相符
console.log(psd._psd_) //解析psd后的原始对象
//psd缩略图的输出,只支持png输出
psd.saveAsPng('test.png') //目前要注意目录是否存在
//某个图层的png输出
psd.getDescendants()[0].saveAsPng('layer.png')
现在可以获取文本图层中的文字与细节
var PSD = require('../index');
var psd = PSD.parse('./example/test.psd');
console.log(psd.getDescendants()[0].get('text')); //文本图层中的文字
console.log(psd.getDescendants()[0].get('wordSnippets')); //文本图层中的文字细节,以数组形式展现
FAQs
Parse psd and output a json obj
We found that psd-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.