Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added buttons to control other options, such as writing XMP files and…

… performing the actual tagging.

Corrected the path to the internal python files; added the python files as resources.
Added a polyline to track the points from the GPX file; currently displays *all* points, resulting in a large HTML file.
Changed all output in python files to standard error.
  • Loading branch information...
commit df6755b90d4116b8676694f68aef82b04e019da9 1 parent 0124e0b
Ian Molloy authored
184 English.lproj/MainMenu.xib
@@ -21,8 +21,8 @@
21 21 </object>
22 22 <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
23 23 <bool key="EncodedWithXMLCoder">YES</bool>
24   - <integer value="372"/>
25 24 <integer value="29"/>
  25 + <integer value="610"/>
26 26 </object>
27 27 <object class="NSArray" key="IBDocument.PluginDependencies">
28 28 <bool key="EncodedWithXMLCoder">YES</bool>
@@ -1323,7 +1323,7 @@
1323 1323 <object class="NSWindowTemplate" id="972006081">
1324 1324 <int key="NSWindowStyleMask">15</int>
1325 1325 <int key="NSWindowBacking">2</int>
1326   - <string key="NSWindowRect">{{335, 528}, {696, 222}}</string>
  1326 + <string key="NSWindowRect">{{335, 530}, {696, 220}}</string>
1327 1327 <int key="NSWTFlags">1954021376</int>
1328 1328 <string key="NSWindowTitle">GPX Tagger</string>
1329 1329 <string key="NSWindowClass">NSWindow</string>
@@ -1337,7 +1337,7 @@
1337 1337 <object class="NSTextField" id="104229112">
1338 1338 <reference key="NSNextResponder" ref="439893737"/>
1339 1339 <int key="NSvFlags">268</int>
1340   - <string key="NSFrame">{{20, 180}, {234, 22}}</string>
  1340 + <string key="NSFrame">{{20, 178}, {234, 22}}</string>
1341 1341 <reference key="NSSuperview" ref="439893737"/>
1342 1342 <bool key="NSEnabled">YES</bool>
1343 1343 <object class="NSTextFieldCell" key="NSCell" id="773218529">
@@ -1374,7 +1374,7 @@
1374 1374 <object class="NSTextField" id="647270672">
1375 1375 <reference key="NSNextResponder" ref="439893737"/>
1376 1376 <int key="NSvFlags">268</int>
1377   - <string key="NSFrame">{{20, 148}, {234, 22}}</string>
  1377 + <string key="NSFrame">{{20, 146}, {234, 22}}</string>
1378 1378 <reference key="NSSuperview" ref="439893737"/>
1379 1379 <bool key="NSEnabled">YES</bool>
1380 1380 <object class="NSTextFieldCell" key="NSCell" id="907577578">
@@ -1391,7 +1391,7 @@
1391 1391 <object class="NSButton" id="347262794">
1392 1392 <reference key="NSNextResponder" ref="439893737"/>
1393 1393 <int key="NSvFlags">268</int>
1394   - <string key="NSFrame">{{253, 174}, {123, 32}}</string>
  1394 + <string key="NSFrame">{{253, 172}, {123, 32}}</string>
1395 1395 <reference key="NSSuperview" ref="439893737"/>
1396 1396 <bool key="NSEnabled">YES</bool>
1397 1397 <object class="NSButtonCell" key="NSCell" id="492906507">
@@ -1411,7 +1411,7 @@
1411 1411 <object class="NSButton" id="280589736">
1412 1412 <reference key="NSNextResponder" ref="439893737"/>
1413 1413 <int key="NSvFlags">268</int>
1414   - <string key="NSFrame">{{253, 141}, {123, 32}}</string>
  1414 + <string key="NSFrame">{{253, 139}, {123, 32}}</string>
1415 1415 <reference key="NSSuperview" ref="439893737"/>
1416 1416 <bool key="NSEnabled">YES</bool>
1417 1417 <object class="NSButtonCell" key="NSCell" id="877446641">
@@ -1431,7 +1431,7 @@
1431 1431 <object class="NSSlider" id="706630860">
1432 1432 <reference key="NSNextResponder" ref="439893737"/>
1433 1433 <int key="NSvFlags">268</int>
1434   - <string key="NSFrame">{{85, 110}, {222, 26}}</string>
  1434 + <string key="NSFrame">{{85, 108}, {222, 26}}</string>
1435 1435 <reference key="NSSuperview" ref="439893737"/>
1436 1436 <bool key="NSViewCanDrawConcurrently">YES</bool>
1437 1437 <bool key="NSEnabled">YES</bool>
@@ -1453,7 +1453,7 @@
1453 1453 <object class="NSButton" id="958933378">
1454 1454 <reference key="NSNextResponder" ref="439893737"/>
1455 1455 <int key="NSvFlags">268</int>
1456   - <string key="NSFrame">{{18, 24}, {63, 18}}</string>
  1456 + <string key="NSFrame">{{18, 22}, {63, 18}}</string>
