From b4d8fedf74dda28a286aa144f8d64fbd0e9c450a Mon Sep 17 00:00:00 2001 From: Niles Rogoff Date: Mon, 11 Jul 2016 17:46:56 -0400 Subject: [PATCH] Fixed bug where only the first 48 tests would run correctly. Fixed bug where the progress bar would not update correctly and would display an incomplete bar even if the image was done --- 2bit.py | 3 ++- test/run.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/2bit.py b/2bit.py index 1e5e08f..0ca02f5 100644 --- a/2bit.py +++ b/2bit.py @@ -37,7 +37,7 @@ for x in range(image.width): for y in range(image.height): i += 1 bar.index = i - if i % 200 == 0: bar.update() + if i % 193 == 0: bar.update() # I used to use 200 but then the last two digits of the current status were always "00" which made it look like the progress bar was fake pos = (x,y) color = image.getpixel(pos) if len(color) == 4: @@ -54,4 +54,5 @@ for x in range(image.width): color[z] = colors[index] out.putpixel(pos, tuple(color)) out.save(outfile) +bar.update() # Otherwise it will display the last multiple of 193 out of the total value bar.finish() diff --git a/test/run.py b/test/run.py index de57387..9bf9b8e 100644 --- a/test/run.py +++ b/test/run.py @@ -12,6 +12,7 @@ max_i = len(files) * (16*3) def getparams(i): percolor = dither = False + i %= 48 if i % 16 >= 8: percolor = True if i >= 16: @@ -44,3 +45,4 @@ for f in files: print("On " + outfilename) subprocess.call(["python3", "../2bit.py", f, outfilename, bits_formatted, *percolor, *dither]) i += 1 +print("Done")