Skip to content
Snippets Groups Projects
Commit 5438d188 authored by Kevin S. Hahn's avatar Kevin S. Hahn
Browse files

tiles api uses a montage zip file

parent f677d1c8
No related branches found
No related tags found
No related merge requests found
......@@ -293,13 +293,13 @@ class Container(base.RequestHandler):
'_id': _id,
'$and': [
{'files.kinds': ['montage']},
{'files.ext': '.tiff'},
{'files.ext': '.zip'},
],
},
['files.$'],
)
if not montage_info:
self.abort(404, 'montage tiff not found')
self.abort(404, 'montage zip not found')
fn = montage_info['files'][0]['name'] + montage_info['files'][0]['ext']
fp = os.path.join(self.app.config['data_path'], cid[-3:], cid, fn)
z = self.request.get('z')
......@@ -308,10 +308,12 @@ class Container(base.RequestHandler):
if not (z and x and y):
return util.get_info(fp)
else:
self.response.content_type = 'image/png'
self.response.content_type = 'image/jpeg'
tile = util.get_tile(fp, int(z), int(x), int(y))
if tile:
self.response.write(tile)
else:
self.abort(404, 'request tile does not exist')
def get_attachment(self, cid):
"""Download one attachment."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment