Hi there!
I’m trying to upload my PSD file using the strategy of duplicate the active document and save this document to a temporary folder, then read this duplicated file so I can upload this to my S3 Bucket.
For now, the upload works fine, but I’m struggling with the read
method.
My PSD file has around 1.6 MB but when I read the file with the following code I get an ArrayBuffer of 997180 of size (~997.2 kB):
let data = await tempFile.read({ format: UXP.storage.formats.binary }); # => ArrayBuffer(997180)
When I upload to S3 via fetch, it works fine, but when I download the PSD file I get a file with 997.2 kB of size, this leads to some error when I try to use this downloaded PSD file with ImageMagick (identify
command):
identify original.psd # identifies N layers
identify downloaded.psd # identifies N - M layers (this M is the number of vector or solidColor layers)
Can anyone help me with this? I don’t know why the .read()
method returns an ArrayBuffer of 997180 (~ 997 kB) instead of ~1600000 (~1.6MB)