MCPcopy Create free account
hub / github.com/LCBOWER33/StegoScan / png

Function png

StegoScan.py:1118–1146  ·  view source on GitHub ↗
(output_dir)

Source from the content-addressed store, hash-verified

1116
1117
1118def png(output_dir):
1119 png_dir = os.path.join(output_dir, "png")
1120 if os.path.isdir(png_dir):
1121 for filename in tqdm(os.listdir(png_dir), desc="Zsteg test: "):
1122 # print("IN PNG")
1123 f = os.path.join(png_dir, filename)
1124 # checking if it is a file
1125 if os.path.isfile(f):
1126 # print(f)
1127 image_path = f
1128 """Run zsteg in WSL silently and capture output."""
1129 # wsl_image_path = image_path.replace("C:\\", "/mnt/c/").replace("\\", "/").lower()
1130 result = run_silent_command(f"zsteg -a {image_path}")
1131
1132 if result:
1133 png_dir = os.path.join(results_folder, "png")
1134 os.makedirs(png_dir, exist_ok=True)
1135
1136 shutil.copy(image_path, f"{png_dir}/{filename}")
1137
1138 base_name, _ = os.path.splitext(filename)
1139 new_filename = f"{base_name}.txt"
1140
1141 f = open(f"{png_dir}/{new_filename}", "w")
1142 f.write(result)
1143 f.close()
1144 prGreen(f"Zsteg Output:\n {result}")
1145
1146 prGreen("PNG TEST DONE")
1147
1148
1149# TODO make the mp3 to wave a funciton and not duplicated

Callers 2

start_progressFunction · 0.85
mainFunction · 0.85

Calls 2

run_silent_commandFunction · 0.85
prGreenFunction · 0.85

Tested by

no test coverage detected