X-Git-Url: http://git.datanom.net/lensdb.git/blobdiff_plain/1db1683a3948a4c69bcecbefaf259eba14ac9860..2c9438951b2f16a0470e7240bcb6f2da230ee547:/lib/main.cpp diff --git a/lib/main.cpp b/lib/main.cpp index ad1d704..27efeaa 100644 --- a/lib/main.cpp +++ b/lib/main.cpp @@ -1,3 +1,39 @@ - int main(int argc, char** argv) { - return 0; - } +#include "main.hpp" + +using namespace std; + + +ExifScanner::ExifScanner(const char* file): file(file) { + +} + +ExifScanner::~ExifScanner() { + +} + +void ExifScanner::scanner_do_work() { + if (file == NULL){ + cout << "Example1: Read metadata from an image." << endl; + cout << "Please specify input file name" << endl; + return; + } + + // create our ExifTool object + ExifTool *et = new ExifTool(); + // read metadata from the image + TagInfo *info = et->ImageInfo(file); + if (info) { + // print returned information + for (TagInfo *i=info; i; i=i->next) { + cout << i->name << " = " << i->value << endl; + } + // we are responsible for deleting the information when done + delete info; + } else if (et->LastComplete() <= 0) { + cerr << "Error executing exiftool!" << endl; + } + // print exiftool stderr messages + char *err = et->GetError(); + if (err) cout << err; + delete et; // delete our ExifTool object +}