libansilove

Library for converting ANSI, ASCII, and other formats to PNG
Log | Files | Refs | README | LICENSE

commit 7eb7e3a3aa022076dd34d6449e8221fe506bdd66
parent af239075bcb01aab3e22695c06f72c6b21e7ea24
Author: Frederic Cambus <fred@statdns.com>
Date:   Wed, 26 Sep 2018 10:32:08 +0200

Set default value for columns in the binary loader

Diffstat:
Msrc/loaders/binary.c | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/loaders/binary.c b/src/loaders/binary.c @@ -28,6 +28,9 @@ int ansilove_binary(struct ansilove_ctx *ctx, struct ansilove_options *options) // libgd image pointers gdImagePtr canvas; + // Default to 160 columns if columns option wasn't set + options->columns = options->columns ? options->columns : 160; + // allocate buffer image memory canvas = gdImageCreate(options->columns * options->bits, ((ctx->length / 2) / options->columns * fontData.height));