This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install ExifTool from https://exiftool.org | |
import os | |
import subprocess | |
folder_path = '/Users/username/your/folder' # Replace with your folder path | |
for filename in os.listdir(folder_path): | |
if filename.lower().endswith(('.png', '.jpg', '.jpeg', '.tiff', '.bmp', '.gif', '.mp4')): | |
file_path = os.path.join(folder_path, filename) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import glob | |
import shutil | |
def collect_files(root_dir, target_dir): | |
if not os.path.exists(target_dir): | |
os.makedirs(target_dir) | |
# Find all .jpg and .mp4 files in the subdirectories | |
for extension in ['jpg', 'mp4']: |