Korekturovátko: Snad fix rozbitého ImageMagicku
This commit is contained in:
parent
30ff8b9f20
commit
0eadd8fcda
1 changed files with 17 additions and 8 deletions
|
@ -82,16 +82,25 @@ class KorekturovanePDF(models.Model):
|
||||||
self.stran = 0
|
self.stran = 0
|
||||||
while True:
|
while True:
|
||||||
res = subprocess.call([
|
res = subprocess.call([
|
||||||
"convert",
|
#Parametry inspirovány chybovou hláškou imagemagicku
|
||||||
"-density", "180x180",
|
"gs",
|
||||||
"-geometry", " 1024x1448",
|
"-sstdout=%stderr",
|
||||||
"%s[%d]" % (self.pdf.path, self.stran),
|
"-dSAFER",
|
||||||
os.path.join(
|
"-dNOPAUSE",
|
||||||
|
"-dBATCH",
|
||||||
|
"-dNOPROMPT",
|
||||||
|
"-sDEVICE=pngalpha",
|
||||||
|
"-r180x180",
|
||||||
|
"-dFirstPage=%d" % (self.stran+1),
|
||||||
|
"-dLastPage=%d" % (self.stran+1),
|
||||||
|
"-sOutputFile="+os.path.join(
|
||||||
dirname,
|
dirname,
|
||||||
"%s-%d.png" % (self.get_prefix(), self.stran)
|
"%s-%d.png" % (self.get_prefix(), self.stran)),
|
||||||
)
|
"-f%s" % (self.pdf.path)
|
||||||
])
|
])
|
||||||
if res == 1:
|
if not os.path.exists(os.path.join(
|
||||||
|
dirname,
|
||||||
|
"%s-%d.png" % (self.get_prefix(), self.stran))):
|
||||||
break
|
break
|
||||||
self.stran += 1
|
self.stran += 1
|
||||||
# Změnil se počet stran, ukládáme
|
# Změnil se počet stran, ukládáme
|
||||||
|
|
Loading…
Reference in a new issue