- 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
+}