include '.png' in filename
authorRodney Ewing <ewing.rj@gmail.com>
Wed, 14 Aug 2013 18:34:31 +0000 (11:34 -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 906be4365806a608b5f291c21ca176d5c62c4261..c7c85e2023bb668432d697dd82b2243be759b968 100644 (file)
@@ -281,7 +281,9 @@ class CommonPdfProcessor(MediaProcessor):
         _log.debug('calling {0}'.format(repr(' '.join(args))))
         Popen(executable=executable, args=args).wait()
 
-        store_public(self.entry, 'thumb', thumb_filename,
+        # since pdftocairo added '.png', we need to include it with the
+        # filename
+        store_public(self.entry, 'thumb', thumb_filename + '.png',
                      self.name_builder.fill('{basename}.thumbnail.png'))
 
     def _generate_pdf(self):
@@ -324,7 +326,9 @@ class CommonPdfProcessor(MediaProcessor):
         _log.debug('calling {0}'.format(repr(' '.join(args))))
         Popen(executable=executable, args=args).wait()
 
-        store_public(self.entry, 'thumb', filename,
+        # since pdftocairo added '.png', we need to include it with the
+        # filename
+        store_public(self.entry, 'thumb', filename + '.png',
                      self.name_builder.fill('{basename}.medium.png'))