From 497d927983febc0cfdc37e57ccf892ddcf736d04 Mon Sep 17 00:00:00 2001 From: Elrond Date: Thu, 15 Mar 2012 12:38:09 +0100 Subject: [PATCH] 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. --- mediagoblin/media_types/image/processing.py | 11 +++++++---- 1 file 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()): -- 2.25.1