Added content_type to document image file serving

This commit is contained in:
Roberto Rosario
2011-03-06 02:23:25 -04:00
parent e1bff0c25a
commit 6ad14fb793

View File

@@ -504,7 +504,7 @@ def get_document_image(request, document_id, size=PREVIEW_SIZE, quality=QUALITY_
try:
filepath = in_image_cache(document.checksum, size=size, quality=quality, extra_options=tranformation_string, page=page-1)
if filepath:
return serve_file(request, File(file=open(filepath, 'r')))
return serve_file(request, File(file=open(filepath, 'r')), content_type='image/jpeg')
#Save to a temporary location
filepath = document_save_to_temp_dir(document, filename=document.checksum)
output_file = convert(filepath, size=size, format='jpg', quality=quality, extra_options=tranformation_string, page=page-1)