more formatting

v0.27.3
Michał Walenciak 8 years ago
parent 6dd15eb625
commit 232dbd715f

@ -324,25 +324,26 @@ void printIFD(Exiv2::BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption
{ {
for ( size_t k = 0 ; k < kount ; k++ ) for ( size_t k = 0 ; k < kount ; k++ )
{ {
out << sp << conditional_byte_swap_4_array<16>(&buf, k*size, bSwap); out << sp << conditional_byte_swap_4_array<16>(&buf, k*size, bSwap);
sp = " "; sp = " ";
} }
} }
else if ( isLongType(type) ) else if ( isLongType(type) )
{ {
for ( size_t k = 0 ; k < kount ; k++ ) for ( size_t k = 0 ; k < kount ; k++ )
{ {
out << sp << conditional_byte_swap_4_array<32>(&buf, k*size, bSwap); out << sp << conditional_byte_swap_4_array<32>(&buf, k*size, bSwap);
sp = " "; sp = " ";
} }
} }
else if ( isRationalType(type) ) else if ( isRationalType(type) )
{ {
for ( size_t k = 0 ; k < kount ; k++ ) { for ( size_t k = 0 ; k < kount ; k++ )
uint32_t a = conditional_byte_swap_4_array<32>(&buf, k*size+0, bSwap); {
uint32_t b = conditional_byte_swap_4_array<32>(&buf, k*size+4, bSwap); uint32_t a = conditional_byte_swap_4_array<32>(&buf, k*size+0, bSwap);
out << sp << a << "/" << b; uint32_t b = conditional_byte_swap_4_array<32>(&buf, k*size+4, bSwap);
sp = " "; out << sp << a << "/" << b;
sp = " ";
} }
} }
else if ( isStringType(type) ) else if ( isStringType(type) )
@ -355,11 +356,11 @@ void printIFD(Exiv2::BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption
{ {
for ( size_t k = 0 ; k < count ; k++ ) for ( size_t k = 0 ; k < count ; k++ )
{ {
size_t restore = io.tell(); size_t restore = io.tell();
uint32_t offset = conditional_byte_swap_4_array<32>(&buf, k*size, bSwap); uint32_t offset = conditional_byte_swap_4_array<32>(&buf, k*size, bSwap);
std::cerr << "tag = " << Exiv2::Internal::stringFormat("%#x",tag) << std::endl; std::cerr << "tag = " << Exiv2::Internal::stringFormat("%#x",tag) << std::endl;
printIFD(io, out, option, offset, bSwap, depth); printIFD(io, out, option, offset, bSwap, depth);
io.seek(restore, Exiv2::BasicIo::beg); io.seek(restore, Exiv2::BasicIo::beg);
} }
} }
else if ( option == Exiv2::kpsRecursive && tag == 0x83bb /* IPTCNAA */ ) else if ( option == Exiv2::kpsRecursive && tag == 0x83bb /* IPTCNAA */ )
@ -382,19 +383,22 @@ void printIFD(Exiv2::BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption
io.seek(offset, Exiv2::BasicIo::beg); // position io.seek(offset, Exiv2::BasicIo::beg); // position
io.read(bytes,jump ) ; // read io.read(bytes,jump ) ; // read
bytes[jump]=0 ; bytes[jump]=0 ;
if ( ::strcmp("Nikon",chars) == 0 ) { if ( ::strcmp("Nikon",chars) == 0 )
// tag is an embedded tiff {
Exiv2::byte* bytes=new Exiv2::byte[count-jump] ; // allocate memory // tag is an embedded tiff
io.read(bytes,count-jump) ; // read Exiv2::byte* bytes=new Exiv2::byte[count-jump] ; // allocate memory
Exiv2::MemIo memIo(bytes,count-jump) ; // create a file io.read(bytes,count-jump) ; // read
std::cerr << "Nikon makernote" << std::endl; Exiv2::MemIo memIo(bytes,count-jump) ; // create a file
// printTiffStructure(memIo,out,option,depth); TODO: fix it std::cerr << "Nikon makernote" << std::endl;
delete[] bytes ; // free // printTiffStructure(memIo,out,option,depth); TODO: fix it
} else { delete[] bytes ; // free
// tag is an IFD }
io.seek(0, Exiv2::BasicIo::beg); // position else
std::cerr << "makernote" << std::endl; {
//printIFDStructure(io,out,option,offset,bSwap,c,depth); // TODO: fix me // tag is an IFD
io.seek(0, Exiv2::BasicIo::beg); // position
std::cerr << "makernote" << std::endl;
//printIFDStructure(io,out,option,offset,bSwap,c,depth); // TODO: fix me
} }
io.seek(restore,Exiv2::BasicIo::beg); // restore io.seek(restore,Exiv2::BasicIo::beg); // restore

Loading…
Cancel
Save