Updated document mode to pass the document mimetype when calling convert to avoid a chain of mimetype detections

This commit is contained in:
Roberto Rosario
2011-11-21 06:24:19 -04:00
parent bd24353886
commit 3f33924d4a

View File

@@ -250,7 +250,7 @@ class Document(models.Model):
return cache_file_path
else:
document_file = document_save_to_temp_dir(self, self.checksum)
return convert(document_file, output_filepath=cache_file_path, page=page, transformations=transformations)
return convert(document_file, output_filepath=cache_file_path, page=page, transformations=transformations, mimetype=self.file_mimetype)
def get_valid_image(self, size=DISPLAY_SIZE, page=DEFAULT_PAGE_NUMBER, zoom=DEFAULT_ZOOM_LEVEL, rotation=DEFAULT_ROTATION):
image_cache_name = self.get_image_cache_name(page=page)