{"action":"created","comment":{"url":"https://api.github.com/repos/mavlink/qgroundcontrol/pulls/comments/83923174","pull_request_review_id":4734245,"id":83923174,"diff_hunk":"@@ -73,15 +76,191 @@ void GeoTagWorker::run(void)\n     _cancel = false;\n     emit progressChanged(0);\n \n+    //used to time operations to get a feel for how much to progress the progressBar\n+    QElapsedTimer timerTotal;\n+    QElapsedTimer timerLoadImages;\n+    QElapsedTimer timerParseExif;\n+    QElapsedTimer timerFilter;\n+    QElapsedTimer timerLoadLogFile;\n+    QElapsedTimer timerGeotag;\n+\n+    timerTotal.start();\n+\n+\n+    //////////// Load Images\n+    timerLoadImages.start();\n+\n+    QDir imageDirectory = QDir(_imageDirectory);\n+    if(!imageDirectory.exists()) {\n+        emit error(tr(\"Cannot find the image directory\"));\n+        return;\n+    }\n+    if(!imageDirectory.mkdir(_imageDirectory + \"/TAGGED\")) {\n+        emit error(tr(\"Images have already been tagged\"));\n+        return;\n+    }\n+\n+    imageDirectory.setFilter(QDir::Files | QDir::Readable | QDir::NoSymLinks | QDir::Writable);\n+    imageDirectory.setSorting(QDir::Name);\n+    QStringList nameFilters;\n+    nameFilters << \"*.jpg\" << \"*.JPG\";\n+    imageDirectory.setNameFilters(nameFilters);\n+\n+    QFileInfoList imageList = imageDirectory.entryInfoList();\n+    if(imageList.isEmpty()) {\n+        emit error(tr(\"The image directory doesn't contain images, make sure your images are of the JPG format\"));\n+        return;\n+    }\n+\n+    _imageBuffers.clear();\n+    for (int i = 0; i < imageList.size(); ++i) {\n+        QFile file(imageList.at(i).absoluteFilePath());\n+        if (!file.open(QIODevice::ReadOnly)) {\n+            continue;\n+        }\n+        _imageBuffers.append(QByteArray(file.readAll()));\n+        file.close();\n+    }\n+\n+    qWarning() << \"Image loading time elapsed: \" << timerLoadImages.elapsed() << \" milliseconds\";\n+\n+    ////////// Parse exif data\n+    timerParseExif.start();\n+\n+    // Parse EXIF\n+    ExifParser exifParser;\n+    _tagTime.clear();\n+    for (int i = 0; i < _imageBuffers.count(); i++) {\n+         _tagTime.append(exifParser.readTime(_imageBuffers[i]));\n+    }\n+\n+    qWarning() << \"Parse exif data time elapsed: \" << timerParseExif.elapsed() << \" milliseconds\";\n+\n+    ////////// Load PX4 log\n+    timerLoadLogFile.start();\n+\n+    _geoRef.clear();\n+    _triggerTime.clear();\n+    if (!parsePX4Log()) {\n+        qWarning() << \"Geotagging failed\";\n+        return;\n+    }\n+    qWarning() << \"Found \" << _geoRef.count() << \" trigger logs.\";\n+\n+    qWarning() << \"Log loading time elapsed: \" << timerLoadLogFile.elapsed() << \" milliseconds\";\n+\n+    ////////// Filter Trigger","path":"src/AnalyzeView/GeoTagController.cc","position":87,"original_position":87,"commit_id":"6a1f786d1c27decd05095d52dc78d44a9df8d38b","original_commit_id":"6a1f786d1c27decd05095d52dc78d44a9df8d38b","user":{"login":"DonLakeFlyer","id":5876851,"avatar_url":"https://avatars.githubusercontent.com/u/5876851?v=3","gravatar_id":"","url":"https://api.github.com/users/DonLakeFlyer","html_url":"https://github.com/DonLakeFlyer","followers_url":"https://api.github.com/users/DonLakeFlyer/followers","following_url":"https://api.github.com/users/DonLakeFlyer/following{/other_user}","gists_url":"https://api.github.com/users/DonLakeFlyer/gists{/gist_id}","starred_url":"https://api.github.com/users/DonLakeFlyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DonLakeFlyer/subscriptions","organizations_url":"https://api.github.com/users/DonLakeFlyer/orgs","repos_url":"https://api.github.com/users/DonLakeFlyer/repos","events_url":"https://api.github.com/users/DonLakeFlyer/events{/privacy}","received_events_url":"https://api.github.com/users/DonLakeFlyer/received_events","type":"User","site_admin":false},"body":"Just use regular ```//``` comments","created_at":"2016-10-18T18:43:21Z","updated_at":"2016-10-18T18:49:07Z","html_url":"https://github.com/mavlink/qgroundcontrol/pull/4131#discussion_r83923174","pull_request_url":"https://api.github.com/repos/mavlink/qgroundcontrol/pulls/4131","_links":{"self":{"href":"https://api.github.com/repos/mavlink/qgroundcontrol/pulls/comments/83923174"},"html":{"href":"https://github.com/mavlink/qgroundcontrol/pull/4131#discussion_r83923174"},"pull_request":{"href":"https://api.github.com/repos/mavlink/qgroundcontrol/pulls/4131"}}},"pull_request":{"url":"https://api.github.com/repos/mavlink/qgroundcontrol/pulls/4131","id":89403557,"html_url":"https://github.com/mavlink/qgroundcontrol/pull/4131","diff_url":"https://github.com/mavlink/qgroundcontrol/pull/4131.diff","patch_url":"https://github.com/mavlink/qgroundcontrol/pull/4131.patch","issue_url":"https://api.github.com/repos/mavlink/qgroundcontrol/issues/4131","number":4131,"state":"open","locked":false,"title":"[WIP] Geotagging backend","user":{"login":"birchera","id":2298059,"avatar_url":"https://avatars.githubusercontent.com/u/2298059?v=3","gravatar_id":"","url":"https://api.github.com/users/birchera","html_url":"https://github.com/birchera","followers_url":"https://api.github.com/users/birchera/followers","following_url":"https://api.github.com/users/birchera/following{/other_user}","gists_url":"https://api.github.com/users/birchera/gists{/gist_id}","starred_url":"https://api.github.com/users/birchera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/birchera/subscriptions","organizations_url":"https://api.github.com/users/birchera/orgs","repos_url":"https://api.github.com/users/birchera/repos","events_url":"https://api.github.com/users/birchera/events{/privacy}","received_events_url":"https://api.github.com/users/birchera/received_events","type":"User","site_admin":false},"body":"Needs more documentation, testing and some tweaks in robustness.","created_at":"2016-10-14T15:19:35Z","updated_at":"2016-10-18T18:49:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8c0ebe4302cfd3c9e5b0c548b83bca4276093820","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mavlink/qgroundcontrol/pulls/4131/commits","review_comments_url":"https://api.github.com/repos/mavlink/qgroundcontrol/pulls/4131/comments","review_comment_url":"https://api.github.com/repos/mavlink/qgroundcontrol/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mavlink/qgroundcontrol/issues/4131/comments","statuses_url":"https://api.github.com/repos/mavlink/qgroundcontrol/statuses/6a1f786d1c27decd05095d52dc78d44a9df8d38b","head":{"label":"wingtra:geotagging_back_end","ref":"geotagging_back_end","sha":"6a1f786d1c27decd05095d52dc78d44a9df8d38b","user":{"login":"wingtra","id":11488909,"avatar_url":"https://avatars.githubusercontent.com/u/11488909?v=3","gravatar_id":"","url":"https://api.github.com/users/wingtra","html_url":"https://github.com/wingtra","followers_url":"https://api.github.com/users/wingtra/followers","following_url":"https://api.github.com/users/wingtra/following{/other_user}","gists_url":"https://api.github.com/users/wingtra/gists{/gist_id}","starred_url":"https://api.github.com/users/wingtra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wingtra/subscriptions","organizations_url":"https://api.github.com/users/wingtra/orgs","repos_url":"https://api.github.com/users/wingtra/repos","events_url":"https://api.github.com/users/wingtra/events{/privacy}","received_events_url":"https://api.github.com/users/wingtra/received_events","type":"Organization","site_admin":false},"repo":{"id":63077604,"name":"qgroundcontrol","full_name":"wingtra/qgroundcontrol","owner":{"login":"wingtra","id":11488909,"avatar_url":"https://avatars.githubusercontent.com/u/11488909?v=3","gravatar_id":"","url":"https://api.github.com/users/wingtra","html_url":"https://github.com/wingtra","followers_url":"https://api.github.com/users/wingtra/followers","following_url":"https://api.github.com/users/wingtra/following{/other_user}","gists_url":"https://api.github.com/users/wingtra/gists{/gist_id}","starred_url":"https://api.github.com/users/wingtra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wingtra/subscriptions","organizations_url":"https://api.github.com/users/wingtra/orgs","repos_url":"https://api.github.com/users/wingtra/repos","events_url":"https://api.github.com/users/wingtra/events{/privacy}","received_events_url":"https://api.github.com/users/wingtra/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wingtra/qgroundcontrol","description":"QGroundControl Ground Control Station","fork":true,"url":"https://api.github.com/repos/wingtra/qgroundcontrol","forks_url":"https://api.github.com/repos/wingtra/qgroundcontrol/forks","keys_url":"https://api.github.com/repos/wingtra/qgroundcontrol/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wingtra/qgroundcontrol/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wingtra/qgroundcontrol/teams","hooks_url":"https://api.github.com/repos/wingtra/qgroundcontrol/hooks","issue_events_url":"https://api.github.com/repos/wingtra/qgroundcontrol/issues/events{/number}","events_url":"https://api.github.com/repos/wingtra/qgroundcontrol/events","assignees_url":"https://api.github.com/repos/wingtra/qgroundcontrol/assignees{/user}","branches_url":"https://api.github.com/repos/wingtra/qgroundcontrol/branches{/branch}","tags_url":"https://api.github.com/repos/wingtra/qgroundcontrol/tags","blobs_url":"https://api.github.com/repos/wingtra/qgroundcontrol/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wingtra/qgroundcontrol/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wingtra/qgroundcontrol/git/refs{/sha}","trees_url":"https://api.github.com/repos/wingtra/qgroundcontrol/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wingtra/qgroundcontrol/statuses/{sha}","languages_url":"https://api.github.com/repos/wingtra/qgroundcontrol/languages","stargazers_url":"https://api.github.com/repos/wingtra/qgroundcontrol/stargazers","contributors_url":"https://api.github.com/repos/wingtra/qgroundcontrol/contributors","subscribers_url":"https://api.github.com/repos/wingtra/qgroundcontrol/subscribers","subscription_url":"https://api.github.com/repos/wingtra/qgroundcontrol/subscription","commits_url":"https://api.github.com/repos/wingtra/qgroundcontrol/commits{/sha}","git_commits_url":"https://api.github.com/repos/wingtra/qgroundcontrol/git/commits{/sha}","comments_url":"https://api.github.com/repos/wingtra/qgroundcontrol/comments{/number}","issue_comment_url":"https://api.github.com/repos/wingtra/qgroundcontrol/issues/comments{/number}","contents_url":"https://api.github.com/repos/wingtra/qgroundcontrol/contents/{+path}","compare_url":"https://api.github.com/repos/wingtra/qgroundcontrol/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wingtra/qgroundcontrol/merges","archive_url":"https://api.github.com/repos/wingtra/qgroundcontrol/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wingtra/qgroundcontrol/downloads","issues_url":"https://api.github.com/repos/wingtra/qgroundcontrol/issues{/number}","pulls_url":"https://api.github.com/repos/wingtra/qgroundcontrol/pulls{/number}","milestones_url":"https://api.github.com/repos/wingtra/qgroundcontrol/milestones{/number}","notifications_url":"https://api.github.com/repos/wingtra/qgroundcontrol/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wingtra/qgroundcontrol/labels{/name}","releases_url":"https://api.github.com/repos/wingtra/qgroundcontrol/releases{/id}","deployments_url":"https://api.github.com/repos/wingtra/qgroundcontrol/deployments","created_at":"2016-07-11T15:02:27Z","updated_at":"2016-07-11T15:02:41Z","pushed_at":"2016-10-16T06:40:22Z","git_url":"git://github.com/wingtra/qgroundcontrol.git","ssh_url":"git@github.com:wingtra/qgroundcontrol.git","clone_url":"https://github.com/wingtra/qgroundcontrol.git","svn_url":"https://github.com/wingtra/qgroundcontrol","homepage":"http://qgroundcontrol.org","size":189970,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mavlink:master","ref":"master","sha":"1749b2a10fdbaa958728c24b118637578a6a8865","user":{"login":"mavlink","id":961247,"avatar_url":"https://avatars.githubusercontent.com/u/961247?v=3","gravatar_id":"","url":"https://api.github.com/users/mavlink","html_url":"https://github.com/mavlink","followers_url":"https://api.github.com/users/mavlink/followers","following_url":"https://api.github.com/users/mavlink/following{/other_user}","gists_url":"https://api.github.com/users/mavlink/gists{/gist_id}","starred_url":"https://api.github.com/users/mavlink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mavlink/subscriptions","organizations_url":"https://api.github.com/users/mavlink/orgs","repos_url":"https://api.github.com/users/mavlink/repos","events_url":"https://api.github.com/users/mavlink/events{/privacy}","received_events_url":"https://api.github.com/users/mavlink/received_events","type":"Organization","site_admin":false},"repo":{"id":2567844,"name":"qgroundcontrol","full_name":"mavlink/qgroundcontrol","owner":{"login":"mavlink","id":961247,"avatar_url":"https://avatars.githubusercontent.com/u/961247?v=3","gravatar_id":"","url":"https://api.github.com/users/mavlink","html_url":"https://github.com/mavlink","followers_url":"https://api.github.com/users/mavlink/followers","following_url":"https://api.github.com/users/mavlink/following{/other_user}","gists_url":"https://api.github.com/users/mavlink/gists{/gist_id}","starred_url":"https://api.github.com/users/mavlink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mavlink/subscriptions","organizations_url":"https://api.github.com/users/mavlink/orgs","repos_url":"https://api.github.com/users/mavlink/repos","events_url":"https://api.github.com/users/mavlink/events{/privacy}","received_events_url":"https://api.github.com/users/mavlink/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mavlink/qgroundcontrol","description":"QGroundControl Ground Control Station","fork":false,"url":"https://api.github.com/repos/mavlink/qgroundcontrol","forks_url":"https://api.github.com/repos/mavlink/qgroundcontrol/forks","keys_url":"https://api.github.com/repos/mavlink/qgroundcontrol/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mavlink/qgroundcontrol/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mavlink/qgroundcontrol/teams","hooks_url":"https://api.github.com/repos/mavlink/qgroundcontrol/hooks","issue_events_url":"https://api.github.com/repos/mavlink/qgroundcontrol/issues/events{/number}","events_url":"https://api.github.com/repos/mavlink/qgroundcontrol/events","assignees_url":"https://api.github.com/repos/mavlink/qgroundcontrol/assignees{/user}","branches_url":"https://api.github.com/repos/mavlink/qgroundcontrol/branches{/branch}","tags_url":"https://api.github.com/repos/mavlink/qgroundcontrol/tags","blobs_url":"https://api.github.com/repos/mavlink/qgroundcontrol/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mavlink/qgroundcontrol/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mavlink/qgroundcontrol/git/refs{/sha}","trees_url":"https://api.github.com/repos/mavlink/qgroundcontrol/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mavlink/qgroundcontrol/statuses/{sha}","languages_url":"https://api.github.com/repos/mavlink/qgroundcontrol/languages","stargazers_url":"https://api.github.com/repos/mavlink/qgroundcontrol/stargazers","contributors_url":"https://api.github.com/repos/mavlink/qgroundcontrol/contributors","subscribers_url":"https://api.github.com/repos/mavlink/qgroundcontrol/subscribers","subscription_url":"https://api.github.com/repos/mavlink/qgroundcontrol/subscription","commits_url":"https://api.github.com/repos/mavlink/qgroundcontrol/commits{/sha}","git_commits_url":"https://api.github.com/repos/mavlink/qgroundcontrol/git/commits{/sha}","comments_url":"https://api.github.com/repos/mavlink/qgroundcontrol/comments{/number}","issue_comment_url":"https://api.github.com/repos/mavlink/qgroundcontrol/issues/comments{/number}","contents_url":"https://api.github.com/repos/mavlink/qgroundcontrol/contents/{+path}","compare_url":"https://api.github.com/repos/mavlink/qgroundcontrol/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mavlink/qgroundcontrol/merges","archive_url":"https://api.github.com/repos/mavlink/qgroundcontrol/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mavlink/qgroundcontrol/downloads","issues_url":"https://api.github.com/repos/mavlink/qgroundcontrol/issues{/number}","pulls_url":"https://api.github.com/repos/mavlink/qgroundcontrol/pulls{/number}","milestones_url":"https://api.github.com/repos/mavlink/qgroundcontrol/milestones{/number}","notifications_url":"https://api.github.com/repos/mavlink/qgroundcontrol/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mavlink/qgroundcontrol/labels{/name}","releases_url":"https://api.github.com/repos/mavlink/qgroundcontrol/releases{/id}","deployments_url":"https://api.github.com/repos/mavlink/qgroundcontrol/deployments","created_at":"2011-10-13T07:31:07Z","updated_at":"2016-10-18T12:40:30Z","pushed_at":"2016-10-18T18:05:09Z","git_url":"git://github.com/mavlink/qgroundcontrol.git","ssh_url":"git@github.com:mavlink/qgroundcontrol.git","clone_url":"https://github.com/mavlink/qgroundcontrol.git","svn_url":"https://github.com/mavlink/qgroundcontrol","homepage":"http://qgroundcontrol.org","size":208719,"stargazers_count":409,"watchers_count":409,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":680,"mirror_url":null,"open_issues_count":427,"forks":680,"open_issues":427,"watchers":409,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mavlink/qgroundcontrol/pulls/4131"},"html":{"href":"https://github.com/mavlink/qgroundcontrol/pull/4131"},"issue":{"href":"https://api.github.com/repos/mavlink/qgroundcontrol/issues/4131"},"comments":{"href":"https://api.github.com/repos/mavlink/qgroundcontrol/issues/4131/comments"},"review_comments":{"href":"https://api.github.com/repos/mavlink/qgroundcontrol/pulls/4131/comments"},"review_comment":{"href":"https://api.github.com/repos/mavlink/qgroundcontrol/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mavlink/qgroundcontrol/pulls/4131/commits"},"statuses":{"href":"https://api.github.com/repos/mavlink/qgroundcontrol/statuses/6a1f786d1c27decd05095d52dc78d44a9df8d38b"}}}}
{"actor":{"display_login":"DonLakeFlyer"}}