Skip to content

Commit 15a6425

Browse files
jeremymanningclaude
andcommitted
Fix photo_already_processed check and reprocess Andy Kim's photo
- photo_already_processed() now checks square dimensions + transparent corners (RGBA) instead of just file existence, catching unprocessed photos that were placed directly in images/people/ - Reprocessed Andy Kim's photo with hand-drawn border (500x500) - Rebuilt people.html Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e64803d commit 15a6425

2 files changed

Lines changed: 37 additions & 1 deletion

File tree

images/people/andy_kim.png

-1.94 MB
Loading

scripts/onboard_member.py

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,8 +613,44 @@ def find_photo(photo_hint: str, project_root: Path) -> Optional[Path]:
613613

614614

615615
def photo_already_processed(photo_base: str, project_root: Path) -> bool:
616+
"""Check if a photo has already been processed with hand-drawn borders.
617+
618+
Verifies three conditions:
619+
1. The PNG file exists
620+
2. Resolution is 500x500 (the output size of add_borders.py)
621+
3. Corner pixels are transparent (borders leave transparent margins)
622+
"""
616623
processed_photo = project_root / "images" / "people" / f"{photo_base}.png"
617-
return processed_photo.exists()
624+
if not processed_photo.exists():
625+
return False
626+
627+
try:
628+
from PIL import Image
629+
img = Image.open(processed_photo)
630+
631+
w, h = img.size
632+
633+
# Check that image is square (bordered images are always square)
634+
if w != h:
635+
return False
636+
637+
# Check that corner pixels are transparent (hand-drawn borders
638+
# leave transparent margins around the image)
639+
if img.mode != 'RGBA':
640+
return False
641+
corners = [
642+
img.getpixel((0, 0)),
643+
img.getpixel((w - 1, 0)),
644+
img.getpixel((0, h - 1)),
645+
img.getpixel((w - 1, h - 1)),
646+
]
647+
# All corners should be fully transparent (alpha == 0)
648+
if not all(c[3] == 0 for c in corners):
649+
return False
650+
651+
return True
652+
except Exception:
653+
return False
618654

619655

620656
def process_photo(

0 commit comments

Comments
 (0)