From: Rodney Ewing Date: Wed, 14 Aug 2013 19:13:06 +0000 (-0700) Subject: -scale-to only takes 1 size, so choose the smallest X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=7a89d27c80c89b646ffda44fe1baf98a0a7b91bc;p=mediagoblin.git -scale-to only takes 1 size, so choose the smallest --- diff --git a/mediagoblin/media_types/pdf/processing.py b/mediagoblin/media_types/pdf/processing.py index c7c85e20..f8aea7bb 100644 --- a/mediagoblin/media_types/pdf/processing.py +++ b/mediagoblin/media_types/pdf/processing.py @@ -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))))