Don't convert images blindly to RGB. Only convert to RGB or RGBA when saving to JPEG and mode is 'P'. documents.tests.test_models.MultiPageTiffTestCase passes again.

This commit is contained in:
Roberto Rosario
2015-09-16 15:55:11 -04:00
parent 60e64b92fd
commit dbd676646b
2 changed files with 12 additions and 3 deletions

View File

@@ -93,7 +93,7 @@ class Python(ConverterBase):
file_object.seek(0)
else:
try:
image = Image.open(self.file_object).convert('RGB')
image = Image.open(self.file_object)
except IOError as exception:
error_message = _('Exception determining PDF page count; %s') % exception
logger.error(error_message)