1457 1457 <reference key="NSSuperview" ref="439893737"/>
1458 1458 <bool key="NSEnabled">YES</bool>
1459 1459 <object class="NSButtonCell" key="NSCell" id="66433356">
@@ -1480,7 +1480,7 @@
1480 1480 <object class="NSButton" id="870420167">
1481 1481 <reference key="NSNextResponder" ref="439893737"/>
1482 1482 <int key="NSvFlags">268</int>
1483   - <string key="NSFrame">{{85, 22}, {63, 21}}</string>
  1483 + <string key="NSFrame">{{85, 20}, {63, 21}}</string>
1484 1484 <reference key="NSSuperview" ref="439893737"/>
1485 1485 <bool key="NSEnabled">YES</bool>
1486 1486 <object class="NSButtonCell" key="NSCell" id="743888015">
@@ -1502,7 +1502,7 @@
1502 1502 <object class="NSButton" id="681124873">
1503 1503 <reference key="NSNextResponder" ref="439893737"/>
1504 1504 <int key="NSvFlags">268</int>
1505   - <string key="NSFrame">{{280, 12}, {96, 32}}</string>
  1505 + <string key="NSFrame">{{280, 10}, {96, 32}}</string>
1506 1506 <reference key="NSSuperview" ref="439893737"/>
1507 1507 <bool key="NSEnabled">YES</bool>
1508 1508 <object class="NSButtonCell" key="NSCell" id="472044255">
@@ -1522,7 +1522,7 @@
1522 1522 <object class="NSTextField" id="675676681">
1523 1523 <reference key="NSNextResponder" ref="439893737"/>
1524 1524 <int key="NSvFlags">268</int>
1525   - <string key="NSFrame">{{331, 112}, {42, 17}}</string>
  1525 + <string key="NSFrame">{{331, 110}, {42, 17}}</string>
1526 1526 <reference key="NSSuperview" ref="439893737"/>
1527 1527 <bool key="NSEnabled">YES</bool>
1528 1528 <object class="NSTextFieldCell" key="NSCell" id="413695150">
@@ -1551,7 +1551,7 @@
1551 1551 <object class="NSTextField" id="595139084">
1552 1552 <reference key="NSNextResponder" ref="439893737"/>
1553 1553 <int key="NSvFlags">268</int>
1554   - <string key="NSFrame">{{319, 81}, {54, 17}}</string>
  1554 + <string key="NSFrame">{{319, 79}, {54, 17}}</string>
1555 1555 <reference key="NSSuperview" ref="439893737"/>
1556 1556 <bool key="NSEnabled">YES</bool>
1557 1557 <object class="NSTextFieldCell" key="NSCell" id="1024476752">
@@ -1567,7 +1567,7 @@
1567 1567 <object class="NSTextField" id="870353754">
1568 1568 <reference key="NSNextResponder" ref="439893737"/>
1569 1569 <int key="NSvFlags">268</int>
1570   - <string key="NSFrame">{{317, 50}, {56, 17}}</string>
  1570 + <string key="NSFrame">{{317, 48}, {56, 17}}</string>
1571 1571 <reference key="NSSuperview" ref="439893737"/>
1572 1572 <bool key="NSEnabled">YES</bool>
1573 1573 <object class="NSTextFieldCell" key="NSCell" id="104933290">
@@ -1583,7 +1583,7 @@
1583 1583 <object class="NSTextField" id="179330361">
1584 1584 <reference key="NSNextResponder" ref="439893737"/>
1585 1585 <int key="NSvFlags">268</int>
1586   - <string key="NSFrame">{{20, 112}, {59, 22}}</string>
  1586 + <string key="NSFrame">{{20, 110}, {59, 22}}</string>
1587 1587 <reference key="NSSuperview" ref="439893737"/>
1588 1588 <bool key="NSEnabled">YES</bool>
1589 1589 <object class="NSTextFieldCell" key="NSCell" id="298884706">
@@ -1671,7 +1671,7 @@
1671 1671 <object class="NSSlider" id="27787277">
1672 1672 <reference key="NSNextResponder" ref="439893737"/>
1673 1673 <int key="NSvFlags">268</int>
1674   - <string key="NSFrame">{{85, 76}, {222, 26}}</string>
  1674 + <string key="NSFrame">{{85, 74}, {222, 26}}</string>
1675 1675 <reference key="NSSuperview" ref="439893737"/>
1676 1676 <bool key="NSEnabled">YES</bool>
1677 1677 <object class="NSSliderCell" key="NSCell" id="385883230">
@@ -1692,7 +1692,7 @@
1692 1692 <object class="NSTextField" id="360985453">
1693 1693 <reference key="NSNextResponder" ref="439893737"/>
1694 1694 <int key="NSvFlags">268</int>
1695   - <string key="NSFrame">{{20, 80}, {59, 22}}</string>
  1695 + <string key="NSFrame">{{20, 78}, {59, 22}}</string>
