psd.rb icon indicating copy to clipboard operation
psd.rb copied to clipboard

Max Compatibility Layer

Open iceman opened this issue 12 years ago • 3 comments

I love this project. Thank you. Is there any way to detect if a max compatibility layer is saved into the file?

iceman avatar Aug 01 '13 17:08 iceman

What do you mean by a "max compatibility layer"?

meltingice avatar Aug 02 '13 02:08 meltingice

I'm referring to the composite of all the layers that photoshop saves if you check the box upon saving or in the preferences. It's very useful for generating a preview of a very complex file with a command line linux graphics tool. When complex files don't include this layer, often they just have a placeholder image at that position and the only way to get any sort of preview from the file is to extract the custom thumbnail. So it would be nice if we could tell if the layer was there or not. Photoshop can tell and once the file is initially saved with/without it, it won't ask again.

This phantom layer is discussed in the second paragraph here: http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/PhotoshopFileFormats.htm#50577409_pgfId-1031423

iceman avatar Aug 02 '13 02:08 iceman

Ah, right. If it were me, I would put that flag in the PSD Resources section.

This is pretty interesting. I saved a copy of the example PSD and disabled compatibility mode as the only change. I then compared the resources in each since I noticed they differed.

nocompat.resources.map { |r| r['id'] } - psd.resources.map { |r| r['id'] }
#=> [1010]

The only resource that is present in the non-max compatibility version and not the other has the ID 1010. Strangely, this is marked as the "Background Color" resource. Thus, I'm not sure if this is a clear indication of compatibility mode, but it's a start.

meltingice avatar Aug 02 '13 18:08 meltingice