-
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
feature: AdditionalLayerInfos; LinkedLayers #54
Conversation
a4e179d
to
7adde75
Compare
ready to review, I think. I decided not to create test for every descriptor-based property - maybe I should? But that'd increase size of repo substantially for little gain. New test files: |
...aka embedded documents
ea01812
to
72a196d
Compare
@@ -39,6 +52,7 @@ export function readAdditionalLayerInfo( | |||
// Position the cursor at the end of the ALI block | |||
const remainingBytes = size - (cursor.position - prevPosition); | |||
cursor.pass(remainingBytes); | |||
cursor.padding(size, 4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@scoiatael This is a bit late, but are you sure this is correct?
I used to have the same code before I discovered one of my sample PSD files that failed here. I had to remove this line in f4fc949. (You might want to read the commit message)
Now that we merged this PR, it seems that the bug has regressed. Unfortunately, I could not provide a test to cover this case because the affected PSD file is from a private source and cannot be published as open source; and I could not produce another PSD file myself.
Your PR added code that parses the Global Additional Layer Information (what we internally call "tagged blocks"). Perhaps we could move the padding code there?
* [feature] implement more AdditionalLayerInfos * [tmp] expose AdditionalLayerInfos to users * Implement placed layers * [feature] implement linked layers ...aka embedded documents * rename placed_layer.test.ts -> placedLayer.test.ts * refactor reading paths in vector mask * prettier * proper test for placed layer * Add test for VectorMask parsing * Fix duplication in SectionDividers * Add test for HSL parsing * fix test names for vector masks * Remove obsolete comment * Remove test assertion * rename LayerID -> LayerId * Leftovers after rebase * classID -> classId
Hey,
Over the past month we implemented some features in our fork for the upcoming OpenDesign new release. We didn't have time to discuss them with you properly, so let me know if you want these features or not - in case you do, I'll properly refactor the code and add tests :)
This is PR 1/3; implementing more additional layer infos and linked layers (i.e. embedded documents). If needed, it can be split into two smaller features: one for the ordinary properties, and the other for linked layers.
placedLayer.psd
comes frompsd-tools
tests (https://github.com/psd-tools/psd-tools/blob/main/tests/psd_files/placedLayer.psd): Python package, released under MIT license.