We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I didn't get clear instructions in the documentation how to export psd to image, hope someone can tell me。
The text was updated successfully, but these errors were encountered:
You can save psd.canvas, in browser it's regular HTMLCanvasElement ( https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement ) and in node it's node-canvas canvas object ( https://github.com/Automattic/node-canvas?tab=readme-ov-file#non-standard-apis )
psd.canvas
The PSD document is not guaranteed to have composite image saved in it, most documents have it though.
Sorry, something went wrong.
您可以保存psd.canvas,在浏览器中它是一个常规的 HTMLCanvasElement(https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement),在节点中它是一个 node-canvas 画布对象(https://github.com/Automattic/node-canvas?tab=readme-ov-file#non-standard-apis) PSD文档不保证其中保存有复合图像,但其它文档都有。
您可以保存psd.canvas,在浏览器中它是一个常规的 HTMLCanvasElement(https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement),在节点中它是一个 node-canvas 画布对象(https://github.com/Automattic/node-canvas?tab=readme-ov-file#non-standard-apis)
PSD文档不保证其中保存有复合图像,但其它文档都有。
I have tried using the following code but the psd.canvas is empty
import { readPsd } from 'ag-psd'; import 'ag-psd/initialize-canvas'; let buf=fs.readFileSync('xxxx.psd'); const psd = readPsd(buf.buffer,{ skipLayerImageData: true, skipCompositeImageData: true, skipThumbnail: true }); console.log("======",psd.canvas);//-->undefined
skipCompositeImageData: true option skips reading psd.canvas fields, you need to remove it.
skipCompositeImageData: true
Agamnentzar
No branches or pull requests
I didn't get clear instructions in the documentation how to export psd to image, hope someone can tell me。
The text was updated successfully, but these errors were encountered: