Change image processing to create new .gps_*.
authorElrond <elrond+mediagoblin.org@samba-tng.org>
Wed, 14 Mar 2012 19:15:04 +0000 (20:15 +0100)
committerElrond <elrond+mediagoblin.org@samba-tng.org>
Wed, 14 Mar 2012 19:17:49 +0000 (20:17 +0100)
The processing should also create .gps_* instead of the old
['gps']['x']. To ease forward porting, use the new
media.media_data_init() to set the gps data in the media.

mediagoblin/media_types/image/processing.py

index 769de89b13cc504b8689230a184d833edec69edb..b61e717d60c8fd1a851b99caee045eef08c6fef0 100644 (file)
@@ -119,7 +119,11 @@ def process_image(entry):
         'clean': clean_exif(exif_tags)}
     media_data['exif']['useful'] = get_useful(
         media_data['exif']['clean'])
-    media_data['gps'] = gps_data
+
+    if len(gps_data):
+        for key in list(gps_data.keys()):
+            gps_data['gps_' + key] = gps_data.pop(key)
+        entry.media_data_init(**gps_data)
 
     # clean up workbench
     workbench.destroy_self()