Skip to content
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

Merged
merged 17 commits into from
Oct 19, 2022

Conversation

scoiatael
Copy link
Collaborator

@scoiatael scoiatael commented Oct 13, 2022

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 from psd-tools tests (https://github.com/psd-tools/psd-tools/blob/main/tests/psd_files/placedLayer.psd): Python package, released under MIT license.

@scoiatael
Copy link
Collaborator Author

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: vectorMask and fillAdjustments also come from psd-tools :)

@scoiatael scoiatael marked this pull request as ready for review October 18, 2022 15:15
@scoiatael scoiatael merged commit bf9540b into webtoon:main Oct 19, 2022
@scoiatael scoiatael deleted the feature/placed-layers branch October 19, 2022 12:10
@@ -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);
Copy link
Collaborator

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?

alexspevak pushed a commit to opendesigndev/psd-ts that referenced this pull request Jan 16, 2023
* [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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants