Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Code is used only in this function
  • Loading branch information
Klaus Thoden committed Nov 28, 2018
1 parent 7d41c81 commit 335a85c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions libeoaconvert.py
Expand Up @@ -31,12 +31,6 @@ TRANSLATION_FILE = CONFIG['Auxiliaries']['TRANSLATIONS']

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"}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 335a85c

Please sign in to comment.