RAW image format support in NSImage

  • Hi all,

    I try to load a RAW image (e.g. .nef Nikon RAW format of a D70) with -
    initWithContentsOfFile:(NSString*)filename. This creates a NSImage
    object with one NSBitmapImageRep inside.

    But the NSBitmapImageRep seems to be only a thumbnail (160x120
    pixels) of the RAW image (3024 x 1998 pixels). Am I doing something
    wrong? All other image formats seem to work.

    In other words, is there another way to get a full resolution
    NSBitmapImageRep of a RAW image?

    Regards

    Michael Ehrmann
  • On Mar 15, 2006, at 14:02, Michael Ehrmann wrote:

    > Hi all,
    >
    > I try to load a RAW image (e.g. .nef Nikon RAW format of a D70)
    > with -initWithContentsOfFile:(NSString*)filename. This creates a
    > NSImage object with one NSBitmapImageRep inside.
    >
    > But the NSBitmapImageRep seems to be only a thumbnail (160x120
    > pixels) of the RAW image (3024 x 1998 pixels). Am I doing something
    > wrong? All other image formats seem to work.

    Unfortunately no, what you get is the TIFF thumbnail which is
    embedded in the RAW. AFAIK NSImage does not really support RAW images
    (which is a bummer since Preview is capable of showing them).

    > In other words, is there another way to get a full resolution
    > NSBitmapImageRep of a RAW image?

    We've been using dcraw http://www.cybercom.net/~dcoffin/dcraw/ to
    convert the RAW image to PNG.

    marco

    Marco Scheurer
    Sen:te, Lausanne, Switzerland  http://www.sente.ch
  • On Mar 15, 2006, at 5:02 AM, Michael Ehrmann wrote:

    > Hi all,
    >
    > I try to load a RAW image (e.g. .nef Nikon RAW format of a D70)
    > with -initWithContentsOfFile:(NSString*)filename. This creates a
    > NSImage object with one NSBitmapImageRep inside.
    >
    > But the NSBitmapImageRep seems to be only a thumbnail (160x120
    > pixels) of the RAW image (3024 x 1998 pixels). Am I doing something
    > wrong? All other image formats seem to work.
    >
    > In other words, is there another way to get a full resolution
    > NSBitmapImageRep of a RAW image?

    I'd file a bug on that, .nef files are supported, according to the docs:

    http://developer.apple.com/documentation/Cocoa/Conceptual/
    CocoaDrawingGuide/Images/chapter_7_section_3.html#//apple_ref/doc/uid/
    TP40003290-CH208-BCIIFBJG

    You are on Tiger, right?

    -jcr

    John C. Randolph <jcr...> (408) 914-0013
    Roaming Cocoa Engineer,
    Available for your projects at great Expense and Inconvenience.
  • Yes, I am on Tiger, and the problem only occurs with .nef images.

    The only way I found to work around this bug is to load the image
    with CIImage, as suggested by Daniel, directly  from disk. Although
    using CIImage -initWithData: doesn't work. So I have to store the
    image temporarily on disk and load the file in order to get the raw
    image representation and not the thumbnail.

    With the RAW format of a Canon EOS 20D (.CR2) everything works fine.

    On 17.03.2006, at 15:11, John C. Randolph wrote:

    >
    > On Mar 15, 2006, at 5:02 AM, Michael Ehrmann wrote:
    >
    >> Hi all,
    >>
    >> I try to load a RAW image (e.g. .nef Nikon RAW format of a D70)
    >> with -initWithContentsOfFile:(NSString*)filename. This creates a
    >> NSImage object with one NSBitmapImageRep inside.
    >>
    >> But the NSBitmapImageRep seems to be only a thumbnail (160x120
    >> pixels) of the RAW image (3024 x 1998 pixels). Am I doing
    >> something wrong? All other image formats seem to work.
    >>
    >> In other words, is there another way to get a full resolution
    >> NSBitmapImageRep of a RAW image?
    >
    > I'd file a bug on that, .nef files are supported, according to the
    > docs:
    >
    > http://developer.apple.com/documentation/Cocoa/Conceptual/
    > CocoaDrawingGuide/Images/chapter_7_section_3.html#//apple_ref/doc/
    > uid/TP40003290-CH208-BCIIFBJG
    >
    > You are on Tiger, right?
    >
    > -jcr
    >
    >
    > John C. Randolph <jcr...> (408) 914-0013
    > Roaming Cocoa Engineer,
    > Available for your projects at great Expense and Inconvenience.
    >
    >
    >
previous month march 2006 next month
MTWTFSS
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Go to today