You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue while using the ag-psd library in Node.js to programmatically update text content in a PSD file. Despite successfully updating the text content in the PSD layer object, the image remains unchanged after saving the modified PSD file.
Here's the relevant code snippet:
import*asfsfrom'fs';import'ag-psd/initialize-canvas.js';import{readPsd,writePsdBuffer}from'ag-psd';constbuffer=fs.readFileSync('UK DL FRONT.psd');constpsd=readPsd(buffer);constkumonLayer=psd.children[4].children.find(layer=>layer.name==='KUMON');if(kumonLayer){kumonLayer.text.text='MD. Asif';console.log('Updated text content:',kumonLayer.text.text);console.log('Updated layer:',kumonLayer.name);constmodifiedBuffer=writePsdBuffer(psd);fs.writeFileSync('modified_UK_DL_FRONT.psd',modifiedBuffer);console.log('Text for KUMON layer updated successfully.');}else{console.log('Layer with name "KUMON" not found.');}
Expected behavior:
I expect that when I update the text content of the PSD layer object and save the modified PSD file, the image in the PSD file should also reflect the changes made to the text content.
Actual behavior:
After running the above code, the text content in the PSD layer object (kumonLayer.text.text) is updated successfully, but when I open the modified PSD file, the image remains unchanged. It seems like the changes made to the layer object are not reflected in the saved PSD file.
The text was updated successfully, but these errors were encountered:
I encountered an issue while using the ag-psd library in Node.js to programmatically update text content in a PSD file. Despite successfully updating the text content in the PSD layer object, the image remains unchanged after saving the modified PSD file.
Here's the relevant code snippet:
Expected behavior:
I expect that when I update the text content of the PSD layer object and save the modified PSD file, the image in the PSD file should also reflect the changes made to the text content.
Actual behavior:
After running the above code, the text content in the PSD layer object (
kumonLayer.text.text
) is updated successfully, but when I open the modified PSD file, the image remains unchanged. It seems like the changes made to the layer object are not reflected in the saved PSD file.The text was updated successfully, but these errors were encountered: