|
|
@ -100,16 +100,27 @@ class Block: |
|
|
|
blocks = [ Block(file) for file in files ] |
|
|
|
height = sum(b.height() for b in blocks) |
|
|
|
|
|
|
|
result = PIL.Image.new("RGB", (112, height)) |
|
|
|
left_height = 0 |
|
|
|
for b in blocks: |
|
|
|
left_height += b.height() |
|
|
|
if 2 * left_height >= height: break |
|
|
|
|
|
|
|
result = PIL.Image.new("RGB", (2 * 112 + 8, left_height), color=WHITE) |
|
|
|
|
|
|
|
x = 0 |
|
|
|
y = 0 |
|
|
|
|
|
|
|
for b in blocks: |
|
|
|
header = b.header() |
|
|
|
result.paste(header, (0, y)) |
|
|
|
result.paste(header, (x, y)) |
|
|
|
y += header.height |
|
|
|
|
|
|
|
body = b.body() |
|
|
|
result.paste(body, (0, y)) |
|
|
|
result.paste(body, (x, y)) |
|
|
|
y += body.height |
|
|
|
|
|
|
|
if y >= left_height: |
|
|
|
y = 0 |
|
|
|
x += 112 + 8 |
|
|
|
|
|
|
|
result.save("uf5x7.png") |