commit c9a91db1e21bb656e2f4bc34b17e30c543b24007
parent 435bfb97fe3609c8d85f39a0bc6e86120f88e7a0
Author: Frederic Cambus <fred@statdns.com>
Date: Wed, 4 Jul 2018 08:58:26 +0200
Rework DIZ files handling, there is now a diz bool in the output structure
Diffstat:
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/include/ansilove.h b/include/ansilove.h
@@ -19,7 +19,6 @@
struct input {
unsigned char *buffer;
size_t length;
- char *fext;
};
struct output {
@@ -29,6 +28,7 @@ struct output {
uint32_t bits;
uint32_t columns;
char *mode;
+ bool diz;
bool icecolors;
uint32_t retinaScaleFactor;
};
diff --git a/src/loaders/ansi.c b/src/loaders/ansi.c
@@ -32,7 +32,6 @@ int ansilove_ansi(struct input *inputFile, struct output *outputFile)
int32_t columns = 80;
- bool isDizFile = false;
bool ced = false;
bool transparent = false;
bool workbench = false;
@@ -51,10 +50,6 @@ int ansilove_ansi(struct input *inputFile, struct output *outputFile)
workbench = true;
}
- // check if current file has a .diz extension
- if (!strcmp(inputFile->fext, ".diz"))
- isDizFile = true;
-
// libgd image pointers
gdImagePtr canvas;
@@ -384,7 +379,7 @@ int ansilove_ansi(struct input *inputFile, struct output *outputFile)
if (ced)
columns = 78;
- if (isDizFile)
+ if (outputFile->diz)
columns = fmin(columnMax, 80);
// create that damn thingy