1696 1696 <reference key="NSSuperview" ref="439893737"/>
1697 1697 <bool key="NSEnabled">YES</bool>
1698 1698 <object class="NSTextFieldCell" key="NSCell" id="616643724">
@@ -1763,7 +1763,7 @@
1763 1763 <object class="NSSlider" id="274236751">
1764 1764 <reference key="NSNextResponder" ref="439893737"/>
1765 1765 <int key="NSvFlags">268</int>
1766   - <string key="NSFrame">{{85, 44}, {222, 26}}</string>
  1766 + <string key="NSFrame">{{85, 42}, {222, 26}}</string>
1767 1767 <reference key="NSSuperview" ref="439893737"/>
1768 1768 <bool key="NSEnabled">YES</bool>
1769 1769 <object class="NSSliderCell" key="NSCell" id="1061558912">
@@ -1784,7 +1784,7 @@
1784 1784 <object class="NSTextField" id="770318914">
1785 1785 <reference key="NSNextResponder" ref="439893737"/>
1786 1786 <int key="NSvFlags">268</int>
1787   - <string key="NSFrame">{{20, 48}, {59, 22}}</string>
  1787 + <string key="NSFrame">{{20, 46}, {59, 22}}</string>
1788 1788 <reference key="NSSuperview" ref="439893737"/>
1789 1789 <bool key="NSEnabled">YES</bool>
1790 1790 <object class="NSTextFieldCell" key="NSCell" id="435965452">
@@ -1880,7 +1880,7 @@
1880 1880 <string>public.url-name</string>
1881 1881 </object>
1882 1882 </object>
1883   - <string key="NSFrame">{{378, 0}, {318, 222}}</string>
  1883 + <string key="NSFrame">{{378, -2}, {318, 222}}</string>
1884 1884 <reference key="NSSuperview" ref="439893737"/>
1885 1885 <reference key="NSNextKeyView"/>
1886 1886 <string key="FrameName"/>
@@ -1909,7 +1909,7 @@
1909 1909 <object class="NSButton" id="327618939">
1910 1910 <reference key="NSNextResponder" ref="439893737"/>
1911 1911 <int key="NSvFlags">268</int>
1912   - <string key="NSFrame">{{184, 12}, {96, 32}}</string>
  1912 + <string key="NSFrame">{{184, 10}, {96, 32}}</string>
1913 1913 <reference key="NSSuperview" ref="439893737"/>
1914 1914 <bool key="NSEnabled">YES</bool>
1915 1915 <object class="NSButtonCell" key="NSCell" id="515557055">
@@ -1926,8 +1926,17 @@
1926 1926 <int key="NSPeriodicInterval">25</int>
1927 1927 </object>
1928 1928 </object>
  1929 + <object class="NSProgressIndicator" id="1009788281">
  1930 + <reference key="NSNextResponder" ref="439893737"/>
  1931 + <int key="NSvFlags">1292</int>
  1932 + <object class="NSPSMatrix" key="NSDrawMatrix"/>
  1933 + <string key="NSFrame">{{166, 20}, {16, 16}}</string>
  1934 + <reference key="NSSuperview" ref="439893737"/>
  1935 + <int key="NSpiFlags">20746</int>
  1936 + <double key="NSMaxValue">100</double>
  1937 + </object>
1929 1938 </object>
1930   - <string key="NSFrameSize">{696, 222}</string>
  1939 + <string key="NSFrameSize">{696, 220}</string>
1931 1940 <reference key="NSSuperview"/>
1932 1941 </object>
1933 1942 <string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
@@ -2770,6 +2779,46 @@
2770 2779 </object>
2771 2780 <int key="connectionID">601</int>
2772 2781 </object>
  2782 + <object class="IBConnectionRecord">
  2783 + <object class="IBOutletConnection" key="connection">
  2784 + <string key="label">writeXMPBox</string>
  2785 + <reference key="source" ref="298288047"/>
  2786 + <reference key="destination" ref="958933378"/>
  2787 + </object>
  2788 + <int key="connectionID">605</int>
  2789 + </object>
  2790 + <object class="IBConnectionRecord">
  2791 + <object class="IBOutletConnection" key="connection">
  2792 + <string key="label">writeEXIFBox</string>
  2793 + <reference key="source" ref="298288047"/>
  2794 + <reference key="destination" ref="870420167"/>
  2795 + </object>
  2796 + <int key="connectionID">606</int>
  2797 + </object>
  2798 + <object class="IBConnectionRecord">
  2799 + <object class="IBActionConnection" key="connection">
  2800 + <string key="label">selectGPX:</string>
  2801 + <reference key="source" ref="298288047"/>
  2802 + <reference key="destination" ref="347262794"/>
  2803 + </object>
  2804 + <int key="connectionID">607</int>
  2805 + </object>
  2806 + <object class="IBConnectionRecord">
  2807 + <object class="IBActionConnection" key="connection">
  2808 + <string key="label">selectImages:</string>
  2809 + <reference key="source" ref="298288047"/>
  2810 + <reference key="destination" ref="280589736"/>
  2811 + </object>
  2812 + <int key="connectionID">608</int>
  2813 + </object>
  2814 + <object class="IBConnectionRecord">
  2815 + <object class="IBOutletConnection" key="connection">
  2816 + <string key="label">progressIndication</string>
  2817 + <reference key="source" ref="298288047"/>
  2818 + <reference key="destination" ref="1009788281"/>
  2819 + </object>
  2820 + <int key="connectionID">611</int>
  2821 + </object>
2773 2822 </object>
2774 2823 <object class="IBMutableOrderedSet" key="objectRecords">
2775 2824 <object class="NSArray" key="orderedObjects">
@@ -3327,7 +3376,6 @@
3327 3376 <bool key="EncodedWithXMLCoder">YES</bool>
3328 3377 <reference ref="104229112"/>
3329 3378 <reference ref="647270672"/>
3330   - <reference ref="347262794"/>
3331 3379 <reference ref="280589736"/>
3332 3380 <reference ref="179330361"/>
3333 3381 <reference ref="360985453"/>
@@ -3343,6 +3391,8 @@
3343 3391 <reference ref="327618939"/>
3344 3392 <reference ref="747056636"/>
3345 3393 <reference ref="681124873"/>
  3394 + <reference ref="347262794"/>
  3395 + <reference ref="1009788281"/>
3346 3396 </object>
3347 3397 <reference key="parent" ref="972006081"/>
3348 3398 </object>
@@ -4107,6 +4157,11 @@
4107 4157 <reference key="object" ref="515557055"/>
4108 4158 <reference key="parent" ref="327618939"/>
4109 4159 </object>
  4160 + <object class="IBObjectRecord">
  4161 + <int key="objectID">610</int>
  4162 + <reference key="object" ref="1009788281"/>
  4163 + <reference key="parent" ref="439893737"/>
  4164 + </object>
4110 4165 </object>
4111 4166 </object>
4112 4167 <object class="NSMutableDictionary" key="flattenedProperties">
@@ -4404,6 +4459,8 @@
4404 4459 <string>602.IBPluginDependency</string>
4405 4460 <string>602.IBViewBoundsToFrameTransform</string>
4406 4461 <string>603.IBPluginDependency</string>
  4462 + <string>610.IBPluginDependency</string>
  4463 + <string>610.IBViewBoundsToFrameTransform</string>
4407 4464 <string>72.IBPluginDependency</string>
4408 4465 <string>72.ImportedFromIB2</string>
4409 4466 <string>73.IBPluginDependency</string>
@@ -4537,7 +4594,7 @@
4537 4594 <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
4538 4595 <integer value="1"/>
4539 4596 <string>{{525, 802}, {197, 73}}</string>
4540   - <string>{{658, 836}, {448, 20}}</string>
  4597 + <string>{{504, 736}, {448, 20}}</string>
4541 4598 <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
4542 4599 <integer value="1"/>
4543 4600 <string>{74, 862}</string>
@@ -4562,9 +4619,9 @@
4562 4619 <integer value="1"/>
4563 4620 <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
4564 4621 <integer value="1"/>
4565   - <string>{{312, 634}, {696, 222}}</string>
  4622 + <string>{{348, 453}, {696, 220}}</string>
4566 4623 <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
4567   - <string>{{312, 634}, {696, 222}}</string>
  4624 + <string>{{348, 453}, {696, 220}}</string>
4568 4625 <integer value="1"/>
4569 4626 <string>{{33, 99}, {480, 360}}</string>
4570 4627 <string>{3.40282e+38, 3.40282e+38}</string>
@@ -4661,7 +4718,7 @@
4661 4718 <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
4662 4719 <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
4663 4720 <object class="NSAffineTransform">
4664   - <bytes key="NSTransformStruct">P4AAAL+AAABDRQAAw6OAAA</bytes>
  4721 + <bytes key="NSTransformStruct">P4AAAL+AAABDfQAAw0wAAA</bytes>
4665 4722 </object>
4666 4723 <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
4667 4724 <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -4761,6 +4818,10 @@
4761 4818 </object>
4762 4819 <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
4763 4820 <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
  4821 + <object class="NSAffineTransform">
  4822 + <bytes key="NSTransformStruct">P4AAAL+AAABDGgAAwjgAAA</bytes>
  4823 + </object>
  4824 + <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
4764 4825 <integer value="1"/>
4765 4826 <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
4766 4827 <integer value="1"/>
@@ -4804,7 +4865,7 @@
4804 4865 </object>
4805 4866 </object>
4806 4867 <nil key="sourceID"/>
4807   - <int key="maxID">604</int>
  4868 + <int key="maxID">611</int>
4808 4869 </object>
4809 4870 <object class="IBClassDescriber" key="IBDocument.Classes">
4810 4871 <object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -4813,14 +4874,42 @@
4813 4874 <string key="className">GPXController</string>
4814 4875 <string key="superclassName">NSObject</string>
4815 4876 <object class="NSMutableDictionary" key="actions">
4816   - <string key="NS.key.0">process:</string>
4817   - <string key="NS.object.0">id</string>
  4877 + <bool key="EncodedWithXMLCoder">YES</bool>
  4878 + <object class="NSArray" key="dict.sortedKeys">
  4879 + <bool key="EncodedWithXMLCoder">YES</bool>
  4880 + <string>process:</string>
  4881 + <string>selectGPX:</string>
  4882 + <string>selectImages:</string>
  4883 + </object>
  4884 + <object class="NSMutableArray" key="dict.values">
  4885 + <bool key="EncodedWithXMLCoder">YES</bool>
  4886 + <string>id</string>
  4887 + <string>id</string>
  4888 + <string>id</string>
  4889 + </object>
