-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
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
Large files #154
Comments
there is already merged PR for this issue, but isn't released yet #135 |
I have already seen your issue (#139) and your solve. I forgot to mention that i am using this library in browser (the psd.js file (or psd.min.js file)). And these files are not corrected. Or I didnt find the right ones. |
You can build psd.js and psd.min.js usong following commands:
or, under Windows
I attached compilled files that use typed arrays. I hope it helps |
Thank you very much. You are a genius. |
What time will this version be released? |
I also using a large PSD file on browser ( size about 1.2 GB or bigger). And I receive a error:
Can anyone help me to solve this, pls ? |
Hi,
I started using this awsome library. But it has problems with large file (like 100MB and larger)("has problems" means cannot read several image layers). I know there is a lot of articles, saying that, this library is not suitable for large files. But it is possible. Look at https://www.photopea.com/. Its free online photoshop and it can read large .psd files.
I made some research. The problem is with using method toPng():
var des = psd.tree().descendants()[0]; var img = (des.get('image')).toPng();
It returns an image of the layer. It works fine, but allocates a lot of memory, which is not released (for example for 100MB psd file, allocates 300MB for one image (layer)). Its because after using toPng() method, the object psd stores information about layer, like pixelData and so on.
This is 100% fine. But why the pixelData stores information (which are only integers between 0-255) as an classic array. I suggest use Uint8ClampedArray array. I believe that this improvement will reduce the memory size of the pixelData array more than 10 times.
This Uint8ClampedArray array is used also in ImageData object (acquired from canvas HTML element). Here is a figure:
I hope my text is comprehensible to developers at least.
The text was updated successfully, but these errors were encountered: