"""Crop only the real Explorer file-list area; preserve the original capture."""
from pathlib import Path
from PIL import Image

root = Path(__file__).resolve().parents[1]
original = root / 'work' / 'capture_originals_20261003' / 'project_folder.png'
output = root / 'screenshots' / 'appendix_a' / 'project_folder_20261003.png'
with Image.open(original) as image:
    # Exclude profile breadcrumb and unrelated pinned folders, not alter UI content.
    image.crop((160, 116, 790, 780)).save(output)
print('Saved privacy-safe copy of actual Explorer file list.')
launcher = root / 'work' / 'capture_originals_20261003' / 'launcher_file.png'
if launcher.exists():
    with Image.open(launcher) as image:
        image.crop((160, 554, 790, 790)).save(root / 'screenshots' / 'appendix_a' / 'launcher_file_20261003.png')
    print('Saved actual launcher file list, excluding profile breadcrumb.')
database = root / 'work' / 'capture_originals_20261003' / 'database_files.png'
if database.exists():
    with Image.open(database) as image:
        image.crop((160, 116, 790, 780)).save(root / 'screenshots' / 'appendix_a' / 'database_files_20261003.png')
    print('Saved actual SQL filenames, not database content or installer proof.')
config = root / 'work' / 'capture_originals_20261003' / 'config_files.png'
if config.exists():
    with Image.open(config) as image:
        image.crop((160, 116, 790, 220)).save(root / 'screenshots' / 'appendix_a' / 'config_files_20261003.png')
    print('Saved config filenames only; no secret values were captured.')
