Search code examples
cocoamacosjavax.imageiopsd

how do i detect a multi-layered psd file using imageIO.framework?


i don't want to extract or use the multi-layer information, i want to report to the user that it can't be imported. i'm creating specific-sized jpgs from imported files, and the user needs to decide how to flatten that multiple-layered file according to her aesthetic.

the only reference to multilayered i see is CGImageSourceGetCount(CGImageSourceRef)

If the image source is a multilayered PSD file, the function returns 1.

which, of course, isn't helpful in my case.


Solution

  • From my own searching, you can't do this with ImageIO. The only way I've found to deal with multi-layer images is with the QuickTime image importers. See this link:

    http://developer.apple.com/library/mac/#samplecode/ImproveYourImage/Listings/Source_MultipleImages_c.html