Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
fix actually apply them last up.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitsofcotton authored Dec 6, 2023
1 parent e2899f7 commit 1628851
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,6 @@
elif(argv[2] == "shrinkapply"):
for t in range(0, int(argv[3])):
for line in argv[4:]:
cmds = []
for s in range(0, 3 * 4):
cmds.append(["sh", "-c", argv[1] + " - "])
subprocess.call(["convert", line, "-compress", "none", "-resize", str(100. / pow(2., float(int(argv[3]) - t))) + "%", line + "-orig.ppm"])
if(t != 0):
with open(line + "-orig.ppm") as f:
Expand All @@ -183,10 +180,13 @@
w = int(a[0])
h = int(a[1])
subprocess.call(["convert", line + "-orig.ppm-out.ppm", "-resize", str(w) + "x" + str(h) + "!", "-compress", "none", line + "-orig.ppm"])
subprocess.call(["gokibin", "separate", line + "-orig.ppm"])
for idx in range(0, 12):
cmds[idx][- 1] += line + "-orig.ppm-" + str(idx) + ".pgm "
cmds[idx][- 1] += " < shrinklearn-" + str(t) + "-" + str(idx) + ".txt"
subprocess.call(["cp", line + "-orig.ppm", line + "-orig.ppm-" + str(idx) + ".ppm"])
cmd = ["sh", "-c", argv[1] + " - "]
cmd[- 1] += line + "-orig.ppm-" + str(idx) + ".ppm "
cmd[- 1] += " < shrinklearn-" + str(int(argv[3]) - t - 1) + "-" + str(idx) + ".txt"
subprocess.call(cmd)
subprocess.call(["convert", line + "-orig.ppm-" + str(idx) + ".ppm", "-compress", "none", line + "-orig.ppm-" + str(idx) + ".pgm"])
subprocess.call(["gokibin", "integrate", line + "-orig.ppm"])
else:
for line in argv[3:]:
Expand Down

0 comments on commit 1628851

Please sign in to comment.