(output_dir)
| 660 | |
| 661 | |
| 662 | def process_images(output_dir): |
| 663 | # Define the folders for jpg and png images |
| 664 | folders = ['jpg', 'png'] |
| 665 | |
| 666 | # Create the bin_files directory if it doesn't exist |
| 667 | bin_dir = os.path.join(output_dir, "bin") |
| 668 | if not os.path.exists(bin_dir): |
| 669 | os.makedirs(bin_dir) |
| 670 | |
| 671 | png_dir = os.path.join(output_dir, "png") |
| 672 | if os.path.isdir(png_dir): |
| 673 | for filename in os.listdir(png_dir): |
| 674 | f = os.path.join(png_dir, filename) |
| 675 | # checking if it is a file |
| 676 | if os.path.isfile(f): |
| 677 | # print(bin_dir) |
| 678 | filename_with_extension = os.path.basename(filename) |
| 679 | filename_without_extension = os.path.splitext(filename_with_extension)[0] |
| 680 | out_file = str(bin_dir + "/" + filename_without_extension + ".bin") |
| 681 | convert_image_to_bin(f, out_file) |
| 682 | # print(f"Converted {filename} to {out_file}") |
| 683 | |
| 684 | jpg_dir = os.path.join(output_dir, "jpg") |
| 685 | if os.path.isdir(jpg_dir): |
| 686 | for filename in os.listdir(jpg_dir): |
| 687 | f = os.path.join(jpg_dir, filename) |
| 688 | # checking if it is a file |
| 689 | if os.path.isfile(f): |
| 690 | # print(bin_dir) |
| 691 | filename_with_extension = os.path.basename(filename) |
| 692 | filename_without_extension = os.path.splitext(filename_with_extension)[0] |
| 693 | out_file = str(bin_dir + "/" + filename_without_extension + ".bin") |
| 694 | convert_image_to_bin(f, out_file) |
| 695 | # print(f"Converted {filename} to {out_file}") |
| 696 | |
| 697 | |
| 698 | def is_meaningful_text(text): |
no test coverage detected