From 6ad14fb7933ce6f6e1603c8dfd9375d9e7903cb1 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Sun, 6 Mar 2011 02:23:25 -0400 Subject: [PATCH] Added content_type to document image file serving --- apps/documents/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/documents/views.py b/apps/documents/views.py index 652c74864d..05b8699201 100755 --- a/apps/documents/views.py +++ b/apps/documents/views.py @@ -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)