Re: Reading multi-frame TIFF's
Re: Reading multi-frame TIFF's
- Subject: Re: Reading multi-frame TIFF's
- From: Rick Hoge <email@hidden>
- Date: Fri, 11 Mar 2005 09:13:31 -0500
NSArray *repList = [NSImageRep <x-tad-bigger>imageRepsWithContentsOfFile:fName</x-tad-bigger>];
Thanks very much for this detailed an clear reply! The above method did the trick perfectly. I was mislead by some of the frame-related constants having to do with animated GIF's.
Rick
or similar methods. The reps can also be found with:
NSImage *img = [[NSImage alloc] <x-tad-bigger>initWithContentsOfFile:fName];
</x-tad-bigger> NSArray *repList = [img representations];
(Remember that an NSImage is only a wrapper for zero, one ore more
representations. And remember that an NSImage draws only one of the
many representations selected by some heuristics.)
If (for depicting the reps) you need NSImages for all representations, do this
for( all reps ){
NSImage *newImg = [[NSImage alloc] initWithSoize:NSZeroSize];
[newImg addRepresentation:[repList objectAtIndex:i]];
[listOfNewImages addObject:[newImg autorelease]];
}
Creating a multi-"page" / multi-"frame" TIFF file do this
(or use a similar construct with NSImage):
NSData *tiffData = [NSBitmapImageRep <x-tad-bigger>TIFFRepresentationOfImageRepsInArray:repList</x-tad-bigger>];
[tiffData writeToFile:nameOfATiffFile atomically:YES];
--
Heinrich Giesen
email: email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden