diff options
Diffstat (limited to 'sci-geosciences/happycamel')
7 files changed, 630 insertions, 0 deletions
diff --git a/sci-geosciences/happycamel/Manifest b/sci-geosciences/happycamel/Manifest new file mode 100644 index 0000000..1ecf6b9 --- /dev/null +++ b/sci-geosciences/happycamel/Manifest @@ -0,0 +1,7 @@ +AUX HappyCamel-optional-correlate.diff 2370 SHA256 f7eb91c7a0c529a0a5863a828cd90a31797fe2db08be7672921a5d513ee8e635 SHA512 4b75c63dc5ad42c6033558a5c03edafef2b571b4c83318845198eec645e7101b78a7e3d2c35b0f986d06e6fd2022c1bcd80f3629ff649ababa893890060c2938 WHIRLPOOL 2c985a9b66073ba5a67030e9da32485a8f2579603050d5be1c09f11316051ca0733308d378f7957731a2d3bcd082a76630fefb166b2737b2a909d62f9779af3b +AUX happycamel-ds-icons.patch 8246 SHA256 30976484d57a7de8407873e05d22f7e63d99c70eafde316e214ab7eaedfbb9f6 SHA512 07672aa47e87fdc200f0fda7788743046831ec3a901ff3db8f7cba14730fe176833664c0ffdd6211fcb8edcf819fa3ac164ed937637dc13c1033a144a1d7b943 WHIRLPOOL d57e83acee720c0fdb993134aca13eecca5b7fd975c56fac5a39adef5abd549b90330c46e2361b657cdb754af3db91466d0b8b438f92c8c24c3b9ddab40665c9 +AUX happycamel-v1-beta3-ds-features.patch 16869 SHA256 ce307ef6de9815a94139d25a7e257d7284bc37a41b2ca47300b53b3190ab78c1 SHA512 f619d3dd8d91635d658907558ae50c0568826915ce46cf862ae845af94c1ee7506d4589ce28e67b50ef4bb4f7682aa1d5116ce5408de1033c02d5a19d55f8fb2 WHIRLPOOL 25eff5a51fce97ca0a44993ee71aadb253611c14b4b613dbf68df69c6de82e188fcc569c0e1797d1ce1286ddbc0c947cd348aa4d71bdc4d5f18317e8d3108ca4 +DIST happycamel-v1-beta3.tar.gz 89936 SHA256 305daa114c9707f9cb1993dc07aa9b54c9cabebfb83acf3fe5eccd3281bebb13 SHA512 a72dc03de8f3261b66a35df8a3f49cd890411781f5be143f8ed2b226a258e320945765804e75adc3966de8bb88aecef68d3eb68f7ad7fed112d4fadcb865e09a WHIRLPOOL cc95fed8bbca5e89c75a0ee484a53182f1d0d16fbe67509e1a3059ca2e3982d08b76af8c59d5bbde6a99a63288aaea8b9fbe9115685f97bea21ecff6c682ce4c +EBUILD happycamel-1_beta3-r1.ebuild 896 SHA256 0cc4e276ad3ff173ff13f948929adc8a6e698ae52bf0f39ac5f0420cef24ec76 SHA512 2e062d0243d1f509b92f9a19ccb0d49303f4641d49090c1b2d23c9b726a44b27ea4722bda36b9c05d24c42cfb557ab221f2991c34d9b02f9842bd748a5f4a50d WHIRLPOOL bae76b738f34fee79c2121133abe28a294f86f76520eff552617f92f96a20a46e9f532a31bff00d343cad24b6614c78e05e437c8d6006da482792967d317ea46 +EBUILD happycamel-1_beta3-r2.ebuild 900 SHA256 7516322bc1d99c255b48cbe8d2e94817a8b75f595e1b24f48f63fe346a5ed207 SHA512 754b4c57a22dccbd8c71fcacee89f04165ef87ea87b2feefe034c31ed9b83747271595ff13a702a9c8c793480e72fae1b92d5eda7d5f385ad4ab7f5d6831e8e1 WHIRLPOOL 1126b6ddb863c33a1f33c797c63344ea0f864ca5b7df99a870c8b68dea99839d39f40ecf6268e84e8624dd60375e53c42c4aef19222a62ec8fc7f11730e780cb +EBUILD happycamel-1_beta3-r3.ebuild 895 SHA256 32fd0dff0610b22a835d07c052a8ddd2e5a1281a5815de335d06c05fc5041662 SHA512 bd6d298e11fe813d9d39c994e893bafde3801a75a0ebbc2d07e8be79ee6e86a7b30525fd4c81b2c837094118fdee46acbbeb14c3597b0beff58a3c6d7972b4b8 WHIRLPOOL fba5fc10bdcbdfb7f15f075881dd04abb5015455121e464c3d22a141c3fe2c5397ce3ab4d9ba341c99a5d37e6bd2b8ce0848e4273e6a08e4a101d579ca2c29bb diff --git a/sci-geosciences/happycamel/files/HappyCamel-optional-correlate.diff b/sci-geosciences/happycamel/files/HappyCamel-optional-correlate.diff new file mode 100644 index 0000000..0b57729 --- /dev/null +++ b/sci-geosciences/happycamel/files/HappyCamel-optional-correlate.diff @@ -0,0 +1,38 @@ +diff -dPNur HappyCamel.orig/cli.py HappyCamel/cli.py +--- HappyCamel.orig/cli.py 2010-01-29 09:23:25.000000000 +0100 ++++ HappyCamel/cli.py 2011-08-14 09:21:16.000000000 +0200 +@@ -188,6 +188,8 @@ + help = "The number of seconds the camera's time runs before the GPS device (note that photo's and tracklogs may or may not compensate for UTC and timezone. You may need to correct this manually. Also see -r.)") + parser.addOption("--fix-dates", var = "fix_dates", default = defaults["fix_dates"], + type = "bool", bool_action = True, help = "If the clock difference is known (via --calibrate or --clock-difference), shift the times in the image metadata to their proper value. Currently set to %default") ++ parser.addOption("--fix-locations", var = "fix_locations", default = defaults["fix_locations"], ++ type = "bool", bool_action = True, help = "Correlate GPS track with image timestamps to get geolocation information. Currently set to %default") + + # The options relating to interpolation + parser.addHelpRule("\nOptions relating to interpolation of the location:") +diff -dPNur HappyCamel.orig/config.py HappyCamel/config.py +--- HappyCamel.orig/config.py 2010-01-29 09:23:25.000000000 +0100 ++++ HappyCamel/config.py 2011-08-14 09:19:24.000000000 +0200 +@@ -56,7 +56,8 @@ + "flickr_user" : [str, "Flickr", "Default user", None], + + # The options regarding metadata writing +- "fix_dates": [bool, "Metadata writing", "Fix dates", False], ++ "fix_dates" : [bool, "Metadata writing", "Fix dates", False], ++ "fix_locations": [bool, "Metadata writing", "Fix locations", False], + + # The options regarding interpolation + "elevation_mode": [int, "Interpolation", "Elevation", 1], +diff -dPNur HappyCamel.orig/main.py HappyCamel/main.py +--- HappyCamel.orig/main.py 2010-01-29 09:23:25.000000000 +0100 ++++ HappyCamel/main.py 2011-08-14 09:23:51.000000000 +0200 +@@ -500,6 +500,9 @@ + """ Match the photo's in photo_list to the location sources in loc_sources, + clean up the photo list and return a list of unmatched photo's. """ + ++ if not self.conf.get("fix_locations"): ++ return [] ++ + # Do the matching + photo_list.matchTracks(loc_sources.getLocationSources(), elevation_mode, + max_deviation, use_outside) diff --git a/sci-geosciences/happycamel/files/happycamel-ds-icons.patch b/sci-geosciences/happycamel/files/happycamel-ds-icons.patch new file mode 100644 index 0000000..439f049 --- /dev/null +++ b/sci-geosciences/happycamel/files/happycamel-ds-icons.patch @@ -0,0 +1,167 @@ +diff -dPNur HappyCamel.current/cli.py HappyCamel/cli.py +--- HappyCamel.current/cli.py 2013-08-27 05:13:35.000000000 +0200 ++++ HappyCamel/cli.py 2013-09-24 19:46:02.000000000 +0200 +@@ -257,6 +257,10 @@ + var = "show_waypoints", + default = defaults["show_waypoints"], + help = "Show the waypoints in the KMZ file. Currently set to %default.") ++ parser.addOption("--google-maps", type = "bool", bool_action = True, ++ var = "for_google_maps", ++ default = defaults["for_google_maps"], ++ help = "Generate for google-maps. Currently set to %default.") + + # The options relating to image parsing + parser.addHelpRule("\nUsually, metadata is read through the internal library, but written through the external Exiftool command. Using Exiftool is much slower, but using the internal library for writing carries some risk as it is not as mature.\nThe following options influence this behavior:") +@@ -333,6 +337,7 @@ + options["between_color"] = False + options["between_width"] = False + options["show_waypoints"] = False ++ options["for_google_maps"]= True + + # Check if the user specified any photo's + if (len(args) < 1) and not (options["report_times"] or options["save_config"]): +diff -dPNur HappyCamel.current/config.py HappyCamel/config.py +--- HappyCamel.current/config.py 2013-08-27 05:13:35.000000000 +0200 ++++ HappyCamel/config.py 2013-09-24 19:46:49.000000000 +0200 +@@ -77,6 +77,7 @@ + "between_color": [str, "KMZ File", "Between color", "60ffffff"], + "between_width": [float, "KMZ File", "Between width", 2.0], + "show_waypoints": [bool, "KMZ File", "Show waypoints", False], ++ "for_google_maps": [bool, "KMZ File", "Generate for Google Maps", True], + "order": [str, "KMZ File", "Order", "D"], + "image_size": [int, "KMZ File", "Pixels", 200], + "icon_size": [int, "KMZ File", "Icon pixels", 0], +diff -dPNur HappyCamel.current/kmlhandler.py HappyCamel/kmlhandler.py +--- HappyCamel.current/kmlhandler.py 2013-08-27 05:13:35.000000000 +0200 ++++ HappyCamel/kmlhandler.py 2013-09-24 19:53:49.000000000 +0200 +@@ -59,7 +59,7 @@ + self.between_tracks_width = between_tracks_width + + def writeKML(self, out_fp, write_photos = True, write_waypoints = True, +- write_track = True, write_between_tracks = True): ++ write_track = True, write_between_tracks = True, for_google_maps = True): + """ Write a KML file to the specified file pointer out_fp. The arguments + specify which parts of the file should be included. If write_photos is + True, thumbnails should be included. If write_waypoints is True, +@@ -80,7 +80,7 @@ + + if (write_photos): + self.logger.debug("Writing photo folder") +- self.writePhotos(out_fp) ++ self.writePhotos(out_fp, for_google_maps) + + if (write_waypoints): + self.logger.debug("Writing waypoints folder") +@@ -92,7 +92,7 @@ + + out_fp.write('</Document>\n') + +- def writePhotos(self, out_fp): ++ def writePhotos(self, out_fp, for_google_maps): + """ Write the photo references with comments and stuff to the file pointer + out_fp . """ + +@@ -116,10 +116,9 @@ + out_fp.write('<Folder>\n') + out_fp.write(' <name>Images</name>\n') + # Write each thumbnail as a placemark ++ + for photo in self.photo_list: + if (photo in self.thumbnail_names): # Only process if there's a thumbnail +- location = photo.getLocation() +- + if (self.use_icons): + out_fp.write(' <Style id="photo_%s">\n' % self.thumbnail_names[photo]) + out_fp.write(' <IconStyle>\n') +@@ -133,6 +132,10 @@ + out_fp.write(' </LabelStyle>\n') + out_fp.write(' </Style>\n') + ++ for photo in self.photo_list: ++ if (photo in self.thumbnail_names): # Only process if there's a thumbnail ++ location = photo.getLocation() ++ + out_fp.write(' <Placemark>\n') + out_fp.write(' <name>%s</name>\n' % photo.getName()) + out_fp.write(' <description><![CDATA[') +@@ -157,9 +160,22 @@ + out_fp.write(' <Snippet>%s</Snippet>\n' % photo.getName()) + + if (self.use_icons): +- out_fp.write(' <styleUrl>#photo_%s</styleUrl>\n' % self.thumbnail_names[photo]) ++ if (for_google_maps): ++ out_fp.write(' <StyleMap><Pair><Style>\n') ++ out_fp.write(' <IconStyle>\n') ++ out_fp.write(' <scale>1.5</scale>\n') ++ out_fp.write(' <Icon>\n') ++ out_fp.write(' <href>icons/%s</href>\n' % self.thumbnail_names[photo]) ++ out_fp.write(' </Icon>\n') ++ out_fp.write(' </IconStyle>\n') ++ out_fp.write(' <LabelStyle>\n') ++ out_fp.write(' <scale>0.2</scale>\n') ++ out_fp.write(' </LabelStyle>\n') ++ out_fp.write(' </Style></Pair></StyleMap>\n') ++ else: ++ out_fp.write(' <styleUrl>#photo_%s</styleUrl>\n' % self.thumbnail_names[photo]) + else: +- out_fp.write(' <styleUrl>#photo_mark</styleUrl>\n') ++ out_fp.write(' <styleUrl>#photo_mark</styleUrl>\n') + out_fp.write(' <Point>\n') + if (location[2]): + out_fp.write(' <altitudeMode>clampToGround</altitudeMode>\n') +@@ -202,7 +218,7 @@ + # Write the actual waypoints + for waypoint in waypoints: + out_fp.write(' <Placemark id="%s">\n' % waypoint[3]) +- out_fp.write(' <styleUrl>waypoint_style</styleUrl>\n') ++ out_fp.write(' <styleUrl>#waypoint_style</styleUrl>\n') + out_fp.write(' <Point>\n') + out_fp.write(' <coordinates>%.5f,%.5f,%.3f</coordinates>\n' % (waypoint[1], waypoint[0], (waypoint[2] or 0))) + out_fp.write(' </Point>\n') +@@ -399,7 +415,7 @@ + self.logger.error("Couldn't make a thumbnail of image %s." % photo.getName()) + + def writeFile(self, write_photos = False, write_waypoints = False, +- write_track = False, write_between_tracks = False): ++ write_track = False, write_between_tracks = False, for_google_maps = True): + """ Write the KMZ file. The arguments specify which parts of the file should + be included. If write_photos is True, thumbnails should be included. + If write_waypoints is True, waypoints should be included. If write_track +@@ -440,7 +456,7 @@ + self.between_tracks_color, self.between_tracks_width, + self.photos_clickable, self.photos_url, bool(self.icon_size)) + kml_fp = StringIO.StringIO() +- kml.writeKML(kml_fp, write_photos, write_waypoints, write_track, write_between_tracks) ++ kml.writeKML(kml_fp, write_photos, write_waypoints, write_track, write_between_tracks, for_google_maps) + + # Write the KML file to the ZIP archive + out_file.writestr("base.kml", kml_fp.getvalue()) +diff -dPNur HappyCamel.current/main.py HappyCamel/main.py +--- HappyCamel.current/main.py 2013-08-27 05:13:35.000000000 +0200 ++++ HappyCamel/main.py 2013-09-24 19:50:50.000000000 +0200 +@@ -264,7 +264,8 @@ + self.conf.get("url"), + self.conf.get("show_waypoints"), + self.conf.get("show_track"), +- self.conf.get("show_between_tracks")) ++ self.conf.get("show_between_tracks"), ++ self.conf.get("for_google_maps")) + + def getLocSources(self, input_list): + """ Build and return a GeoSources instance with all possible sources of +@@ -533,7 +534,7 @@ + def writeKMZFile(self, gpx_files, photo_list, file_path, order, image_size, icon_size, + title, track_color, track_width, between_color, + between_width, clickable, photos_url, show_waypoints, show_track, +- show_between_tracks): ++ show_between_tracks, for_google_maps): + + """ Write the KMZ file with the specified options. """ + +@@ -543,5 +544,5 @@ + + kmz.writeFile(write_photos = True, + write_waypoints = show_waypoints, write_track = show_track, +- write_between_tracks = show_between_tracks) ++ write_between_tracks = show_between_tracks, for_google_maps = for_google_maps) + diff --git a/sci-geosciences/happycamel/files/happycamel-v1-beta3-ds-features.patch b/sci-geosciences/happycamel/files/happycamel-v1-beta3-ds-features.patch new file mode 100644 index 0000000..4bf9abc --- /dev/null +++ b/sci-geosciences/happycamel/files/happycamel-v1-beta3-ds-features.patch @@ -0,0 +1,322 @@ +diff -dPNur happycamel-v1-beta3/HappyCamel/cli.py happycamel-v1-beta3-ds/HappyCamel/cli.py +--- happycamel-v1-beta3/HappyCamel/cli.py 2008-04-17 21:25:10.000000000 +0200 ++++ happycamel-v1-beta3-ds/HappyCamel/cli.py 2008-11-19 13:58:07.000000000 +0100 +@@ -221,11 +221,16 @@ + parser.addOption("--image-size", metavar = "pixels", var = "image_size", + type = "int", default = defaults["image_size"], + help = "The size of the long side of the photo in the KMZ file. Currently set to %default.") ++ parser.addOption("--icon-size", metavar = "pixels", var = "icon_size", ++ type = "int", default = defaults["icon_size"], ++ help = "The size of the long side of the icon in the KMZ file. Currently set to %default.") + parser.addOption("--title", metavar = "title", var = "title", + default = defaults["title"], help = "The title of your KMZ file. Currently set to \"%default\".") + parser.addOption("--clickable", var = "clickable", type = "bool", + bool_action = True, default = defaults["clickable"], + help = "It true, make the images clickable so they are shown in your web browser. WARNING: When using disk photos, this is not portable across computers, unless the photo's are placed at exactly the same path as on the original machine. Currently set to %default.") ++ parser.addOption("--url", var = "url", ++ default = "", help = "Defines URL there the photos are published. Currently set to %default.") + parser.addOption("--track", type = "bool", bool_action = True, + var = "show_track", default = defaults["show_track"], + help = "Show the GPS track in the KMZ file. Currently set to %default.") +@@ -315,8 +320,10 @@ + options["kmz_file"] = False + options["order"] = False + options["image_size"] = False ++ options["icon_size"] = False + options["title"] = False + options["clickable"] = False ++ options["url"] = False + options["show_track"] = False + options["track_color"] = False + options["track_width"] = False +diff -dPNur happycamel-v1-beta3/HappyCamel/config.py happycamel-v1-beta3-ds/HappyCamel/config.py +--- happycamel-v1-beta3/HappyCamel/config.py 2008-04-17 21:25:10.000000000 +0200 ++++ happycamel-v1-beta3-ds/HappyCamel/config.py 2008-11-19 13:54:41.000000000 +0100 +@@ -78,8 +78,10 @@ + "show_waypoints": [bool, "KMZ File", "Show waypoints", False], + "order": [str, "KMZ File", "Order", "D"], + "image_size": [int, "KMZ File", "Pixels", 200], ++ "icon_size": [int, "KMZ File", "Icon pixels", 0], + "title": [str, "KMZ File", "Title", "Photo report"], +- "clickable": [bool, "KMZ File", "Clickable", False] ++ "clickable": [bool, "KMZ File", "Clickable", False], ++ "url": [str, "KMZ File", "Photos URL", ""] + } + + def __init__(self): +@@ -133,7 +135,7 @@ + if (type(value) == self.map[option][0]): + self.values[option] = value + else: +- raise TypeError, "Expected %s, but got %s instead" % (self.map[options][0], type(value)) ++ raise TypeError, "Expected %s, but got %s instead for option %s" % (self.map[option][0], type(value), option) + else: + raise UnknownOptionError(option) + +diff -dPNur happycamel-v1-beta3/HappyCamel/kmlhandler.py happycamel-v1-beta3-ds/HappyCamel/kmlhandler.py +--- happycamel-v1-beta3/HappyCamel/kmlhandler.py 2008-04-17 21:25:10.000000000 +0200 ++++ happycamel-v1-beta3-ds/HappyCamel/kmlhandler.py 2008-11-19 13:57:31.000000000 +0100 +@@ -27,7 +27,7 @@ + def __init__(self, gpx_files, photo_list, thumbnail_names, logger, + title = "Photo report", track_color = "ffffffff", + track_width = 1.0, between_tracks_color = None, +- between_tracks_width = None, photos_clickable = False): ++ between_tracks_width = None, photos_clickable = False, photos_url = "", use_icons = False): + """ Initialize a new KML file. gpx_files is a list of GPXFile objects which + should be drawn in the file. photo_list is a PhotoList object of + photo's whose thumbnail should be included. thumbnail_names is an +@@ -43,6 +43,8 @@ + self.thumbnail_names = thumbnail_names + self.title = title + self.photos_clickable = photos_clickable ++ self.photos_url = photos_url ++ self.use_icons = use_icons + + # Check if the specified track colors and widths are ok + self.track_color = self.__testColorFormat__(track_color) +@@ -117,11 +119,28 @@ + for photo in self.photo_list: + if (photo in self.thumbnail_names): # Only process if there's a thumbnail + location = photo.getLocation() ++ ++ if (self.use_icons): ++ out_fp.write(' <Style id="photo_%s">\n' % self.thumbnail_names[photo]) ++ out_fp.write(' <IconStyle>\n') ++ out_fp.write(' <scale>1.5</scale>\n') ++ out_fp.write(' <Icon>\n') ++ out_fp.write(' <href>icons/%s</href>\n' % self.thumbnail_names[photo]) ++ out_fp.write(' </Icon>\n') ++ out_fp.write(' </IconStyle>\n') ++ out_fp.write(' <LabelStyle>\n') ++ out_fp.write(' <scale>0.2</scale>\n') ++ out_fp.write(' </LabelStyle>\n') ++ out_fp.write(' </Style>\n') ++ + out_fp.write(' <Placemark>\n') + out_fp.write(' <name>%s</name>\n' % photo.getName()) + out_fp.write(' <description><![CDATA[') + if (self.photos_clickable): +- out_fp.write('<a href="%s">' % photo.getURL()) ++ if (self.photos_url): ++ out_fp.write('<a href="%s/%s">' % (self.photos_url, photo.getName())) ++ else: ++ out_fp.write('<a href="%s">' % photo.getURL()) + out_fp.write('<img src="images/%s" />' % self.thumbnail_names[photo]) + if (self.photos_clickable): + out_fp.write("</a>") +@@ -136,7 +155,11 @@ + out_fp.write(' <Snippet><![CDATA[%s]]></Snippet>\n' % comment) + else: + out_fp.write(' <Snippet>%s</Snippet>\n' % photo.getName()) +- out_fp.write(' <styleUrl>#photo_mark</styleUrl>\n') ++ ++ if (self.use_icons): ++ out_fp.write(' <styleUrl>#photo_%s</styleUrl>\n' % self.thumbnail_names[photo]) ++ else: ++ out_fp.write(' <styleUrl>#photo_mark</styleUrl>\n') + out_fp.write(' <Point>\n') + if (location[2]): + out_fp.write(' <altitudeMode>clampToGround</altitudeMode>\n') +@@ -275,10 +298,10 @@ + NUM_THUMBNAILS = 25 + + def __init__(self, file_name, logger, gpx_files = None, photo_list = None, +- sort_order = "D", thumbnail_size = 200, title = "Photo report", ++ sort_order = "D", thumbnail_size = 200, icon_size = 0, title = "Photo report", + track_color = "ffffffff", track_width = 1.0, + between_tracks_color = None, between_tracks_width = None, +- photos_clickable = False): ++ photos_clickable = False, photos_url = ""): + """ Create a new KMZ file with the disk path file_name. gpx_files is a list + of GPXFile objects that need to be showed in the file. photo_list is a + PhotoList object of photo's whose thumbnail should be included. +@@ -286,8 +309,9 @@ + presented ("D" is date and time, "A" is latitude, "O" is longitude. + Lowercase means reverse sort. Multiple tokens may be specified in order + of precedence). +- thumbnail_size is the number of pixels the long size of each thumbnail +- should have. ++ thumbnail_size is the number of pixels the long size of each thumbnail ++ should have. ++ icon_size is the number of pixels the long size of each icon should have. + title is the title given to the report in Google Earth. + track_color and between_tracks_color specify the color to give the + tracks and the lines in between the tracks, respectively. They are +@@ -309,12 +333,14 @@ + self.gpx_files = gpx_files + self.photo_list = photo_list + self.thumbnail_size = thumbnail_size ++ self.icon_size = icon_size + self.title = title + self.track_width = track_width + self.track_color = track_color + self.between_tracks_width = between_tracks_width + self.between_tracks_color = between_tracks_color + self.photos_clickable = photos_clickable ++ self.photos_url = photos_url + + # Sort the photo's + for index in range(len(sort_order)): +@@ -366,7 +392,9 @@ + file_names[photo] = "%s.jpg" % fn_base + + # Write the file +- zip_file.writestr("images/%s.jpg" % fn_base, data) ++ zip_file.writestr("images/%s.jpg" % fn_base, data[0]) ++ if (data[1]): ++ zip_file.writestr("icons/%s.jpg" % fn_base, data[1]) + else: + self.logger.error("Couldn't make a thumbnail of image %s." % photo.getName()) + +@@ -391,7 +419,7 @@ + # but we put it here in a separate thread here as well because at the same + # time we need to start the processing thread. + get_thread = threading.Thread(target = self.photo_list.getThumbnailData, +- args = [self.thumbnail_size, tn_queue]) ++ args = [self.thumbnail_size, self.icon_size, tn_queue]) + file_names = {} + process_thread = threading.Thread(target = self.__processThumbnails__, + args = [tn_queue, out_file, file_names]) +@@ -410,7 +438,7 @@ + kml = KML(self.gpx_files, self.photo_list, file_names, self.logger, + self.title, self.track_color, self.track_width, + self.between_tracks_color, self.between_tracks_width, +- self.photos_clickable) ++ self.photos_clickable, self.photos_url, bool(self.icon_size)) + kml_fp = StringIO.StringIO() + kml.writeKML(kml_fp, write_photos, write_waypoints, write_track, write_between_tracks) + +diff -dPNur happycamel-v1-beta3/HappyCamel/main.py happycamel-v1-beta3-ds/HappyCamel/main.py +--- happycamel-v1-beta3/HappyCamel/main.py 2008-04-17 21:25:10.000000000 +0200 ++++ happycamel-v1-beta3-ds/HappyCamel/main.py 2008-11-19 14:22:55.000000000 +0100 +@@ -254,12 +254,14 @@ + self.writeKMZFile(self.geo_sources.getAllGPXFiles(), photo_list, + kmz_file, self.conf.get("order"), + self.conf.get("image_size"), ++ self.conf.get("icon_size"), + self.conf.get("title"), + self.conf.get("track_color"), + self.conf.get("track_width"), + self.conf.get("between_color"), + self.conf.get("between_width"), + self.conf.get("clickable"), ++ self.conf.get("url"), + self.conf.get("show_waypoints"), + self.conf.get("show_track"), + self.conf.get("show_between_tracks")) +@@ -525,16 +527,16 @@ + if not (results[photo]): + self.logger.message("Couldn't succesfully write metadata to photo %s." % photo.getName()) + +- def writeKMZFile(self, gpx_files, photo_list, file_path, order, image_size, ++ def writeKMZFile(self, gpx_files, photo_list, file_path, order, image_size, icon_size, + title, track_color, track_width, between_color, +- between_width, clickable, show_waypoints, show_track, ++ between_width, clickable, photos_url, show_waypoints, show_track, + show_between_tracks): + + """ Write the KMZ file with the specified options. """ + + kmz = kmlhandler.KMZ(file_path, self.logger, gpx_files, +- photo_list, order, image_size, title, track_color, +- track_width, between_color, between_width, clickable) ++ photo_list, order, image_size, icon_size, title, track_color, ++ track_width, between_color, between_width, clickable, photos_url) + + kmz.writeFile(write_photos = True, + write_waypoints = show_waypoints, write_track = show_track, +diff -dPNur happycamel-v1-beta3/HappyCamel/photohandler.py happycamel-v1-beta3-ds/HappyCamel/photohandler.py +--- happycamel-v1-beta3/HappyCamel/photohandler.py 2008-04-17 21:25:10.000000000 +0200 ++++ happycamel-v1-beta3-ds/HappyCamel/photohandler.py 2008-11-19 14:22:55.000000000 +0100 +@@ -164,7 +164,7 @@ + if ((not self.ele) or overwrite): + self.ele = ele + +- def __scalePhoto__(self, file_obj, max_side): ++ def __scalePhoto__(self, file_obj, max_side, icon_size = 0): + """ Scale the photo referred to by the given file_obj so that the longest + size is max_side. If the original is smaller than the required format, + it isn't scaled. Return a JPEG-encoded string with data. """ +@@ -195,7 +195,24 @@ + self.logger.debug("Required thumbnail for %s is larger than the original - no scaling." % self.getName()) + + # Return a JPEG encoded string +- return photo_data.tostring("jpeg", "RGB") ++ thumbnail = photo_data.tostring("jpeg", "RGB") ++ ++ if (icon_size): ++ if (photo_size[0] > photo_size[1]): ++ fraction = float(icon_size) / photo_size[0] ++ else: ++ fraction = float(icon_size) / photo_size[1] ++ ++ if (fraction < 1.0): ++ icon_size = [int(photo_size[0] * fraction), int(photo_size[1] * fraction)] ++ self.logger.debug("Resizing thumnail %s from %dx%d to %dx%d pixels." % (self.getName(), thumbnail_size[0], thumbnail_size[1], icon_size[0], icon_size[1])) ++ photo_data.thumbnail(icon_size, Image.BICUBIC) ++ ++ icon = photo_data.tostring("jpeg", "RGB") ++ else: ++ icon = None ++ ++ return thumbnail, icon + + return False + +@@ -543,7 +560,7 @@ + results.update(self.__queue2Dict__(flickr_results)) + return results + +- def getThumbnailData(self, max_side, queue): ++ def getThumbnailData(self, max_side, icon_size, queue): + """ Load all the thumbnails from the images in the list and put a tuple of + (photo object, JPEG-encoded thumbnail data) in the provided Queue.queue + instance. This allows for a multithreaded processing of the images. +@@ -558,9 +575,9 @@ + + # Process the pools + self.__runThreaded__(self.DISK_THREAD_NUM, "getThumbnailData", +- pools["disk"], queue, max_side = max_side) ++ pools["disk"], queue, max_side = max_side, icon_size = icon_size) + self.__runThreaded__(self.FLICKR_THREAD_NUM, "getThumbnailData", +- pools["flickr"], queue, max_side = max_side) ++ pools["flickr"], queue, max_side = max_side, icon_size = icon_size) + + def cleanup(self, check_date = False, check_location = False): + """ Removes the photos from the list which don't comply to the specified +@@ -757,7 +774,7 @@ + + return "file://%s" % os.path.join(os.getcwd(), self.getPath()) + +- def getThumbnailData(self, max_side = 200): ++ def getThumbnailData(self, max_side = 200, icon_size = 0): + """ Convert the image to a thumbnail and return the data, JPEG-encoded, + or False if we cannot convert this image. max_side specifies the number + of pixels the long side of the thumbnail needs to have. """ +@@ -767,7 +784,7 @@ + if (ext in PIL_READ_FORMATS): + self.logger.debug("Creating thumbnail for photo %s" % self.getName()) + photo_data = open(self.getPath()) +- return self.__scalePhoto__(photo_data, max_side) ++ return self.__scalePhoto__(photo_data, max_side, icon_size) + else: + self.logger.error("Can't create thumbnail for photo %s" % self.getName()) + return False +@@ -1270,7 +1287,7 @@ + + return True + +- def getThumbnailData(self, max_side = 200): ++ def getThumbnailData(self, max_side = 200, icon_size = 0): + """ Convert the image to a thumbnail and return the data, JPEG-encoded, + or False if we cannot convert this image. max_side specifies the number + of pixels the long side of the thumbnail needs to have. """ +@@ -1312,7 +1329,7 @@ + + # Download the photo and load it as a PIL image + photo_data = StringIO.StringIO(urllib2.urlopen(best_fit["entry"]["source"]).read()) +- return self.__scalePhoto__(photo_data, max_side) ++ return self.__scalePhoto__(photo_data, max_side, icon_size) + + def writeMetadata(self, write_coords = True, write_geo_names = False, + correct_time = False): diff --git a/sci-geosciences/happycamel/happycamel-1_beta3-r1.ebuild b/sci-geosciences/happycamel/happycamel-1_beta3-r1.ebuild new file mode 100644 index 0000000..34c4b9c --- /dev/null +++ b/sci-geosciences/happycamel/happycamel-1_beta3-r1.ebuild @@ -0,0 +1,32 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-geosciences/gpscorrelate/gpscorrelate-1.5.6.ebuild,v 1.3 2008/08/23 18:13:05 maekke Exp $ + +inherit eutils + +MY_PV=${PV/_/-} + +DESCRIPTION="Happy Camel is intended to combine your digital camera with your GPS device" +HOMEPAGE="http://happycamel.sourceforge.net" +SRC_URI="mirror://sourceforge/${PN}/${PN}-v${MY_PV}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ~hppa x86" +DEPEND="dev-python/imaging + media-libs/exiftool" + + +S=${WORKDIR}/${PN}-v${MY_PV} + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/happycamel-v1-beta3-ds-features.patch || die + epatch "${FILESDIR}"/HappyCamel-optional-correlate.diff || die + epatch "${FILESDIR}"/happycamel-ds-icons.patch || die +} + +src_install() { + ./setup.py install --root="${D}" --no-compile +} diff --git a/sci-geosciences/happycamel/happycamel-1_beta3-r2.ebuild b/sci-geosciences/happycamel/happycamel-1_beta3-r2.ebuild new file mode 100644 index 0000000..019ceaa --- /dev/null +++ b/sci-geosciences/happycamel/happycamel-1_beta3-r2.ebuild @@ -0,0 +1,32 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-geosciences/gpscorrelate/gpscorrelate-1.5.6.ebuild,v 1.3 2008/08/23 18:13:05 maekke Exp $ + +inherit eutils + +MY_PV=${PV/_/-} + +DESCRIPTION="Happy Camel is intended to combine your digital camera with your GPS device" +HOMEPAGE="http://happycamel.sourceforge.net" +SRC_URI="mirror://sourceforge/${PN}/${PN}-v${MY_PV}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ~hppa x86" +DEPEND="virtual/python-imaging + media-libs/exiftool" + + +S=${WORKDIR}/${PN}-v${MY_PV} + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/happycamel-v1-beta3-ds-features.patch || die + epatch "${FILESDIR}"/HappyCamel-optional-correlate.diff || die + epatch "${FILESDIR}"/happycamel-ds-icons.patch || die +} + +src_install() { + ./setup.py install --root="${D}" --no-compile +} diff --git a/sci-geosciences/happycamel/happycamel-1_beta3-r3.ebuild b/sci-geosciences/happycamel/happycamel-1_beta3-r3.ebuild new file mode 100644 index 0000000..1c6f59c --- /dev/null +++ b/sci-geosciences/happycamel/happycamel-1_beta3-r3.ebuild @@ -0,0 +1,32 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-geosciences/gpscorrelate/gpscorrelate-1.5.6.ebuild,v 1.3 2008/08/23 18:13:05 maekke Exp $ + +inherit eutils + +MY_PV=${PV/_/-} + +DESCRIPTION="Happy Camel is intended to combine your digital camera with your GPS device" +HOMEPAGE="http://happycamel.sourceforge.net" +SRC_URI="mirror://sourceforge/${PN}/${PN}-v${MY_PV}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ~hppa x86" +DEPEND="dev-python/pillow + media-libs/exiftool" + + +S=${WORKDIR}/${PN}-v${MY_PV} + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/happycamel-v1-beta3-ds-features.patch || die + epatch "${FILESDIR}"/HappyCamel-optional-correlate.diff || die + epatch "${FILESDIR}"/happycamel-ds-icons.patch || die +} + +src_install() { + ./setup.py install --root="${D}" --no-compile +} |