Unverified Commit 081e1578 authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

fix mimetype problem for images

parent f5cd2c72
Pipeline #16996 passed with stages
in 3 minutes and 45 seconds
......@@ -119,9 +119,6 @@ def _get_values_from_digital_object(msg, access_status):
}
if '@id' in msg:
return_values['sig'] = msg['@id'].split('/')[-1]
if 'hasMimeType' in msg:
mimetype = msg['hasMimeType']
return_values['mimetype'] = mimetype
if 'height' in msg:
height = msg['height']
return_values['height'] = height
......@@ -133,6 +130,12 @@ def _get_values_from_digital_object(msg, access_status):
return_values['duration'] = duration
if 'isDistributedOn' in msg:
return_values['type'] = msg['isDistributedOn']
if 'hasMimeType' in msg:
if return_values['type'] == 'image':
mimetype = 'image/jp2'
else:
mimetype = msg['hasMimeType']
return_values['mimetype'] = mimetype
if _is_remote_file(msg):
return_values['uri'] = msg['locator']
if access_status == 'public':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment