That's true. As a matter fact, I think all digital camera files have more than one image -- even the lowliest point and shoot camera has a main image and a thumbnail. However, I checked various camera files and found that imageRepsWithContentsOfFile: always seems to return just one image. So I assumed it is the main image. If it does return more than one image, I guess a more robust approach would be to look at the multiple bit maps and try to determine which one is the main image -- probably from the bit map size.

Jim Merkel



On Jul 7, 2008, at 2:09 AM, Paul Sargent wrote:

Remember that some raw files contain multiple resoltions (i.e. a thumbnail and the main image), so you may not always want the first one.

On 6 Jul 2008, at 04:29, James Merkel wrote:

Will look into CGImageRef using ImageIO. However, I found that if I use: imageRepsWithContentsOfFile: rather than imageRepWithContentsOfFile: I can get a bit map from all raw files that are supported by OS X. (At least for the raw files I have checked so far). The method imageRepsWithContentsOfFile returns an array of file reps, so the following works:

NSBitmapImageRep * imageBitMap = nil;
NSArray * repsArray;
repsArray = [NSBitmapImageRep imageRepsWithContentsOfFile:theFile];

if([repsArray lastObject] != nil) {
        imageBitMap = [repsArray objectAtIndex:0];
}

Jim Merkel


On Sat, 05 Jul 2008 14:16:46 -0700 Chris Hanson wrote:
On Jul 5, 2008, at 2:00 PM, James Merkel wrote:

So the question is how to go about reliably getting a bit map
reliably form these camera raw files?

Try getting a CGImageRef using ImageIO.


On Jul 5, 2008, at 2:00 PM, James Merkel wrote:
I notice there are now about 120 Digital camera raw formats supported
by Mac OS X as of system 10.5.4.
I am trying to get a bit map from these camera files so I am using:

NSBitmapImageRep * imageBitMap = [NSBitmapImageRep
imageRepWithContentsOfFile:theFile]

For some raw files (Nikon NEF and Canon CR2) I get a bit map. But for
other files (Sony DSLR-A100 ARW file) I get a nil bit map.
On the other hand, I notice that the system does support the Sony raw
file in some way, since for example:

[[NSImage alloc] initWithContentsOfFile:theFile] does produce an image.

So the question is how to go about reliably getting a bit map reliably
form these camera raw files?
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/psarge%40gmail.com

This email sent to [EMAIL PROTECTED]


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to