TIFF subviews

I've inherited an application that must read and process about 4000 multi-page tiff images. I'm not an image expert, and I'd love to utilize UIImage to view these, but it would appear that UIImage is ignoring any additional subviews in the tiff file. It will correctly report and display the first image.


I was originally optimistic that I could utilize the images property, but since these are not animated images, this property returns nil. I'm able to verify that my images have multiple pages (subviews) utliizing SwiftView.

if let img = UIImage(named: "multipageTiff")
        {
            if let images = img.images as? [UIImage]
            {
                println("images \(images.count)")
            }
            else
            {
                println("images is nil")
            }
            image = img


The above code works great at assigning the original image to an UIImageView (image), however the println returns "nil", so I'm stuck. Any suggestions would be greatly appreciated.


Thanks!

It would appear from most of the documentation that I've read that I could attack this with NSBitMapImageRep. However, this is only available in OSX, not iOS, so I'm now looking for an alternative way to load the different representations of the image and parse them on an iOS device. Any ideas?

What about using a zipped file and read from there?

You might consider using a CGImageSourceRef + CGImageSourceGetCount + CGImageSourceCreateImageAtIndex


Use CGImageSourceGetCount to get the number of pages, and use CGImageSourceCreateImageAtIndex to get each one.

TIFF subviews
 
 
Q