Add pdftopng
parent
715e8a9769
commit
57a26fabcb
|
|
@ -208,17 +208,10 @@ class Lattice(BaseParser):
|
|||
return t
|
||||
|
||||
def _generate_image(self):
|
||||
from ..ext.ghostscript import Ghostscript
|
||||
from pdftopng import pdftopng
|
||||
|
||||
self.imagename = "".join([self.rootname, ".png"])
|
||||
gs_call = "-q -sDEVICE=png16m -o {} -r{} {}".format(
|
||||
self.imagename, self.resolution, self.filename
|
||||
)
|
||||
gs_call = gs_call.encode().split()
|
||||
null = open(os.devnull, "wb")
|
||||
with Ghostscript(*gs_call, stdout=null) as gs:
|
||||
pass
|
||||
null.close()
|
||||
pdftopng.convert(pdf_path=self.filename, png_path=self.rootname)
|
||||
|
||||
def _generate_table_bbox(self):
|
||||
def scale_areas(areas):
|
||||
|
|
|
|||
70
setup.py
70
setup.py
|
|
@ -24,7 +24,10 @@ requires = [
|
|||
"tabulate>=0.8.9",
|
||||
]
|
||||
|
||||
cv_requires = ["opencv-python>=3.4.2.17"]
|
||||
base_requires = [
|
||||
'opencv-python>=3.4.2.17',
|
||||
'pdftopng>=0.1.0'
|
||||
]
|
||||
|
||||
plot_requires = [
|
||||
"matplotlib>=2.2.3",
|
||||
|
|
@ -40,44 +43,41 @@ dev_requires = [
|
|||
"sphinx-autobuild>=2021.3.14",
|
||||
]
|
||||
|
||||
all_requires = cv_requires + plot_requires
|
||||
all_requires = base_requires + plot_requires
|
||||
dev_requires = dev_requires + all_requires
|
||||
|
||||
|
||||
def setup_package():
|
||||
metadata = dict(
|
||||
name=about["__title__"],
|
||||
version=about["__version__"],
|
||||
description=about["__description__"],
|
||||
long_description=readme,
|
||||
long_description_content_type="text/markdown",
|
||||
url=about["__url__"],
|
||||
author=about["__author__"],
|
||||
author_email=about["__author_email__"],
|
||||
license=about["__license__"],
|
||||
packages=find_packages(exclude=("tests",)),
|
||||
install_requires=requires,
|
||||
extras_require={
|
||||
"all": all_requires,
|
||||
"cv": cv_requires,
|
||||
"dev": dev_requires,
|
||||
"plot": plot_requires,
|
||||
},
|
||||
entry_points={
|
||||
"console_scripts": [
|
||||
"camelot = camelot.cli:cli",
|
||||
],
|
||||
},
|
||||
classifiers=[
|
||||
# Trove classifiers
|
||||
# Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Programming Language :: Python :: 3.6",
|
||||
"Programming Language :: Python :: 3.7",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
],
|
||||
)
|
||||
metadata = dict(name=about['__title__'],
|
||||
version=about['__version__'],
|
||||
description=about['__description__'],
|
||||
long_description=readme,
|
||||
long_description_content_type="text/markdown",
|
||||
url=about['__url__'],
|
||||
author=about['__author__'],
|
||||
author_email=about['__author_email__'],
|
||||
license=about['__license__'],
|
||||
packages=find_packages(exclude=('tests',)),
|
||||
install_requires=requires,
|
||||
extras_require={
|
||||
'all': all_requires,
|
||||
'base': base_requires,
|
||||
'dev': dev_requires,
|
||||
'plot': plot_requires
|
||||
},
|
||||
entry_points={
|
||||
'console_scripts': [
|
||||
'camelot = camelot.cli:cli',
|
||||
],
|
||||
},
|
||||
classifiers=[
|
||||
# Trove classifiers
|
||||
# Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
|
||||
'License :: OSI Approved :: MIT License',
|
||||
'Programming Language :: Python :: 3.6',
|
||||
'Programming Language :: Python :: 3.7',
|
||||
'Programming Language :: Python :: 3.8'
|
||||
])
|
||||
|
||||
try:
|
||||
from setuptools import setup
|
||||
|
|
|
|||
Loading…
Reference in New Issue