Skip to content

Commit

Permalink
Add test173 to check XML namespace detection
Browse files Browse the repository at this point in the history
The Garmin TrackPointExtension must be in the right namespace to be
used, so ensure that when the tag is in a different namespace it is
ignored.
  • Loading branch information
dfandrich committed Jun 15, 2024
1 parent de2b4b9 commit 882ef9f
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/data/test173.param
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
TITLE='Ignore heading with incorrect TrackPointExtension namespace'
PRECOMMAND='cat "$STAGINGDIR/point1-1.jpg" >"$LOGDIR/test.jpg"'
COMMAND='$PROGRAM --heading --direction 0 -z 0 -g "$STAGINGDIR/track16.gpx" "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && exiv2 -pv pr "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg"'
RESULTCODE=0
35 changes: 35 additions & 0 deletions tests/data/test173.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Reading GPS Data...
Legend: . = Ok, / = Interpolated, < = Rounded, - = No match, ^ = Too far
w = Write Fail, ? = No EXIF date, ! = GPS already present

Correlate: .

Completed correlation process.
Matched: 1 (1 Exact, 0 Interpolated, 0 Rounded).
Failed: 0 (0 Not matched, 0 Write failure, 0 Too Far,
0 No Date, 0 GPS Already Present.)
0x011a Image XResolution Rational 1 72/1
0x011b Image YResolution Rational 1 72/1
0x0128 Image ResolutionUnit Short 1 2
0x0132 Image DateTime Ascii 20 2012:11:22 12:34:56
0x0213 Image YCbCrPositioning Short 1 1
0x8769 Image ExifTag Long 1 134
0x9000 Photo ExifVersion Undefined 4 48 50 49 48
0x9003 Photo DateTimeOriginal Ascii 20 2012:11:22 12:34:56
0x9004 Photo DateTimeDigitized Ascii 20 2012:11:22 12:34:56
0x9101 Photo ComponentsConfiguration Undefined 4 1 2 3 0
0xa000 Photo FlashpixVersion Undefined 4 48 49 48 48
0xa001 Photo ColorSpace Short 1 65535
0xa002 Photo PixelXDimension Long 1 64
0xa003 Photo PixelYDimension Long 1 64
0x8825 Image GPSTag Long 1 276
0x0000 GPSInfo GPSVersionID Byte 4 2 2 0 0
0x0001 GPSInfo GPSLatitudeRef Ascii 2 N
0x0002 GPSInfo GPSLatitude Rational 3 31/1 27/1 314816/10000
0x0003 GPSInfo GPSLongitudeRef Ascii 2 E
0x0004 GPSInfo GPSLongitude Rational 3 35/1 23/1 593916/10000
0x0005 GPSInfo GPSAltitudeRef Byte 1 1
0x0006 GPSInfo GPSAltitude Rational 1 42191/100
0x0007 GPSInfo GPSTimeStamp Rational 3 12/1 34/1 56/1
0x0012 GPSInfo GPSMapDatum Ascii 7 WGS-84
0x001d GPSInfo GPSDateStamp Ascii 11 2012:11:22
29 changes: 29 additions & 0 deletions tests/staging/track16.gpx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<gpx xmlns:tc2="http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gpxtpx="http://not-the-correct-xmlns.invalid/ThisCouldMeanJustAboutAnything" xmlns="http://www.topografix.com/GPX/1/1" version="1.1" creator="TC2 to GPX11 XSLT stylesheet" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd">
<trk>
<name>Simulated Garmin track with both bearing/course extensions</name>
<trkseg>
<trkpt lat="31.4587449" lon="35.3998310">
<ele>-421.91</ele>
<time>2012-11-22T12:34:56Z</time>
<extensions>
<gpxtpx:TrackPointExtension>
<gpxtpx:speed>2.61</gpxtpx:speed>
<gpxtpx:course>289.76</gpxtpx:course>
</gpxtpx:TrackPointExtension>
</extensions>
</trkpt>
<trkpt lat="31.4587780" lon="35.3997909">
<ele>-420.40</ele>
<time>2012-11-22T12:35:20Z</time>
<extensions>
<gpxtpx:TrackPointExtension>
<gpxtpx:speed>2.21</gpxtpx:speed>
<gpxtpx:course>320.12</gpxtpx:course>
<gpxtpx:bearing>333.33</gpxtpx:bearing>
</gpxtpx:TrackPointExtension>
</extensions>
</trkpt>
</trkseg>
</trk>
</gpx>

0 comments on commit 882ef9f

Please sign in to comment.