Skip to content

Commit

Permalink
Remove the process folder
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Mar 30, 2019
1 parent 8c1b4ca commit 808a3c6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions process
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,6 @@ def transform(config, config_file_name, root_folder):
if config['args']['assisted_split']:
config['assisted_split'] = []

dest_folder = os.path.join(root_folder, 'process') # TODO, pylint: disable=fixme
if not os.path.exists(dest_folder):
os.makedirs(dest_folder)
for index, img in enumerate(config['images']):
Expand Down Expand Up @@ -560,7 +559,8 @@ def split(config, root_folder, config_file_name):
else:
value = width if vertical else height
margin = 0
img2 = os.path.join(root_folder, 'process', 'image-{}.png'.format(destination)) # TODO, pylint: disable=fixme
process_file = tempfile.NamedTemporaryFile(suffix='.png')
img2 = process_file.name
if vertical:
call(CONVERT + [
'-crop', '{}x{}+{}+0'.format(value - margin - last_pos, height, last_pos), img, img2
Expand Down Expand Up @@ -599,7 +599,8 @@ def split(config, root_folder, config_file_name):
if element['vertical'] != vertical:
raise Exception("Mix of limit type for pahe '{}'".format(page))

img = os.path.join(root_folder, 'process', 'image-{}.png'.format(page))
process_file = tempfile.NamedTemporaryFile(suffix='.png')
img = process_file.name
call(CONVERT + [e['name'] for e in sorted(items, key=lambda e: e['pos'])] + [
'-background', '#ffffff', '-append' if vertical else '+append', img
])
Expand Down

0 comments on commit 808a3c6

Please sign in to comment.