|
|
@ -74,6 +74,9 @@ void RafImage::printStructure(std::ostream& out, PrintStructureOption option, si
|
|
|
|
throw Error(ErrorCode::kerNotAnImage, "RAF");
|
|
|
|
throw Error(ErrorCode::kerNotAnImage, "RAF");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// The following is based on https://libopenraw.freedesktop.org/formats/raf/ and
|
|
|
|
|
|
|
|
// https://exiftool.org/TagNames/FujiFilm.html#RAFHeader
|
|
|
|
|
|
|
|
|
|
|
|
const bool bPrint = option == kpsBasic || option == kpsRecursive;
|
|
|
|
const bool bPrint = option == kpsBasic || option == kpsRecursive;
|
|
|
|
if (bPrint) {
|
|
|
|
if (bPrint) {
|
|
|
|
io_->seek(0, BasicIo::beg); // rewind
|
|
|
|
io_->seek(0, BasicIo::beg); // rewind
|
|
|
@ -159,7 +162,7 @@ void RafImage::printStructure(std::ostream& out, PrintStructureOption option, si
|
|
|
|
|
|
|
|
|
|
|
|
// RAFs can carry the payload in one or two parts
|
|
|
|
// RAFs can carry the payload in one or two parts
|
|
|
|
uint32_t meta_off[2], meta_len[2];
|
|
|
|
uint32_t meta_off[2], meta_len[2];
|
|
|
|
uint32_t cfa_off[2], cfa_len[2], cfa_skip[2], cfa_size[2], cfa_stride[2];
|
|
|
|
uint32_t cfa_off[2], cfa_len[2], comp[2], cfa_size[2], cfa_data[2];
|
|
|
|
for (size_t i = 0; i < 2; i++) {
|
|
|
|
for (size_t i = 0; i < 2; i++) {
|
|
|
|
address = io_->tell();
|
|
|
|
address = io_->tell();
|
|
|
|
byte data[4];
|
|
|
|
byte data[4];
|
|
|
@ -187,34 +190,34 @@ void RafImage::printStructure(std::ostream& out, PrintStructureOption option, si
|
|
|
|
cfa_len[i] = Exiv2::getULong(data, bigEndian);
|
|
|
|
cfa_len[i] = Exiv2::getULong(data, bigEndian);
|
|
|
|
size_t address3 = io_->tell();
|
|
|
|
size_t address3 = io_->tell();
|
|
|
|
io_->readOrThrow(data, 4);
|
|
|
|
io_->readOrThrow(data, 4);
|
|
|
|
cfa_skip[i] = Exiv2::getULong(data, bigEndian);
|
|
|
|
comp[i] = Exiv2::getULong(data, bigEndian);
|
|
|
|
size_t address4 = io_->tell();
|
|
|
|
size_t address4 = io_->tell();
|
|
|
|
io_->readOrThrow(data, 4);
|
|
|
|
io_->readOrThrow(data, 4);
|
|
|
|
cfa_size[i] = Exiv2::getULong(data, bigEndian);
|
|
|
|
cfa_size[i] = Exiv2::getULong(data, bigEndian);
|
|
|
|
size_t address5 = io_->tell();
|
|
|
|
size_t address5 = io_->tell();
|
|
|
|
io_->readOrThrow(data, 4);
|
|
|
|
io_->readOrThrow(data, 4);
|
|
|
|
cfa_stride[i] = Exiv2::getULong(data, bigEndian);
|
|
|
|
cfa_data[i] = Exiv2::getULong(data, bigEndian);
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::stringstream c_off;
|
|
|
|
std::stringstream c_off;
|
|
|
|
std::stringstream c_len;
|
|
|
|
std::stringstream c_len;
|
|
|
|
std::stringstream c_skip;
|
|
|
|
std::stringstream c_comp;
|
|
|
|
std::stringstream c_size;
|
|
|
|
std::stringstream c_size;
|
|
|
|
std::stringstream c_stride;
|
|
|
|
std::stringstream c_data;
|
|
|
|
c_off << cfa_off[i];
|
|
|
|
c_off << cfa_off[i];
|
|
|
|
c_len << cfa_len[i];
|
|
|
|
c_len << cfa_len[i];
|
|
|
|
c_skip << cfa_skip[i];
|
|
|
|
c_comp << comp[i];
|
|
|
|
c_size << cfa_size[i];
|
|
|
|
c_size << cfa_size[i];
|
|
|
|
c_stride << cfa_stride[i];
|
|
|
|
c_data << cfa_data[i];
|
|
|
|
out << Internal::indent(depth) << Internal::stringFormat(format, address, 4U) << " CFA offset" << i + 1 << " : "
|
|
|
|
out << Internal::indent(depth) << Internal::stringFormat(format, address, 4U) << " CFA offset" << i + 1 << " : "
|
|
|
|
<< c_off.str() << std::endl;
|
|
|
|
<< c_off.str() << std::endl;
|
|
|
|
out << Internal::indent(depth) << Internal::stringFormat(format, address2, 4U) << " CFA length" << i + 1
|
|
|
|
out << Internal::indent(depth) << Internal::stringFormat(format, address2, 4U) << " CFA length" << i + 1
|
|
|
|
<< " : " << c_len.str() << std::endl;
|
|
|
|
<< " : " << c_len.str() << std::endl;
|
|
|
|
out << Internal::indent(depth) << Internal::stringFormat(format, address3, 4U) << " CFA skip" << i + 1
|
|
|
|
out << Internal::indent(depth) << Internal::stringFormat(format, address3, 4U) << "compression" << i + 1
|
|
|
|
<< " : " << c_skip.str() << std::endl;
|
|
|
|
<< " : " << c_comp.str() << std::endl;
|
|
|
|
out << Internal::indent(depth) << Internal::stringFormat(format, address4, 4U) << " CFA chunk" << i + 1
|
|
|
|
out << Internal::indent(depth) << Internal::stringFormat(format, address4, 4U) << " CFA chunk" << i + 1
|
|
|
|
<< " : " << c_size.str() << std::endl;
|
|
|
|
<< " : " << c_size.str() << std::endl;
|
|
|
|
out << Internal::indent(depth) << Internal::stringFormat(format, address5, 4U) << " CFA stride" << i + 1
|
|
|
|
out << Internal::indent(depth) << Internal::stringFormat(format, address5, 4U) << " unknown" << i + 1
|
|
|
|
<< " : " << c_stride.str() << std::endl;
|
|
|
|
<< " : " << c_data.str() << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|