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

not clipping to document size when rendering layers #77

Open
catmando opened this issue Oct 22, 2014 · 2 comments
Open

not clipping to document size when rendering layers #77

catmando opened this issue Oct 22, 2014 · 2 comments

Comments

@catmando
Copy link
Contributor

Lets say you have a psd in which one layer has an image extending outside of the document clipping area. (for example a 4 X 6 document, but a layer is 8.5 X 11)

If you render a comp it clips just fine, but if you render a layer (or group) it does not clip.

Not sure if this is a feature or a bug.

If a feature how could we turn it off.

Specific code looks something like this

psd.tree.filter_by_comp("front").children_at_path("background").first.save_as_png("...path...")

I am guessing that somehow the renderer distinguishes between rendering a layer and rendering the entire tree, and only if rendering the tree applies the document clipping mask.

@meltingice
Copy link
Member

Yeah, this is currently the intended result. Rendering a single layer simply outputs the image data Photoshop has stored for that layer. Clipping the layer based on the document is something that will have to be added.

This could be passed as an additional argument to to_png or save_as_png. Something like:

psd.tree.filter_by_comp("front").children_at_path("background").first.save_as_png("...path...", clipped_by_document: true)

@catmando
Copy link
Contributor Author

hey that's great, if you can give me a rough outline of how to do this, I will do a fork, and implement and test...I looked through the code, and it was not obvious at where render was distinguishing between a layer and a whole comp.

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

No branches or pull requests

2 participants