From ff15c3a63acbfa6364f256f05532198cdfb43155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Veres-Szentkir=C3=A1lyi?= Date: Wed, 20 Apr 2016 14:07:35 +0200 Subject: [PATCH] codegen: removed hardcoded test image file name --- pysstv/examples/codegen.py | 7 +++---- pysstv/examples/codeman.c | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pysstv/examples/codegen.py b/pysstv/examples/codegen.py index feeb37f..31fce68 100644 --- a/pysstv/examples/codegen.py +++ b/pysstv/examples/codegen.py @@ -106,14 +106,13 @@ def gen_matches(same_as, history, n): cur_start = i cur_end = tmp -def test(): +def test(img_file): from subprocess import Popen, PIPE, check_output from os import remove, path from PIL import Image from datetime import datetime import struct exe = './codegen-test-executable' - img_file = '320x256rgb.png' if not path.exists('stb_image.h'): from urllib import urlretrieve urlretrieve('https://raw.githubusercontent.com/nothings/stb/master/stb_image.h', 'stb_image.h') @@ -162,7 +161,7 @@ def test(): if __name__ == '__main__': from sys import argv - if len(argv) > 1 and argv[1] == 'test': - test() + if len(argv) > 2 and argv[1] == 'test': + test(argv[2]) else: print '\n'.join(main()) diff --git a/pysstv/examples/codeman.c b/pysstv/examples/codeman.c index 11ac0c0..082e449 100644 --- a/pysstv/examples/codeman.c +++ b/pysstv/examples/codeman.c @@ -1,7 +1,6 @@ #include #define STB_IMAGE_IMPLEMENTATION -#define STBI_ONLY_PNG #include "stb_image.h" #include "codegen.c"