aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin
diff options
context:
space:
mode:
authorElrond <elrond+mediagoblin.org@samba-tng.org>2012-03-15 12:38:09 +0100
committerElrond <elrond+mediagoblin.org@samba-tng.org>2012-03-15 12:38:09 +0100
commit497d927983febc0cfdc37e57ccf892ddcf736d04 (patch)
treeb361f85d0626ad0d4705d32d7efdd7b7b4ee9dbd /mediagoblin
parent729424befd80ed34d486cf995499ce7a8bd0806f (diff)
downloadmediagoblin-497d927983febc0cfdc37e57ccf892ddcf736d04.tar.lz
mediagoblin-497d927983febc0cfdc37e57ccf892ddcf736d04.tar.xz
mediagoblin-497d927983febc0cfdc37e57ccf892ddcf736d04.zip
Fix uploading of images (sql: media_data, exif).
When uploading a new image the processing code wants to set the media_data['exif'] part. As exif is not yet in sql, there is no way to make this work now. So the workaround is to check for "no row exists yet" and just ignore exif.
Diffstat (limited to 'mediagoblin')
-rw-r--r--mediagoblin/media_types/image/processing.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/mediagoblin/media_types/image/processing.py b/mediagoblin/media_types/image/processing.py
index b61e717d..6ba91a15 100644
--- a/mediagoblin/media_types/image/processing.py
+++ b/mediagoblin/media_types/image/processing.py
@@ -115,10 +115,13 @@ def process_image(entry):
# Insert exif data into database
media_data = entry.setdefault('media_data', {})
- media_data['exif'] = {
- 'clean': clean_exif(exif_tags)}
- media_data['exif']['useful'] = get_useful(
- media_data['exif']['clean'])
+
+ # TODO: Fix for sql media_data, when exif is in sql
+ if media_data is not None:
+ media_data['exif'] = {
+ 'clean': clean_exif(exif_tags)}
+ media_data['exif']['useful'] = get_useful(
+ media_data['exif']['clean'])
if len(gps_data):
for key in list(gps_data.keys()):