| 89 | |
| 90 | |
| 91 | def list_image_paths(directory): |
| 92 | image_extensions = ('.png', '.jpg', '.jpeg', '.gif', '.bmp', '.tiff') |
| 93 | |
| 94 | image_paths = [] |
| 95 | |
| 96 | for root, dirs, files in os.walk(directory): |
| 97 | for file in files: |
| 98 | if file.lower().endswith(image_extensions): |
| 99 | relative_path = os.path.relpath(os.path.join(root, file), |
| 100 | directory) |
| 101 | full_path = os.path.join(directory, relative_path) |
| 102 | image_paths.append(full_path) |
| 103 | image_paths = sorted(image_paths) |
| 104 | return image_paths |
| 105 | |
| 106 | |
| 107 | def find_file_in_current_dir_and_subdirs(file_name): |