Permalink
Browse files

Code is used only in this function

  • Loading branch information...
kthoden committed Nov 28, 2018
1 parent 7d41c81 commit 335a85c5899f2829543e8851dd5a0239260b2af4
Showing with 7 additions and 7 deletions.
  1. +7 −7 libeoaconvert.py
@@ -31,12 +31,6 @@

logging.basicConfig(level=LOGLEVEL, format='%(asctime)s - %(levelname)s - %(message)s')

if not os.path.exists("tmp_files/tmp_images/"):
os.makedirs(os.path.expanduser("tmp_files/tmp_images/"))

tmp_image_dir = os.getcwd() + "/tmp_files/tmp_images/"
Datei = open('tmp_files/xelatex-run-images.log', 'w')

# Setup of various dictionaries for localization of various elements
# dictLangFootnotes = {"it" : "Note a piè pagina", "fr" : "notes en bas de page", "de" : "Fußnoten", "en" : "Footnotes"}
# dict_and = {"en" : "and", "de" : "und", "fr" : "et", "it" : "e"}
@@ -85,6 +79,12 @@ def get_bigfoot_data(chapter):
def sanitizeImage(strImagepath, GM_PATH, TL_PATH):
"""Adjust and convert image for epub standard"""

if not os.path.exists("tmp_files/tmp_images/"):
os.makedirs(os.path.expanduser("tmp_files/tmp_images/"))

tmp_image_dir = os.getcwd() + "/tmp_files/tmp_images/"
xelatex_sanitizeimage_logfile = open('tmp_files/xelatex-run-images.log', 'w')

logging.debug(strImagepath)
strCommand = GM_PATH + " identify -format \"%w\" " + strImagepath
listArguments = shlex.split(strCommand)
@@ -133,7 +133,7 @@ def sanitizeImage(strImagepath, GM_PATH, TL_PATH):
logging.debug(Kommando)

Argumente = shlex.split(Kommando)
subprocess.call(Argumente, cwd=tmp_image_dir, stdout=Datei)
subprocess.call(Argumente, cwd=tmp_image_dir, stdout=xelatex_sanitizeimage_logfile)

strCommand = GM_PATH + " convert -density 400 " + clipped_file + " " + strNewImagepath + ".png"
listArguments = shlex.split(strCommand)

0 comments on commit 335a85c

Please sign in to comment.