Compare commits
No commits in common. "e1f7c784ad83e0252b682f780d852ecc1c2f1eb5" and "e78cab788f183275680128162b3841bd3b4d6d76" have entirely different histories.
e1f7c784ad
...
e78cab788f
2 changed files with 5 additions and 14 deletions
|
|
@ -642,7 +642,5 @@ def chop(video, start, end, subtitles=None):
|
||||||
p.wait()
|
p.wait()
|
||||||
f = open(choped_video, 'rb')
|
f = open(choped_video, 'rb')
|
||||||
os.unlink(choped_video)
|
os.unlink(choped_video)
|
||||||
if subtitles_f and os.path.exists(subtitles_f):
|
|
||||||
os.unlink(subtitles_f)
|
|
||||||
os.rmdir(tmp)
|
os.rmdir(tmp)
|
||||||
return f
|
return f
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import os
|
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
|
@ -23,17 +22,11 @@ def pdfinfo(pdf):
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def extract_pdfpage(pdf, image, page):
|
def extract_pdfpage(pdf, image, page):
|
||||||
page = str(page)
|
page -= 1
|
||||||
cmd = [
|
cmd = ['convert', '%s[%d]' % (pdf, page),
|
||||||
'pdftocairo',
|
'-background', 'white', '-flatten', '-resize', '1024x1024', image]
|
||||||
'-jpeg',
|
p = subprocess.Popen(cmd, close_fds=True)
|
||||||
'-f', page, '-l', page,
|
p.wait()
|
||||||
'-singlefile',
|
|
||||||
'-scale-to', '2048',
|
|
||||||
pdf,
|
|
||||||
os.path.splitext(image)[0]
|
|
||||||
]
|
|
||||||
subprocess.call(cmd, stdout=open('/dev/null', 'wb'))
|
|
||||||
return image
|
return image
|
||||||
|
|
||||||
def get_documents(text):
|
def get_documents(text):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue