Add Bat Image
Overview
Generate BatDigest image variants from a provided long cutout, upload them to R2, and register the resulting static paths in data/images.yaml for the correct bat id.
Workflow
- •Confirm the target bat and images
- •Verify the bat id in
data/bats.yamland captureyear,brand,model, andleague. - •Require a long cutout image in
AGENTS/Content_Creation/BAT_LISTINGS_Agent/Image_Processing/. - •If a matching feature image is already present, use it; otherwise generate it.
- •Generate a feature image (if missing)
- •Run
create_feature_bat.pyand save the output next to the long image. - •Naming rule: if the long filename contains
Long, replace withFeature; otherwise appendFeaturebefore the extension.
- •Generate variants and upload to R2
- •Run
process_and_upload_bat_images_to_r2.pyusing the bat metadata and the feature/long image paths. - •Capture the
static_pathsoutput from the script (do not hand-write URLs).
- •Update
data/images.yaml
- •Add a new entry under
images: <BAT_ID>:if missing. - •Set
feature_large,feature_carousel,feature_thumb,long_large,long_400, andlong_300using the script output. - •Keep
feature_fullandlong_fullblank unless original source paths are provided. - •Do not overwrite existing image entries unless the user explicitly requests it.
Paths and Commands
Repository defaults:
- •Repo root:
~/Coding_Projects/batdigest-flask - •Images staging:
AGENTS/Content_Creation/BAT_LISTINGS_Agent/Image_Processing/
Commands:
bash
python AGENTS/Content_Creation/BAT_LISTINGS_Agent/create_feature_bat.py --input "<LONG_IMAGE_PATH>" --output "<FEATURE_IMAGE_PATH>"
bash
python3 AGENTS/Content_Creation/BAT_LISTINGS_Agent/process_and_upload_bat_images_to_r2.py \ --year <YEAR> \ --brand "<BRAND>" \ --model "<MODEL>" \ --league <bbcor|usssa|usa|fastpitch> \ --feature-image "<FEATURE_IMAGE_PATH>" \ --long-image "<LONG_IMAGE_PATH>"
References
For full details and edge cases, read references/Bat_Image_Attach_Agent.md.