diff -Nru pictag-12.07.9/data/ui/AboutPictagDialog.ui pictag-12.07.11/data/ui/AboutPictagDialog.ui --- pictag-12.07.9/data/ui/AboutPictagDialog.ui 2012-07-06 16:25:05.000000000 +0000 +++ pictag-12.07.11/data/ui/AboutPictagDialog.ui 2012-07-07 17:37:51.000000000 +0000 @@ -2,7 +2,7 @@ - https://launchpad.net/pictag12.07.9# Copyright (C) 2012 Thomas Bechtold <thomasbechtold@jpberlin.de> + https://launchpad.net/pictag12.07.11# Copyright (C) 2012 Thomas Bechtold <thomasbechtold@jpberlin.de> # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Free Software Foundation. diff -Nru pictag-12.07.9/data/ui/PictagWindow.ui pictag-12.07.11/data/ui/PictagWindow.ui --- pictag-12.07.9/data/ui/PictagWindow.ui 2012-07-06 16:13:32.000000000 +0000 +++ pictag-12.07.11/data/ui/PictagWindow.ui 2012-07-07 15:46:56.000000000 +0000 @@ -51,31 +51,6 @@ - - False - True - False - _Edit - True - - - True - False - - - gtk-preferences - False - True - False - True - True - - - - - - - False True diff -Nru pictag-12.07.9/debian/changelog pictag-12.07.11/debian/changelog --- pictag-12.07.9/debian/changelog 2012-07-06 16:25:07.000000000 +0000 +++ pictag-12.07.11/debian/changelog 2012-07-07 17:37:53.000000000 +0000 @@ -1,3 +1,23 @@ +pictag (12.07.11) quantal; urgency=low + + * New release. + + -- Thomas Bechtold Sat, 07 Jul 2012 19:37:53 +0200 + +pictag (12.07.10ubuntu1) UNRELEASED; urgency=low + + * * add TODO + * * fix help + * * fixes + + -- Thomas Bechtold Sat, 07 Jul 2012 19:37:15 +0200 + +pictag (12.07.10) quantal; urgency=low + + * * more tests + + -- Thomas Bechtold Sat, 07 Jul 2012 19:37:14 +0200 + pictag (12.07.9) quantal; urgency=low * New release. diff -Nru pictag-12.07.9/debian/control pictag-12.07.11/debian/control --- pictag-12.07.9/debian/control 2012-07-06 16:25:06.000000000 +0000 +++ pictag-12.07.11/debian/control 2012-07-07 17:37:52.000000000 +0000 @@ -13,6 +13,6 @@ Depends: ${misc:Depends}, ${python:Depends}, yelp -Description: UNKNOWN - UNKNOWN +Description: geotag your pictures + Simple Application to geotag your pictures diff -Nru pictag-12.07.9/debian/rules pictag-12.07.11/debian/rules --- pictag-12.07.9/debian/rules 2012-07-06 16:25:09.000000000 +0000 +++ pictag-12.07.11/debian/rules 2012-07-07 17:37:52.000000000 +0000 @@ -6,27 +6,4 @@ dh $@ --with python2 endif -override_dh_auto_install: - dh_auto_install -- --install-scripts=/opt/extras.ubuntu.com/pictag/bin --install-data=/opt/extras.ubuntu.com/pictag --install-lib=/opt/extras.ubuntu.com/pictag -override_dh_python2: - dh_python2 /opt/extras.ubuntu.com/pictag - - -override_dh_install: - dh_install - mkdir -p debian/pictag/opt/extras.ubuntu.com/pictag/bin - if [ -x debian/pictag/opt/extras.ubuntu.com/pictag/pictag/pictag ]; then mv debian/pictag/opt/extras.ubuntu.com/pictag/pictag/pictag debian/pictag/opt/extras.ubuntu.com/pictag/bin; fi - if [ -f debian/pictag/opt/extras.ubuntu.com/pictag/share/applications/pictag.desktop ]; then \ - mkdir -p debian/pictag/usr/share/applications; \ - mv debian/pictag/opt/extras.ubuntu.com/pictag/share/applications/pictag.desktop debian/pictag/usr/share/applications/extras-pictag.desktop; \ - rmdir --ignore-fail-on-non-empty debian/pictag/opt/extras.ubuntu.com/pictag/share/applications; \ - sed -i 's|Exec=.*|Exec=/opt/extras.ubuntu.com/pictag/bin/pictag|' debian/pictag/usr/share/applications/extras-pictag.desktop; \ - sed -i 's|Icon=/usr/|Icon=/opt/extras.ubuntu.com/pictag/|' debian/pictag/usr/share/applications/extras-pictag.desktop; \ - fi - grep -RlZ 'import gettext' debian/pictag/* | xargs -0 -r sed -i 's|\(import\) gettext$$|\1 locale|' - grep -RlZ 'from gettext import gettext as _' debian/pictag/* | xargs -0 -r sed -i 's|from gettext \(import gettext as _\)|from locale \1|' - grep -RlZ "gettext.textdomain('pictag')" debian/pictag/* | xargs -0 -r sed -i "s|gettext\(\.textdomain('pictag')\)|locale\.bindtextdomain('pictag', '/opt/extras.ubuntu.com/pictag/share/locale')\nlocale\1|" - sed -i "s|__pictag_data_directory__ =.*|__pictag_data_directory__ = '/opt/extras.ubuntu.com/pictag/share/pictag/'|" debian/pictag/opt/extras.ubuntu.com/pictag/pictag*/pictagconfig.py - sed -i 's| sys.path.insert(0, opt_path)|\0\n os.putenv("XDG_DATA_DIRS", "%s:%s" % ("/opt/extras.ubuntu.com/pictag/share/", os.getenv("XDG_DATA_DIRS", "")))|' debian/pictag/opt/extras.ubuntu.com/pictag/bin/pictag - if [ -d debian/pictag/opt/extras.ubuntu.com/pictag/share/glib-2.0/schemas ]; then glib-compile-schemas debian/pictag/opt/extras.ubuntu.com/pictag/share/glib-2.0/schemas; fi \ No newline at end of file diff -Nru pictag-12.07.9/help/C/basics.page pictag-12.07.11/help/C/basics.page --- pictag-12.07.9/help/C/basics.page 1970-01-01 00:00:00.000000000 +0000 +++ pictag-12.07.11/help/C/basics.page 2012-07-07 16:36:58.000000000 +0000 @@ -0,0 +1,40 @@ + + + + + + Thomas Bechtold + thomasbechtold@jpberlin.de + 2012 + + Basic usage of pictag + + + +Basics +
+ Quick guide +

Here is the quick guide to tag your pictures

+ +

select a folder with pictures. the list on the left side should contain all .png and .jpg pictures available in the selected folder.

+

select the pictures you want to set the position for.

+

click on the map where the pictures should be.

+

done. all pictures are now tagged.

+
+
+ +
+ Overview +

The pictag main window is divided in two parts. the left side shows a list with pictures from the selected folder. The right side shows a map with blue rectangles for every tagged picture.

+
+ pictag main window + The pictag main window to tag your pictures + +
+

To change the list with pictures on the left side, use the button called "select directory" on top of the list. After you selected a new directory, the list will be updated.

+

To set the latitude and longitude of one or more pictures, select the picture(s) in the list and click on the map on the right. All selected pictures have now the selected latitude and longitude set.

+

To check the current position of a picture, select one picture on the left side and check the values on the bottom left corner. There you can find a picture preview and also the date/time, latitude and longitude.

+
+
Binary files /tmp/iHWW2Dzeun/pictag-12.07.9/help/C/figures/icon.png and /tmp/G4ij1A0Jr_/pictag-12.07.11/help/C/figures/icon.png differ Binary files /tmp/iHWW2Dzeun/pictag-12.07.9/help/C/figures/pictag-overview.png and /tmp/G4ij1A0Jr_/pictag-12.07.11/help/C/figures/pictag-overview.png differ diff -Nru pictag-12.07.9/help/C/preferences.page pictag-12.07.11/help/C/preferences.page --- pictag-12.07.9/help/C/preferences.page 2012-07-02 15:23:00.000000000 +0000 +++ pictag-12.07.11/help/C/preferences.page 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ - - - - - - Your Name - Your E-mail - 2010 - - Optional short description of Preferences for contents page - - -Preferences -

This is the preferences page.

- -
diff -Nru pictag-12.07.9/help/C/topic1.page pictag-12.07.11/help/C/topic1.page --- pictag-12.07.9/help/C/topic1.page 2012-07-06 16:22:24.000000000 +0000 +++ pictag-12.07.11/help/C/topic1.page 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ - - - - - - Thomas Bechtold - thomasbechtold@jpberlin.de - 2012 - - Basic usage of pictag - - -Basics -

Here is the quick guide to tag your pictures

- -

select a folder with pictures. the list on the left side should contain all .png and .jpg pictures available in the selected folder.

-

select the pictures you want to set the position for.

-

click on the map where the pictures should be.

-

done.

-
- -
diff -Nru pictag-12.07.9/pictag/PictagImage.py pictag-12.07.11/pictag/PictagImage.py --- pictag-12.07.9/pictag/PictagImage.py 2012-07-06 16:25:05.000000000 +0000 +++ pictag-12.07.11/pictag/PictagImage.py 2012-07-07 17:37:51.000000000 +0000 @@ -67,7 +67,8 @@ color = Clutter.Color.new(0, 0, 255, 255) self.__marker = Champlain.CustomMarker() self.__marker.set_background_color(color) - self.__marker.set_size(10,10) + self.__marker.set_size(10, 10) + self.__marker.set_anchor_point_from_gravity(Clutter.Gravity.CENTER) self.__marker.set_location(self.__latitude, self.__longitude) self.__marker.connect("enter-event", self.__marker_enter) self.__marker.connect("leave-event", self.__marker_leave) @@ -76,21 +77,20 @@ def __marker_enter(self, marker, data): logger.debug("mouse enter '%s'" % (self.__path_full)) - box_layout = Clutter.BoxLayout() - box_layout.set_orientation(Clutter.Orientation.VERTICAL) - self.__marker.set_layout_manager(box_layout) text = Clutter.Text() - text.set_markup("%s" % (os.path.splitext(os.path.basename(self.__path_full))[0])) - - texture = Clutter.Texture.new_from_file(self.__path_full) - texture.set_keep_aspect_ratio(True) - if texture.get_width() > texture.get_height(): - texture.set_width(128) - else: - texture.set_height(128) - self.__marker.add_actor(texture) + text.set_markup("%s\n" \ + "%f N / %f E" \ + "" % (os.path.splitext(os.path.basename(self.__path_full))[0], + float(self.__latitude), float(self.__longitude))) self.__marker.add_actor(text) - #self.__marker.add_actor(self.__marker_box_layout) + #a big texture seems to crash mesa. see bug lp:1017243 + #texture = Clutter.Texture.new_from_file(self.__path_full) + #texture.set_keep_aspect_ratio(True) + #if texture.get_width() > texture.get_height(): + # texture.set_width(128) + #else: + # texture.set_height(128) + #self.__marker.add_actor(texture) self.__marker.show_all() @@ -137,11 +137,6 @@ """ date/time getter """ return self.__dt - @dt.setter - def dt(self, value): - """ date/time setter """ - self.__dt = value - def __dec_to_sex(self, x): degrees = int(math.floor(x)) minutes = int(math.floor(60 * (x - degrees))) @@ -158,13 +153,13 @@ def __metadata_datetime_get(self): """ get date/time metadata """ - key = 'Exif.Image.DateTime' + key = "Exif.Photo.DateTimeOriginal" try: - self.dt = self.__metadata[key].value.strftime('%d %B %Y, %H:%M:%S') + self.__dt = self.__metadata[key].value.strftime('%d %B %Y, %H:%M:%S') except KeyError: pass except Exception, e: - logger.warning("can not set date/time '%s' for image '%s': %s" % (self.__metadata[key].raw_value, self.path_full, str(e))) + logger.warning("can not get date/time '%s' for image '%s': %s" % (self.__metadata[key].raw_value, self.path_full, str(e))) def __metadata_latitude_set(self, latitude): diff -Nru pictag-12.07.9/pictag/PictagWindow.py pictag-12.07.11/pictag/PictagWindow.py --- pictag-12.07.9/pictag/PictagWindow.py 2012-07-06 16:25:05.000000000 +0000 +++ pictag-12.07.11/pictag/PictagWindow.py 2012-07-07 17:37:51.000000000 +0000 @@ -96,7 +96,7 @@ #center map on current position lat_cur, long_cur = self.get_current_location() - logger.debug("your current position is: %s N/%s W" % (lat_cur, long_cur)) + logger.debug("your current position is: %s °N/%s °E" % (lat_cur, long_cur)) self.view.center_on(float(lat_cur), float(long_cur)) #layer for image markers @@ -176,10 +176,15 @@ 'longitude': longitude or "-"})) self.image_preview.show() self.image_preview_label.show() - else: - #0 or multiple images selected. disable preview + elif len(pathlist) == 0: self.image_preview.hide() self.image_preview_label.hide() + else: + #multiple images selected. disable preview + self.image_preview.hide() + markup = _("%d pictures selected\n") % (len(pathlist)) + self.image_preview_label.set_markup(markup) + self.image_preview_label.show() def on_button_select_folder_clicked(self, widget): @@ -198,7 +203,9 @@ self.settings.set_string("image-path-latest", dialog.get_filename()) elif response == Gtk.ResponseType.CANCEL: pass - + #don't show any preview stuff + self.image_preview.hide() + self.image_preview_label.hide() dialog.destroy() @@ -245,10 +252,11 @@ pictag_image = model.get_value(tree_iter, 0) pictag_image.position_set(lat, lon) pictag_image.save() + + context_id = self.statusbar.get_context_id("metadata-written") + self.statusbar.push(context_id, _("%d image(s) saved" % (len(pathlist)))) - #center map on current position - #self.view.center_on(float(lat), float(lon)) - #remove old marker + #update the red position marker self.marker_layer_position.remove_all() marker = Champlain.Point() marker.set_size(20) @@ -268,7 +276,8 @@ x, y = event.x, event.y lon, lat = view.x_to_longitude(x), view.y_to_latitude(y) context_id = self.statusbar.get_context_id("mouse-pos") - self.statusbar.push(context_id, "long/lat: %.5f / %.5f" % (lon, lat)) + self.statusbar.push(context_id, _("%(latitude).5f °N / %(longitude).5f °E") % + {'latitude':lat, 'longitude':lon}) return True diff -Nru pictag-12.07.9/setup.py pictag-12.07.11/setup.py --- pictag-12.07.9/setup.py 2012-07-06 16:25:05.000000000 +0000 +++ pictag-12.07.11/setup.py 2012-07-07 17:37:51.000000000 +0000 @@ -87,13 +87,14 @@ DistUtilsExtra.auto.setup( name='pictag', - version='12.07.9', + version='12.07.11', license='GPL-3', author='Thomas Bechtold', author_email='thomasbechtold@jpberlin.de', - #description='UI for managing …', - #long_description='Here a longer description', + description='geotag your pictures', + long_description='Simple Application to geotag your pictures', url='https://launchpad.net/pictag', + test_suite = "tests", cmdclass={'install': InstallAndUpdateDataDirectory} ) Binary files /tmp/iHWW2Dzeun/pictag-12.07.9/tests/plain.png and /tmp/G4ij1A0Jr_/pictag-12.07.11/tests/plain.png differ diff -Nru pictag-12.07.9/tests/test_example.py pictag-12.07.11/tests/test_example.py --- pictag-12.07.9/tests/test_example.py 2012-07-06 16:25:05.000000000 +0000 +++ pictag-12.07.11/tests/test_example.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -#!/usr/bin/python -# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- -### BEGIN LICENSE -# Copyright (C) 2012 Thomas Bechtold -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 3, as published -# by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranties of -# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR -# PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -### END LICENSE - -import sys -import os.path -import unittest -sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), ".."))) - -import pyexiv2 -from pictag import PictagImage - -class TestPictagImage(unittest.TestCase): - def setUp(self): - self.metadata = dict() - - -if __name__ == '__main__': - unittest.main() diff -Nru pictag-12.07.9/tests/test_pictag.py pictag-12.07.11/tests/test_pictag.py --- pictag-12.07.9/tests/test_pictag.py 1970-01-01 00:00:00.000000000 +0000 +++ pictag-12.07.11/tests/test_pictag.py 2012-07-07 17:37:51.000000000 +0000 @@ -0,0 +1,86 @@ +#!/usr/bin/python +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- +### BEGIN LICENSE +# Copyright (C) 2012 Thomas Bechtold +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 3, as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranties of +# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +### END LICENSE + +import sys +import os.path +import unittest +sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), ".."))) + +import pyexiv2 +from pictag.PictagImage import PictagImage +import tempfile +import shutil + +#plain image without any tags +TEST_PLAIN = os.path.realpath(os.path.join(os.path.dirname(__file__), "plain.png")) +TEST_WITH_TAGS = os.path.realpath(os.path.join(os.path.dirname(__file__), "with-tags.jpg")) + +class TestPictagImage(unittest.TestCase): + def setUp(self): + self.tmpdir = tempfile.mkdtemp(prefix='pictag_tests_') + + def tearDown(self): + shutil.rmtree(self.tmpdir) + + def test_image_plain(self): + """ read image without tags """ + img = PictagImage(TEST_PLAIN) + self.assertEqual(img.path_full, TEST_PLAIN) + #no lat/lon/dt set on the image + lat, lon = img.position_get() + self.assertEqual(lat, None) + self.assertEqual(lon, None) + self.assertEqual(img.dt, None) + + def test_image_with_tags(self): + """ read image with tags """ + img = PictagImage(TEST_WITH_TAGS) + self.assertEqual(img.path_full, TEST_WITH_TAGS) + lat, lon = img.position_get() + self.assertEqual(lat, 52.918533333333336) + self.assertEqual(lon, 10.900019444444444) + self.assertEqual(img.dt, "28 April 2012, 15:25:39") + + def test_image_write_tags(self): + """ write tags to an image """ + shutil.copy(TEST_PLAIN, self.tmpdir) + img = PictagImage(os.path.join(self.tmpdir, os.path.basename(TEST_PLAIN))) + #no lat/lon/dt set on the image + lat, lon = img.position_get() + self.assertEqual(lat, None) + self.assertEqual(lon, None) + #change data (but still not written to file) + img.position_set(10.0, 20.0) + lat, lon = img.position_get() + self.assertEqual(lat, 10) + self.assertEqual(lon, 20) + #open a new pictag with the same file. data is not written to file so tags should be unavailable + img2 = PictagImage(os.path.join(self.tmpdir, os.path.basename(TEST_PLAIN))) + lat, lon = img2.position_get() + self.assertEqual(lat, None) + self.assertEqual(lon, None) + #write data of img + img.save() + #load file again. data should be written now + img3 = PictagImage(os.path.join(self.tmpdir, os.path.basename(TEST_PLAIN))) + lat, lon = img3.position_get() + self.assertEqual(lat, 10) + self.assertEqual(lon, 20) + + +if __name__ == '__main__': + unittest.main() Binary files /tmp/iHWW2Dzeun/pictag-12.07.9/tests/with-tags.jpg and /tmp/G4ij1A0Jr_/pictag-12.07.11/tests/with-tags.jpg differ diff -Nru pictag-12.07.9/TODO pictag-12.07.11/TODO --- pictag-12.07.9/TODO 1970-01-01 00:00:00.000000000 +0000 +++ pictag-12.07.11/TODO 2012-07-07 16:42:59.000000000 +0000 @@ -0,0 +1,13 @@ +TODO list: + +- show a picture preview on mouse-hover (blocked by lp:1017243) +- if multiple pictures have the same location, show a list with + picture names on mouse hover +- add a screencast to show the tagging process +- more tests +- add a "go to" menu entry to go to a specific position +- add a menu entry to go to selected image +- add a path-layer to show a path of the listed pictures ordered by + date/time. then you have a map with the way of your travel route. +- be able to order the picture list by date/time, by name, by long/lat +- be able to delete a geotag from a picture \ No newline at end of file