(output_dir)
| 964 | |
| 965 | # TODO add in the new test and replace one old |
| 966 | def t_lsb(output_dir): |
| 967 | def process_file(f, filename): |
| 968 | try: |
| 969 | hidden_message = lsb.reveal(f) |
| 970 | lsb_dir = os.path.join(results_folder, "lsb") |
| 971 | os.makedirs(lsb_dir, exist_ok=True) |
| 972 | shutil.copy(f, os.path.join(lsb_dir, filename)) |
| 973 | prGreen(f"[LSB] Hidden message detected in {filename}") |
| 974 | except: |
| 975 | pass |
| 976 | |
| 977 | png_dir = os.path.join(output_dir, "png") |
| 978 | if os.path.isdir(png_dir): |
| 979 | files = [f for f in os.listdir(png_dir) if os.path.isfile(os.path.join(png_dir, f))] |
| 980 | with ThreadPoolExecutor(max_workers=os.cpu_count() - 1) as executor: |
| 981 | for filename in tqdm(files, desc="LSB test: "): |
| 982 | f = os.path.join(png_dir, filename) |
| 983 | executor.submit(process_file, f, filename) |
| 984 | prGreen("LSB TEST DONE") |
| 985 | |
| 986 | |
| 987 | def image_integrity(output_dir): |
no test coverage detected