CareTV API Image Studio v009 - HEADLESS IMAGES

This is an incremental extension of v008. It does NOT claim to repair a running Apache installation without testing it.

INSTALL
1. Extract THIS INSTALLER ZIP once (this is software delivery, not generated image delivery).
2. Double-click install-v009.bat. It copies the new worker to C:\CareTV, preserving existing settings and outputs.
3. If PHP GD/ZIP are missing, run the repair command displayed by the installer. This creates a timestamped backup of php.ini, checks the DLLs and PHP CLI, and restores the backup on failure. Apache may require a manual restart.
4. Set OPENAI_API_KEY as a Windows environment variable OR create C:\CareTV\security\openai-image-key.txt containing only your key. Do not publish that file.
5. Double-click C:\CareTV\Run-Headless-Images-v009.bat. No image previews or web progress widgets are used. Images are saved to C:\CareTV\Images\YYYY-MM-DD.

BEHAVIOR
- 10 independently generated prompts; one original scene per API call. No reference image editing, collage extraction or multi-panel requests.
- Resumes without regenerating valid existing PNGs. Uses an exclusive process lock, atomic writes, JSON checkpoints, and retries for transient API errors.
- Output is 2048x2048 PNG. The native API request is 1024x1024; the 2048 version is GD resampled, not a claim of native 2048 detail. A future Topaz stage can improve apparent detail.
- Uses OpenAI Images API gpt-image-1.5, high quality; requires an eligible API account and paid usage. Up to ten image requests per run plus up to two retries per failure. Review API costs before running.
- No image appears in the browser, and no generated-image ZIP is created.
- Failure logs: C:\CareTV\logs\headless-v009.json; diagnostic repair log in same folder.

LIMITATIONS
- Code was syntax-checked here; Windows/XAMPP, API account access, network, permissions, and real image generation must be tested on the destination machine.
- The model may occasionally produce an unwanted line, panel, or text despite instructions; visual-content quality cannot be guaranteed by dimension checks.
- v008's existing PHP web endpoints are retained and may need separate hardening before exposure to any non-local network. Do not port-forward the XAMPP server.
- The key file is plaintext: protect it with Windows file permissions; prefer a protected environment variable.
