Patch #1233

Bugfixes in samples/geotag.cpp

Added by Anton Keks 5 months ago. Updated 5 months ago.

Status:ClosedStart date:26 Sep 2016
Priority:NormalDue date:
Assignee:Robin Mills% Done:

100%

Category:samplesEstimated time:6.00 hours
Target version:0.26

Description

I have found a fixed a couple of bugs in geotag.cpp sample, here is the diff:

$ diff geotag-orig.cpp geotag.cpp
352c352
< if ( me->bEle && len > 5 ) {
---

if ( me->bEle && len > 2 ) {

405a406

T.tm_isdst = -1 ; // determine value automatically (otherwise hour may shift)

855c856
< printf("tz,dsl,adjust = %d,%d,%d total = %dsecs (= %d:%d:%d)\n",t,d,a,A,h,m,s);
---

printf("tz,dst,adjust = %d,%d,%d total = %dsecs (= %d:%d:%d)\n",t,d,a,A,h,m,s);

1. First change fixes parsing of shorter elevations, e.g. '25.0', which is only four chars.
2. Second change makes sure times are parsed correctly our of GPX file if DST is currently active (passing tm_isdst==0 to mktime adjusts time by +1 hour, at least on Linux, probably because it thinks it needs to assume timezone of GMT plus DST)
3. Third change was just a typo

geotag.cpp Magnifier (28.6 KB) Anton Keks, 26 Sep 2016 21:29

Associated revisions

Revision 4568
Added by Robin Mills 5 months ago

#1233 Thank You to Anton for reporting this and providing a patch. I've updated the test suite.

Revision 4569
Added by Robin Mills 5 months ago

#1233 Changes to geotag-test to avoid full paths. Added make geotag-test. Sanitized geotag.cpp code

Revision 4571
Added by Robin Mills 5 months ago

#1233 geotag.cpp added option -ascii. The degree sign in the output was upsetting test harness on some platforms.

Revision 4572
Added by Robin Mills 5 months ago

#1233 Fixes for the test suite on msvc.

Revision 4573
Added by Robin Mills 5 months ago

#1233 Fixed issue on MacOS-X 10.4 (32 big big-endian PPC, 2003 OS) with realpath() and added additional images for future testing.

Revision 4574
Added by Robin Mills 5 months ago

#1233 Correction to r4573

History

#1 Updated by Robin Mills 5 months ago

  • Category set to samples
  • Status changed from New to Assigned
  • Assignee set to Robin Mills
  • Target version set to 0.26

Anton

Thanks for reporting this and providing changes. Can you attach your copy of geotag.cpp and I'll submit to the repository.

I wrote that sample in 2012 and I never finished it. I've been so busy with other matters, that I have never got round to working on it again. If you'd like to work on a little test script for geotag, I'd be delight to accept your contribution! I can mentor you about writing test scripts - it's painless.

Robin

#2 Updated by Anton Keks 5 months ago

Thanks for the quick response!
Here is my copy.

#3 Updated by Robin Mills 5 months ago

  • Tracker changed from Bug to Patch
  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100
  • Estimated time set to 2.00

Anton: Thank You for reporting this and providing a patch. I've submitted your code and added a simple test script. r4568

I'm sure there are subtle things wrong with this such as handling of time-zones. Anyway, it worked first time on some GPX/JPG data I have from a trip to Death Valley California in 2008. If you find issue with this, please provide your GPX and images. We can extract the .exv metadata from your images to keep down the size of the test suite - and it's useful to chop irrelevant data from the GPX. For example, my GPX was 1.5mb which I chopped to 6k.

#4 Updated by Robin Mills 5 months ago

  • Estimated time changed from 2.00 to 6.00

This is taken up more time that expected. However the code is now being tested. And I discovered an interesting bug on MacOS-X 10.4 (testing is a good thing!). I still feel this can be best described as "experimental - use at your own risk". I now have a camera with a built-in GPS (Nikon 5300), so I don't have a reason to use this.

Also available in: Atom PDF

Redmine Appliance - Powered by TurnKey Linux