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.
# 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()):