{"action":"opened","issue":{"url":"https://api.github.com/repos/meltingice/psd.js/issues/42","labels_url":"https://api.github.com/repos/meltingice/psd.js/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/meltingice/psd.js/issues/42/comments","events_url":"https://api.github.com/repos/meltingice/psd.js/issues/42/events","html_url":"https://github.com/meltingice/psd.js/issues/42","id":105067011,"number":42,"title":"How to distinguish layers with masks and shape layers?","user":{"login":"kfitfk","id":2555626,"avatar_url":"https://avatars.githubusercontent.com/u/2555626?v=3","gravatar_id":"","url":"https://api.github.com/users/kfitfk","html_url":"https://github.com/kfitfk","followers_url":"https://api.github.com/users/kfitfk/followers","following_url":"https://api.github.com/users/kfitfk/following{/other_user}","gists_url":"https://api.github.com/users/kfitfk/gists{/gist_id}","starred_url":"https://api.github.com/users/kfitfk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kfitfk/subscriptions","organizations_url":"https://api.github.com/users/kfitfk/orgs","repos_url":"https://api.github.com/users/kfitfk/repos","events_url":"https://api.github.com/users/kfitfk/events{/privacy}","received_events_url":"https://api.github.com/users/kfitfk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-06T02:49:55Z","updated_at":"2015-09-06T02:49:55Z","closed_at":null,"body":"When exporting a layer as PNG file, the result differs depending on the layer type. So I want to tell whether a layer is\r\n\r\n- a shape layer / a fill layer with vector mask applied\r\n- a layer with vector mask applied\r\n- a layer with normal layer mask applied\r\n\r\nI created a test file as shown below.\r\n<img width=\"544\" alt=\"PSD layer structure\" src=\"https://cloud.githubusercontent.com/assets/2555626/9702085/1c81c44a-5481-11e5-9171-5f8f030a1964.png\">\r\n\r\nNow I go ahead and export each layer as a PNG file, I got the result like this.\r\n<img width=\"515\" alt=\"Export each PSD layer as a PNG file\" src=\"https://cloud.githubusercontent.com/assets/2555626/9702128/6aa0fb86-5482-11e5-8809-5f764cae5d1c.png\">\r\n\r\nThe two shape layers, or fill layers with vector masks, appears to be the same as they are in Photoshop when exported as PNG files. However, when a normal pixel layer has vector mask or layer mask applied, the exported PNG file only shows the layer content, regardless of the masks.\r\n\r\nIf I call the following method on each of these layers: shape_gradient, shape_solid_color, and vector_mask\r\n\r\n`layer.get('vectorMask').paths`\r\n\r\nThe results are similar. I can't tell shape layers (or fill layers with vector masks) from normal pixel layers with vector masks.\r\n\r\nAnd I don't know how to check if a layer has a normal layer mask applied. Looks like the `layer_mask.coffee` is dealing with a concept different from Photoshop's layer mask.\r\n\r\nAny ideas how to distinguish these layers?\r\n"}}