You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.4 KiB
C++
44 lines
1.4 KiB
C++
22 years ago
|
#include "exif.hpp"
|
||
22 years ago
|
#include <iostream>
|
||
22 years ago
|
#include <iomanip>
|
||
22 years ago
|
|
||
|
int main(int argc, char* const argv[])
|
||
|
{
|
||
|
if (argc != 2) {
|
||
|
std::cout << "Usage: exiftest path\n";
|
||
|
return 1;
|
||
|
}
|
||
|
|
||
|
Exif::ExifData exifData;
|
||
22 years ago
|
int rc = exifData.read(argv[1]);
|
||
|
|
||
|
if (rc == 0) {
|
||
|
|
||
|
Exif::ExifData::const_iterator beg = exifData.begin();
|
||
|
Exif::ExifData::const_iterator end = exifData.end();
|
||
|
Exif::ExifData::const_iterator i = beg;
|
||
|
for (; i != end; ++i) {
|
||
|
|
||
22 years ago
|
std::cout << std::setw(9) << std::setfill(' ') << std::left
|
||
|
<< i->ifdName() << " "
|
||
|
<< std::setw(9) << std::setfill(' ') << std::left
|
||
|
<< i->sectionName() << " "
|
||
|
<< "0x"
|
||
22 years ago
|
<< std::hex << std::setw(4) << std::setfill('0') << std::right
|
||
|
<< i->tag_ << " "
|
||
|
<< std::setw(27) << std::setfill(' ') << std::left
|
||
|
<< i->tagName() << " "
|
||
|
<< std::setw(17) << std::setfill(' ') << std::left
|
||
|
<< i->typeName() << " "
|
||
|
<< std::dec << std::setw(3) << std::setfill(' ') << std::right
|
||
|
<< i->count_ << " "
|
||
|
<< std::dec << std::setw(3) << std::setfill(' ') << std::right
|
||
|
<< i->typeSize() * i->count_ << "\n";
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return rc;
|
||
|
|
||
22 years ago
|
}
|