-
Notifications
You must be signed in to change notification settings - Fork 54
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
Opening a PSD file throws "invalid typed array length" error #40
Comments
If it is not a security problem, can you attach the PSD file that caused the problem? |
@dlehdanakf Sure thing: https://we.tl/t-G2lVvra3Uj There are two files in that zip: test.psd and test2.psd Here's test2.psd . This is just a modified version of test.psd that is parseable by the package. What I found when scrutinizing the test.psd file is that when I delete the gradient layer, the library has managed to parse it successfully. Hope it helps 😃 |
Thank you. It appears that the gradient fill layer does not contain any image data--I assume that Photoshop synthesizes the image on the fly when I open the PSD file--and we weren't prepared for such an edge case. I'm pushing a fix that renders the layer as an empty 1x1 image. It's not ideal, but synthesizing the gradient fill is currently beyond our goals. |
@pastelmind No worries! Atleast it doesn't throw an error now 😄 Great job btw |
I think there might be a regression of this fix readLayerRecordsAndChannels.ts. readLayerRecordsAndChannels is failing with a RangeError again and it looks like the code may not longer account for this case. Unfortunately I do not have access to photoshop to further debug this issue. Let me know and I can send you a reproduction, but I can't post publically. |
I'm trying to open a PSD file i haved created from Photopea into the demo and after selecting the file, the preview did not worked and instead the demo threw an error:
When dissecting the stack trace, it leads me to this code which is in line
253254:Hope it helps 😉 hoping to use it for a project
The text was updated successfully, but these errors were encountered: