-scale-to only takes 1 size, so choose the smallest
authorRodney Ewing <ewing.rj@gmail.com>
Wed, 14 Aug 2013 19:13:06 +0000 (12:13 -0700)
committerRodney Ewing <ewing.rj@gmail.com>
Fri, 16 Aug 2013 22:30:21 +0000 (15:30 -0700)
mediagoblin/media_types/pdf/processing.py

index c7c85e2023bb668432d697dd82b2243be759b968..f8aea7bbaa1e4bee4f50996a82bf9c49981761aa 100644 (file)
@@ -275,7 +275,7 @@ class CommonPdfProcessor(MediaProcessor):
                                           '{basename}.thumbnail'))
 
         executable = where('pdftocairo')
-        args = [executable, '-scale-to', str(thumb_size),
+        args = [executable, '-scale-to', str(min(thumb_size)),
                 '-singlefile', '-png', self.pdf_filename, thumb_filename]
 
         _log.debug('calling {0}'.format(repr(' '.join(args))))
@@ -320,7 +320,7 @@ class CommonPdfProcessor(MediaProcessor):
                                 self.name_builder.fill('{basename}.medium'))
 
         executable = where('pdftocairo')
-        args = [executable, '-scale-to', str(size),
+        args = [executable, '-scale-to', str(min(size)),
                 '-singlefile', '-png', self.pdf_filename, filename]
 
         _log.debug('calling {0}'.format(repr(' '.join(args))))