full_tile_widths can be 0 for items with many parts
This commit is contained in:
parent
0f0f5f42d8
commit
400162e400
1 changed files with 16 additions and 14 deletions
|
@ -9,13 +9,7 @@ import re
|
|||
from PIL import Image
|
||||
from ox.utils import json
|
||||
|
||||
|
||||
def join_tiles(source_paths, durations, target_path):
|
||||
'''
|
||||
This is an implementation of a join_tiles function for new-style timelines.
|
||||
Timelines of files will be read from source_paths, the timeline of the item will
|
||||
be written to target_path.
|
||||
'''
|
||||
__all__ = ['join_tiles', 'split_tiles']
|
||||
|
||||
def divide(num, by):
|
||||
# divide(100, 3) -> [33, 33, 34]
|
||||
|
@ -26,6 +20,13 @@ def join_tiles(source_paths, durations, target_path):
|
|||
arr.append(div + (i > by - 1 - mod))
|
||||
return arr
|
||||
|
||||
def join_tiles(source_paths, durations, target_path):
|
||||
'''
|
||||
This is an implementation of a join_tiles function for new-style timelines.
|
||||
Timelines of files will be read from source_paths, the timeline of the item will
|
||||
be written to target_path.
|
||||
'''
|
||||
|
||||
def get_file_info(file_name):
|
||||
for mode in modes:
|
||||
if re.match('^timeline' + mode + '64p\d+\.jpg', file_name):
|
||||
|
@ -84,6 +85,7 @@ def join_tiles(source_paths, durations, target_path):
|
|||
#print(image_file)
|
||||
if mode == full_tile_mode:
|
||||
# render full tile
|
||||
if data['full_tile_widths'][0]:
|
||||
resized = data['target_images']['large'].resize((
|
||||
data['full_tile_widths'][0], large_tile_h
|
||||
), Image.ANTIALIAS)
|
||||
|
|
Loading…
Reference in a new issue