4818 4890 </object>
4819 4891 <object class="NSMutableDictionary" key="actionInfosByName">
4820   - <string key="NS.key.0">process:</string>
4821   - <object class="IBActionInfo" key="NS.object.0">
4822   - <string key="name">process:</string>
4823   - <string key="candidateClassName">id</string>
  4892 + <bool key="EncodedWithXMLCoder">YES</bool>
  4893 + <object class="NSArray" key="dict.sortedKeys">
  4894 + <bool key="EncodedWithXMLCoder">YES</bool>
  4895 + <string>process:</string>
  4896 + <string>selectGPX:</string>
  4897 + <string>selectImages:</string>
  4898 + </object>
  4899 + <object class="NSMutableArray" key="dict.values">
  4900 + <bool key="EncodedWithXMLCoder">YES</bool>
  4901 + <object class="IBActionInfo">
  4902 + <string key="name">process:</string>
  4903 + <string key="candidateClassName">id</string>
  4904 + </object>
  4905 + <object class="IBActionInfo">
  4906 + <string key="name">selectGPX:</string>
  4907 + <string key="candidateClassName">id</string>
  4908 + </object>
  4909 + <object class="IBActionInfo">
  4910 + <string key="name">selectImages:</string>
  4911 + <string key="candidateClassName">id</string>
  4912 + </object>
4824 4913 </object>
4825 4914 </object>
4826 4915 <object class="NSMutableDictionary" key="outlets">
@@ -4832,8 +4921,11 @@
4832 4921 <string>imagesField</string>
4833 4922 <string>minuteField</string>
4834 4923 <string>processButton</string>
  4924 + <string>progressIndication</string>
4835 4925 <string>secondField</string>
4836 4926 <string>webView</string>
  4927 + <string>writeEXIFBox</string>
  4928 + <string>writeXMPBox</string>
4837 4929 </object>
4838 4930 <object class="NSMutableArray" key="dict.values">
4839 4931 <bool key="EncodedWithXMLCoder">YES</bool>
@@ -4842,8 +4934,11 @@
4842 4934 <string>NSTextField</string>
4843 4935 <string>NSTextField</string>
4844 4936 <string>NSButton</string>
  4937 + <string>NSProgressIndicator</string>
4845 4938 <string>NSTextField</string>
4846 4939 <string>WebView</string>
  4940 + <string>NSButton</string>
  4941 + <string>NSButton</string>
4847 4942 </object>
4848 4943 </object>
4849 4944 <object class="NSMutableDictionary" key="toOneOutletInfosByName">
@@ -4855,8 +4950,11 @@
4855 4950 <string>imagesField</string>
4856 4951 <string>minuteField</string>
4857 4952 <string>processButton</string>
  4953 + <string>progressIndication</string>
4858 4954 <string>secondField</string>
4859 4955 <string>webView</string>
  4956 + <string>writeEXIFBox</string>
  4957 + <string>writeXMPBox</string>
4860 4958 </object>
4861 4959 <object class="NSMutableArray" key="dict.values">
4862 4960 <bool key="EncodedWithXMLCoder">YES</bool>
@@ -4881,6 +4979,10 @@
4881 4979 <string key="candidateClassName">NSButton</string>
4882 4980 </object>
4883 4981 <object class="IBToOneOutletInfo">
  4982 + <string key="name">progressIndication</string>
  4983 + <string key="candidateClassName">NSProgressIndicator</string>
  4984 + </object>
  4985 + <object class="IBToOneOutletInfo">
4884 4986 <string key="name">secondField</string>
4885 4987 <string key="candidateClassName">NSTextField</string>
4886 4988 </object>
@@ -4888,6 +4990,14 @@
4888 4990 <string key="name">webView</string>
4889 4991 <string key="candidateClassName">WebView</string>
4890 4992 </object>
  4993 + <object class="IBToOneOutletInfo">
  4994 + <string key="name">writeEXIFBox</string>
  4995 + <string key="candidateClassName">NSButton</string>
  4996 + </object>
  4997 + <object class="IBToOneOutletInfo">
  4998 + <string key="name">writeXMPBox</string>
  4999 + <string key="candidateClassName">NSButton</string>
  5000 + </object>
4891 5001 </object>
4892 5002 </object>
4893 5003 <object class="IBClassDescriptionSource" key="sourceIdentifier">
@@ -5505,6 +5615,14 @@
5505 5615 </object>
5506 5616 </object>
5507 5617 <object class="IBPartialClassDescription">
  5618 + <string key="className">NSProgressIndicator</string>
  5619 + <string key="superclassName">NSView</string>
  5620 + <object class="IBClassDescriptionSource" key="sourceIdentifier">
  5621 + <string key="majorKey">IBFrameworkSource</string>
  5622 + <string key="minorKey">AppKit.framework/Headers/NSProgressIndicator.h</string>
  5623 + </object>
  5624 + </object>
  5625 + <object class="IBPartialClassDescription">
