mirror of
https://github.com/ciromattia/kcc
synced 2026-10-15 14:02:33 +00:00
add legacy extract warning (#1433)
This commit is contained in:
@@ -892,6 +892,13 @@ def mupdf_pdf_process_pages_parallel(filename, output_dir, target_width, target_
|
|||||||
|
|
||||||
cpu = cpu_count()
|
cpu = cpu_count()
|
||||||
|
|
||||||
|
if not render:
|
||||||
|
print('PDF input can also use legacy extract option if you have any problems')
|
||||||
|
if GUI:
|
||||||
|
GUI.addMessage.emit('PDF input can also use legacy extract option if you have any problems'
|
||||||
|
, 'info', False)
|
||||||
|
GUI.addMessage.emit('', '', False)
|
||||||
|
|
||||||
# make vectors of arguments for the processes
|
# make vectors of arguments for the processes
|
||||||
vectors = [(i, cpu, filename, output_dir, target_width, target_height, pdfwidth) for i in range(cpu)]
|
vectors = [(i, cpu, filename, output_dir, target_width, target_height, pdfwidth) for i in range(cpu)]
|
||||||
print("Starting %i processes for '%s'." % (cpu, filename))
|
print("Starting %i processes for '%s'." % (cpu, filename))
|
||||||
|
|||||||
@@ -112,6 +112,8 @@ def splitImage(work):
|
|||||||
imgProcess = imgEdges.point(lambda p: 255 if p > 6 else 0).convert('1', dither=Dither.NONE)
|
imgProcess = imgEdges.point(lambda p: 255 if p > 6 else 0).convert('1', dither=Dither.NONE)
|
||||||
|
|
||||||
widthImg, heightImg = imgOrg.size
|
widthImg, heightImg = imgOrg.size
|
||||||
|
if widthImg < 300:
|
||||||
|
raise UserWarning('PDF render failed < 300 px. Try legacy extract option instead.')
|
||||||
if heightImg > opt.height:
|
if heightImg > opt.height:
|
||||||
if opt.debug:
|
if opt.debug:
|
||||||
drawImg = Image.open(filePath).convert(mode='RGBA')
|
drawImg = Image.open(filePath).convert(mode='RGBA')
|
||||||
|
|||||||
Reference in New Issue
Block a user