rabin %!s(int64=5) %!d(string=hai) anos
pai
achega
be316bfc62
Modificáronse 1 ficheiros con 16 adicións e 16 borrados
  1. 16 16
      service/convert.py

+ 16 - 16
service/convert.py

@@ -305,22 +305,22 @@ class Convert(object):
 		from pdf2jpg import pdf2jpg
 		from wand.image import Image
 		result = pdf2jpg.convert_pdf2jpg(info['pdf'], dest, pages="0,1")
-        
-        i = 0
-        for j in result[0]['output_jpgfiles']:
-          source = j
-          if i == 0:
-			dest = info['html'] + '.jpg'
-          else:
-            dest = info['html'] + '.jpg_' + i + '.jpg'
-          command = 'mv '+source+' ' + dest
-          Shell.popen(command)
-          target_width = 300
-          with Image(filename=dest) as img:
-              target_width, target_height = self.getSize(target_width, img.width, img.height)
-              img.sample(target_width, target_height)
-              img.save(filename=dest)
-          i = i+1
+
+		i = 0
+		for j in result[0]['output_jpgfiles']:
+			source = j
+			if i == 0:
+				dest = info['html'] + '.jpg'
+			else:
+				dest = info['html'] + '.jpg_' + i + '.jpg'
+			command = 'mv '+source+' ' + dest
+			Shell.popen(command)
+			target_width = 300
+			with Image(filename=dest) as img:
+				target_width, target_height = self.getSize(target_width, img.width, img.height)
+				img.sample(target_width, target_height)
+				img.save(filename=dest)
+			i = i+1
 
 		'''
 		from wand.image import Image