CGImageSourceCreateWithData and RAW images
Hi,
I have a RAW image from a Nikon camera (.NEF)
OS-X (quicklook, iPhoto, finder preview) reads it just fine, so there's no codec problem.
However, I'm trying to write a program to convert the files... BUT, the only way I've found to read the files to a CGImageRef is the following functions:
CGImageSourceCreateWithData
CGImageSourceCreateImageAtIndex
Whenever I use these functions though on the RAW file, the file saved off later is very, very small, whereas other filetypes work just fine...
To put that in a different form:
"inNEF" = the original NEF
"inJPG" = the NEF exported from iPhoto as JPG
"outJPG" = the JPG created by reading the inImage and writing it out
inNEF -> outJPG --- outputs a tiny JPG image
inJPG -> outJPG --- outputs the full-size JPG image
This is without changing any settings - just passing the path to a different file.
Does anybody have a clue what's wrong? Either that or alternatives would be greatly appreciated!
|