sync moved to modules
This commit is contained in:
1 parent
1dda6ce8cc
commit
13b761a81e
50 files changed
No files matched your search
@@ -0,0 +1,35 @@
|
||||
import asyncio
|
||||
from subprocess import call
|
||||
|
||||
|
||||
async def image_magick_resize(input_file, output_file, size, quality=85):
|
||||
interlace = 'Plane'
|
||||
s = '%dx%d' % size
|
||||
|
||||
cmd = [
|
||||
'/usr/local/bin/convert',
|
||||
'"%s"' % input_file,
|
||||
|
||||
'-strip',
|
||||
'-interlace', interlace,
|
||||
'-auto-orient',
|
||||
'-resize', s,
|
||||
'-quality', str(quality),
|
||||
|
||||
'"%s"' % output_file,
|
||||
]
|
||||
|
||||
cmd = ' '.join(cmd)
|
||||
process = await asyncio.create_subprocess_shell(cmd)
|
||||
await process.wait()
|
||||
|
||||
|
||||
async def image_magick_pdf_to_img(input_file, output_file):
|
||||
call([
|
||||
'/usr/local/bin/gs',
|
||||
'-q',
|
||||
'-sDEVICE=jpeg',
|
||||
'-dLastPage=1',
|
||||
'-o', output_file,
|
||||
input_file,
|
||||
])
|
||||
Reference in new issue
Block a user