5508 5626 <string key="className">NSResponder</string>
5509 5627 <object class="IBClassDescriptionSource" key="sourceIdentifier">
5510 5628 <string key="majorKey">IBFrameworkSource</string>
28 GPX Tagger.xcodeproj/project.pbxproj
@@ -12,6 +12,11 @@
12 12 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
13 13 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
14 14 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
  15 + 9E09B3F613BB9B400005E0DD /* geotag.py in Resources */ = {isa = PBXBuildFile; fileRef = 9E09B3F513BB9B400005E0DD /* geotag.py */; };
  16 + 9E09B40213BB9B730005E0DD /* EXIF.py in Resources */ = {isa = PBXBuildFile; fileRef = 9E09B3FE13BB9B730005E0DD /* EXIF.py */; };
  17 + 9E09B40313BB9B730005E0DD /* GoogleMaps.py in Resources */ = {isa = PBXBuildFile; fileRef = 9E09B3FF13BB9B730005E0DD /* GoogleMaps.py */; };
  18 + 9E09B40413BB9B730005E0DD /* gps.py in Resources */ = {isa = PBXBuildFile; fileRef = 9E09B40013BB9B730005E0DD /* gps.py */; };
  19 + 9E09B40513BB9B730005E0DD /* iso8601.py in Resources */ = {isa = PBXBuildFile; fileRef = 9E09B40113BB9B730005E0DD /* iso8601.py */; };
15 20 9E7E94BE13BABE00001D350C /* GPXController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E7E94BD13BABE00001D350C /* GPXController.m */; };
16 21 9E999F2A13BAE2D600D80015 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9E999F2913BAE2D600D80015 /* WebKit.framework */; };
17 22 /* End PBXBuildFile section */
@@ -29,6 +34,11 @@
29 34 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
30 35 8D1107310486CEB800E47090 /* GPX_Tagger-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GPX_Tagger-Info.plist"; sourceTree = "<group>"; };
31 36 8D1107320486CEB800E47090 /* GPX Tagger.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "GPX Tagger.app"; sourceTree = BUILT_PRODUCTS_DIR; };
  37 + 9E09B3F513BB9B400005E0DD /* geotag.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = geotag.py; sourceTree = "<group>"; };
  38 + 9E09B3FE13BB9B730005E0DD /* EXIF.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = EXIF.py; sourceTree = "<group>"; };
  39 + 9E09B3FF13BB9B730005E0DD /* GoogleMaps.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = GoogleMaps.py; sourceTree = "<group>"; };
  40 + 9E09B40013BB9B730005E0DD /* gps.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = gps.py; sourceTree = "<group>"; };
  41 + 9E09B40113BB9B730005E0DD /* iso8601.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = iso8601.py; sourceTree = "<group>"; };
32 42 9E7E94BC13BABE00001D350C /* GPXController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPXController.h; sourceTree = "<group>"; };
33 43 9E7E94BD13BABE00001D350C /* GPXController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPXController.m; sourceTree = "<group>"; };
34 44 9E999F2913BAE2D600D80015 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
@@ -85,6 +95,7 @@
85 95 29B97314FDCFA39411CA2CEA /* GPX Tagger */ = {
86 96 isa = PBXGroup;
87 97 children = (
  98 + 9E09B40613BB9B780005E0DD /* Python */,
88 99 080E96DDFE201D6D7F000001 /* Classes */,
89 100 29B97315FDCFA39411CA2CEA /* Other Sources */,
90 101 29B97317FDCFA39411CA2CEA /* Resources */,
@@ -125,6 +136,18 @@
125 136 name = Frameworks;
126 137 sourceTree = "<group>";
127 138 };
  139 + 9E09B40613BB9B780005E0DD /* Python */ = {
  140 + isa = PBXGroup;
  141 + children = (
  142 + 9E09B3FE13BB9B730005E0DD /* EXIF.py */,
  143 + 9E09B3FF13BB9B730005E0DD /* GoogleMaps.py */,
  144 + 9E09B40013BB9B730005E0DD /* gps.py */,
  145 + 9E09B40113BB9B730005E0DD /* iso8601.py */,
  146 + 9E09B3F513BB9B400005E0DD /* geotag.py */,
  147 + );
  148 + name = Python;
  149 + sourceTree = "<group>";
  150 + };
128 151 /* End PBXGroup section */
129 152
130 153 /* Begin PBXNativeTarget section */
@@ -177,6 +200,11 @@
177 200 files = (
178 201 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
179 202 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */,
  203 + 9E09B3F613BB9B400005E0DD /* geotag.py in Resources */,
  204 + 9E09B40213BB9B730005E0DD /* EXIF.py in Resources */,
  205 + 9E09B40313BB9B730005E0DD /* GoogleMaps.py in Resources */,
  206 + 9E09B40413BB9B730005E0DD /* gps.py in Resources */,
  207 + 9E09B40513BB9B730005E0DD /* iso8601.py in Resources */,
180 208 );
181 209 runOnlyForDeploymentPostprocessing = 0;
182 210 };
5 GPXController.h
@@ -17,7 +17,12 @@
17 17 IBOutlet NSTextField *secondField;
18 18 IBOutlet NSButton *processButton;
19 19 IBOutlet WebView *webView;
  20 + IBOutlet NSButton *writeXMPBox;
  21 + IBOutlet NSButton *writeEXIFBox;
  22 + IBOutlet NSProgressIndicator *progressIndication;
20 23 }
21 24 -(IBAction)process:(id)sender;
  25 +-(IBAction)selectGPX:(id)sender;
  26 +-(IBAction)selectImages:(id)sender;
22 27 NSTask *gpxgeotag;
23 28 @end
44 GPXController.m
@@ -12,23 +12,23 @@ @implementation GPXController
12 12 - (id)init {
13 13 self = [super init];
14 14 [[NSNotificationCenter defaultCenter] addObserver:self
15   - selector:@selector(finishedDownload:)
  15 + selector:@selector(finishedTagging:)
16 16 name:NSTaskDidTerminateNotification
17 17 object:nil];
18 18 gpxgeotag = nil; // This is a good time to initialize the pointer
19 19 return self;
20 20 }
21 21
22   -- (void)finishedDownload:(NSNotification *)aNotification {
  22 +- (void)finishedTagging:(NSNotification *)aNotification {
23 23 [processButton setTitle:@"Process"];
24 24 [processButton setEnabled:YES];
25 25 [gpxgeotag release]; // Don't forget to clean up memory
26 26 gpxgeotag = nil; // Just in case...
27 27 // And render the results
28   - //NSString *absolutePath = [shortPath stringByExpandingTildeInPath];
29   - // initFileURLWithPath
30 28 NSString *indexPath = @"~/Library/Application%20Support/GPX%20Tagger/index.html";
31 29 [[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[indexPath stringByExpandingTildeInPath]]]];
  30 + [progressIndication stopAnimation:self];
  31 + [progressIndication release];
32 32 }
33 33
34 34 - (IBAction)process:(id)sender {
@@ -36,14 +36,44 @@ - (IBAction)process:(id)sender {
36 36 [processButton setEnabled:NO];
37 37 gpxgeotag = [[NSTask alloc] init];
38 38 [gpxgeotag setLaunchPath:@"/usr/bin/python"];
39   - [gpxgeotag setArguments:[NSArray arrayWithObjects:@"../../geotag.py",
  39 + NSString *path = [[NSBundle mainBundle] pathForResource:@"geotag" ofType:@"py"];
  40 + NSMutableArray *args = [NSMutableArray arrayWithObjects:path,
40 41 @"--hours", [hourField stringValue],
41 42 @"--minutes", [minuteField stringValue],
42 43 @"--seconds", [secondField stringValue],
43 44 @"--gpx", [gpxField stringValue],
44 45 @"-i", [imagesField stringValue],
45   - @"--maps", @"~/Library/Application Support/GPX Tagger",
46   - nil]];
  46 + @"--maps", @"~/Library/Application Support/GPX Tagger", nil];
  47 + if (NSOnState == [writeXMPBox state]) {
  48 + [args addObject:@"-x"];
  49 + }
  50 + if (NSOnState == [writeEXIFBox state]) {
  51 + [args addObject:@"-e"];
  52 + }
  53 + [gpxgeotag setArguments:args];
  54 + progressIndication = [[NSProgressIndicator alloc] init];
  55 + [progressIndication setUsesThreadedAnimation:YES];
  56 + [progressIndication startAnimation:self];
47 57 [gpxgeotag launch];
48 58 }
  59 +
  60 +-(IBAction)selectGPX:(id)sender {
  61 + NSOpenPanel *op = [NSOpenPanel openPanel];
  62 + [op setCanChooseFiles:YES];
  63 + [op setCanChooseDirectories:NO];
  64 + if ([op runModal] == NSOKButton) {
  65 + NSString *filename = [op filename];
  66 + [gpxField setStringValue:filename];
  67 + }
  68 +}
  69 +
  70 +-(IBAction)selectImages:(id)sender {
  71 + NSOpenPanel *op = [NSOpenPanel openPanel];
  72 + [op setCanChooseFiles:NO];
  73 + [op setCanChooseDirectories:YES];
  74 + if ([op runModal] == NSOKButton) {
  75 + NSString *filename = [op filename];
  76 + [imagesField setStringValue:filename];
  77 + }
  78 +}
49 79 @end
26 GoogleMaps.py
@@ -7,8 +7,10 @@ class GoogleMaps(object):
7 7 exif_map = {'EXIF ISOSpeedRatings' : 'ISO', 'EXIF FocalLength' : 'Focal', 'EXIF ExposureTime' : 'Shutter', 'EXIF FocalLengthIn35mmFilm' : '35mm Focal', 'EXIF FNumber' : 'F-Stop', 'EXIF Flash' : 'Flash', 'EXIF ExposureBiasValue' : 'Exposure Bias', 'EXIF ExposureProgram' : 'Exposure Program', 'EXIF ExposureMode' : 'Exposure Mode'}
8 8 def __init__(self, map='~'):
9 9 self.root = os.path.expanduser(map) + '/'
10   - os.makedirs(self.root + 'images')
  10 + if not os.path.exists(self.root + 'images'):
  11 + os.makedirs(self.root + 'images')
11 12 self.markers = []
  13 + self.track = []
12 14 self.fd = open(self.root + 'index.html', 'w')
13 15
14 16 def write_prefix(self, lat, lon):
@@ -39,9 +41,26 @@ def write_prefix(self, lat, lon):
39 41 });
40 42 var contentStrings = {}
41 43 """ % (lat, lon))
  44 +
  45 + def add_track(self, x, y):
  46 + self.track.append((x,y))
  47 +
  48 + def write_track(self):
  49 + self.fd.write("""var meanderPathCoordinates = [""")
  50 + self.fd.write(',\n'.join(['new google.maps.LatLng(%f, %f)' % (lat, lon) for (lat,lon) in self.track]))
  51 + self.fd.write('];\n')
  52 +
42 53 def write_suffix(self):
43 54 # Write a canned suffix to cloe remainng tags and initialize the canvas
44   - self.fd.write("""}
  55 + self.fd.write("""
  56 + var meanderPath = new google.maps.Polyline({
  57 + path: meanderPathCoordinates,
  58 + strokeColor: "#000000",
  59 + strokeOpacity: 1.0,
  60 + strokeWeight: 2
  61 + });
  62 + meanderPath.setMap(map);
  63 + }
45 64 </script>
46 65 </head>
47 66 <body onload="initialize()">
@@ -96,4 +115,5 @@ def URL(self):
96 115 i += 1
97 116 self.write_prefix(sum(lats)/len(lats), sum(lons)/len(lons))
98 117 self.fd.write(base_url)
99   - self.write_suffix()
  118 + self.write_track()
  119 + self.write_suffix()
13 geotag.py
@@ -78,7 +78,7 @@ def nearest_time_sql(self, t):
78 78 Uses the Database to search for the nearest two points
79 79 """
80 80 if self.verbose:
81   - print 'SQL Time',t
  81 + sys.stderr.write('SQL Time %s' % t)
82 82 self.cursor.execute('SELECT * FROM tracklog WHERE dt <= ? ORDER BY dt DESC LIMIT 1', (t,))
83 83 d = self.cursor.fetchone()
84 84 if d != None:
@@ -96,7 +96,7 @@ def nearest_time_sql(self, t):
96 96 t1 = None
97 97 self.cursor.fetchall()
98 98 if self.verbose:
99   - print 'SQL Resuls',t0,t1
  99 + sys.stderr.write('SQL Resuls %s %s' % (t0,t1))
100 100 if t0 == None or t1 == None:
101 101 return None
102 102 return t0,t1
@@ -168,6 +168,11 @@ def image_time(self, path_name, timezone='GMT', delta_hours=0, delta_minutes=0,
168 168 self.files_read += 1
169 169 return cdt
170 170
  171 + def add_track(self, precision=5):
  172 + self.cursor.execute('SELECT lat, lon FROM tracklog ORDER BY dt')
  173 + for (x,y) in self.cursor:
  174 + self.GM.add_track(x, y)
  175 +
171 176 def correlate_timestamp(self, *args):
172 177 # if os.isatty(1):
173 178 # pbar = progressbar.ProgressBar(len(args), widgets=[progressbar.ETA(), ' ', progressbar.Percentage(), ' ', progressbar.Bar()]).start()
@@ -202,8 +207,6 @@ def correlate_timestamp(self, *args):
202 207 sys.stderr.write("Error Processing Last Command:\n\t%s\n" % cmd)
203 208 else:
204 209 self.files_tagged += 1
205   - # if os.isatty(1):
206   - # pbar.finish()
207 210
208 211
209 212 def main(*args, **options):
@@ -215,6 +218,7 @@ def main(*args, **options):
215 218 else:
216 219 gti.correlate_timestamp(*args)
217 220 sys.stdout.write('%d Timestamped Photos\n%d Successfully GeoTagged Photos\n' % (gti.files_read, gti.files_tagged))
  221 + gti.add_track()
218 222 gti.GM.URL()
219 223
220 224 if __name__ == '__main__':
@@ -232,6 +236,5 @@ def main(*args, **options):
232 236 parser.add_option('-v', '--verbose', dest='verbose', default=False, action='store_true', help='Verbose Output')
233 237 parser.add_option('--maps', dest='maps', default='/Users/imolloy/Desktop/html', help='Location to save GoogleMaps output')
234 238 (options, args) = parser.parse_args()
235   - print options.__dict__
236 239 main(*args, **options.__dict__)
237 240

0 comments on commit df6755b

Please sign in to comment.
Something went wrong with that request. Please try again.