Skip to content
Snippets Groups Projects
Commit c5cc597b authored by Daniel Neuwirth's avatar Daniel Neuwirth
Browse files

d

parent a316a96d
No related branches found
No related tags found
No related merge requests found
...@@ -88,12 +88,15 @@ def create_thumbnail_from_url(resource, private): ...@@ -88,12 +88,15 @@ def create_thumbnail_from_url(resource, private):
body = response.read() body = response.read()
body_decoded = body.decode('utf-8') body_decoded = body.decode('utf-8')
log.debug('body_decoded mime: {}'.format(magic.from_buffer(body_decoded, mime = True))) log.debug('body_decoded mime: {}'.format(magic.from_buffer(body_decoded, mime = True)))
body_encoded = body.body_encoded('utf-8')
log.debug('body_encoded mime: {}'.format(magic.from_buffer(body_decoded, mime = True)))
memory_file = io.BytesIO(response.read()) memory_file = io.BytesIO(response.read())
log.debug('memory_file mime: {}'.format(magic.from_buffer(memory_file.read(), mime = True))) log.debug('memory_file mime: {}'.format(magic.from_buffer(memory_file.read(), mime = True)))
log.debug('response is not None') log.debug('response is not None')
log.debug('response: {}'.format(response.read())) log.debug('response: {}'.format(response.read()))
temp_path = config.get('ckan.storage_path') + '/resources/' + 'temp_for_thumbnail.pdf' temp_path = config.get('ckan.storage_path') + '/resources/' + 'temp_for_thumbnail'
with open(temp_path, 'w + b') as temp_file: with open(temp_path, 'w + b') as temp_file:
temp_file.write(response.read()) temp_file.write(response.read())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment