Agamnentzar / ag-psd

Javascript library for reading and writing PSD files
Other
489 stars 66 forks source link

saved picture cannot use #148

Open mrqatom opened 1 year ago

mrqatom commented 1 year ago

code:

const xhr = new XMLHttpRequest();
    xhr.open('GET', '/psd.psd', true);
    xhr.responseType = 'arraybuffer';
    xhr.addEventListener('load', function () {
      const buffer = xhr.response;
      const psd = readPsd(buffer);
      console.log(psd);
      const buffer2 = writePsd(psd);
      console.log("buffer:" + buffer.byteLength + " buffer2:" + buffer2.byteLength);
    }, false);
    xhr.send();

log:

image

The saved picture cannot be opened and the size has changed

Agamnentzar commented 1 year ago

Can you send me your PSD file so I can check it, the new buffer will not be the same due to some encoding differences when compressing the internal images, so that's expected.