proper way to handle maker notes
Rafael Espíndola
rafael.espindola at gmail.com
Mon Jun 9 15:09:22 PDT 2008
For decompressing NEF files I need to read the decompression curve. I
am not sure I am using the API the best I way. What I currently have
is:
void NEFFile::_getCompressionCurve(std::vector<uint8_t>& v)
{
IFDDir::Ref dir = _locateExifIfd();
assert(dir);
IFDEntry::Ref maker_ent = dir->getEntry(IFD::EXIF_TAG_MAKER_NOTE);
assert(maker_ent);
uint32_t off = maker_ent->offset();
uint32_t base = off + 10;
IFDDir::Ref ref(new IFDDir(base + 8, *m_container));
ref->load();
IFDEntry::Ref curve = ref->getEntry(0x0096);
assert(curve);
size_t size = curve->count();
std::vector<uint8_t> temp(size);
size_t read = m_container->fetchData(&temp[0],
base + curve->offset(),
size);
assert(read == size);
v.swap(temp);
}
Other then proper error checking and not hard coding constants, is
this the proper way to read something from the MakerNote?
Cheers,
Rafael
More information about the Libopenraw-dev
mailing list