No description
- Integrated Microsoft Authentication Library (MSAL) for secure login - Protected content is now hidden until successful authentication - Added login/logout functionality with proper state management - Updated client ID and redirect URI for production deployment - Authentication buttons positioned on left side of interface - Session storage maintains authentication state across page reloads 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .DS_Store | ||
| alt_text.svg | ||
| config.php | ||
| favicon.ico | ||
| index.php | ||
| README.md | ||
Alt Text Generator
A PHP web application that generates accessible alternative text for images using OpenAI's GPT-4 Vision API. This tool helps create both short and long alt text descriptions that comply with accessibility guidelines.
Features
- Bulk Image Processing: Upload and process multiple images simultaneously
- Dual Alt Text Generation: Creates both short (150 characters) and long (400 characters) alt text versions
- OpenAI Integration: Uses GPT-4 Vision API for intelligent image analysis
- Export Options: Download results as CSV or individual text files
- Real-time Processing: Live status updates as images are processed
- Responsive Design: Works on desktop and mobile devices
Requirements
- PHP 7.4 or higher
- Web server (Apache/Nginx)
- OpenAI API key
- Internet connection for API calls
Installation
- Clone or download this repository to your web server directory
- Copy
config.phpand add your OpenAI API key:return [ 'openai_key' => 'your-openai-api-key-here', 'openai_model' => 'gpt-4o', 'system_prompt' => '...' // Pre-configured for accessibility ]; - Ensure the following directories are writable:
uploads/- for temporary image storagelogs/- for API response logging
Usage
- Open the application in your web browser
- Click "Upload Images" to select one or more image files (PNG, JPG, JPEG)
- Images will be processed automatically and display:
- Processing status for each image
- Short alt text (≤150 characters)
- Long alt text (≤400 characters)
- Once processing is complete, you can:
- Download all results as a CSV file
- Download individual text files for each image
Configuration
The application can be customized via config.php:
- openai_key: Your OpenAI API key
- openai_model: AI model to use (default: gpt-4o)
- system_prompt: Instructions for the AI on how to generate alt text
Alt Text Guidelines
The application follows Microsoft's accessibility guidelines:
- Avoids redundant phrases like "image of" or "picture of"
- Focuses on the most important elements
- Includes overlayed text when present
- Provides factual, non-subjective descriptions
- Optimized for screen reader technology
File Structure
alt-text-generator/
├── index.php # Main application file
├── config.php # Configuration settings
├── alt_text.svg # Application logo
├── favicon.ico # Site favicon
├── uploads/ # Temporary image storage
└── logs/ # API response logs
Security Notes
- Images are temporarily stored in the
uploads/directory - API responses are logged for debugging purposes
- Ensure proper file permissions on directories
- Keep your OpenAI API key secure
Troubleshooting
- Check
logs/openai_responses.logfor API errors - Ensure your OpenAI API key has sufficient credits
- Verify file upload permissions on the
uploads/directory - Check PHP error logs for server-side issues
License
This project is provided as-is for educational and business use.