A lightweight, self-hosted image conversion web application built with PHP and vanilla JavaScript. Convert images between popular formats directly in your browser.
- π¨ Image Format Conversion: PNG, JPG, GIF, WEBP, BMP
- π±οΈ Drag & Drop Interface: Easy file upload with visual feedback
- π Real-time Progress: Upload progress tracking per file
- π Batch Conversion: Convert multiple files at once
- π¦ Bulk Download: Download all converted files as ZIP
- π― Per-file Format Selection: Choose different output formats for each file
- π Secure: File validation, unique filenames, temporary storage
- π¨ No Dependencies: Pure PHP with GD extension
| Input | Output |
|---|---|
| PNG, JPG, GIF, WEBP, BMP | PNG, JPG, GIF, WEBP, BMP |
- PHP 7.2 or higher
- PHP GD extension (enabled by default in most installations)
- Apache/Nginx web server
- 256MB memory limit (recommended)
-
Download and extract the project to your webroot:
C:\xampp\htdocs\convertify\ -
Verify PHP GD extension is enabled:
- Open
php.ini(XAMPP:C:\xampp\php\php.ini) - Ensure this line is uncommented:
extension=gd - Restart Apache
- Open
-
Create outputs directory (if not exists):
mkdir outputs chmod 755 outputs
-
Access the application:
http://localhost/convertify -
Test the setup:
- Visit
http://localhost/convertify/debug.phpto verify configuration
- Visit
-
Upload files to your domain directory (e.g.,
/public_html/convertify/) -
Set permissions:
outputs/folder:755or777.htaccessfiles:644
-
Verify PHP version in cPanel β Select PHP Version (7.2+)
-
Enable GD extension in cPanel β Select PHP Version β Extensions β Check
gd -
Test: Visit
https://yourdomain.com/convertify/debug.php
# Navigate to web directory
cd /var/www/html
# Clone or upload project
git clone https://github.com/kingnigma/convertify.git
cd convertify
# Set permissions
chmod 755 outputs
chmod 644 .htaccess
# Verify PHP and GD
php -v
php -m | grep gd
# Restart web server (if needed)
sudo systemctl restart apache2
# or
sudo systemctl restart nginxAdd to your server block:
location /convertify {
try_files $uri $uri/ /convertify/index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}Edit .htaccess to adjust limits:
php_value upload_max_filesize 100M
php_value post_max_size 100M
php_value memory_limit 256M
php_value max_execution_time 120Converted files are stored in outputs/. To auto-cleanup old files:
Linux (cron):
# Edit crontab
crontab -e
# Add cleanup job (runs every 30 minutes)
*/30 * * * * find /path/to/convertify/outputs -type f -mmin +30 -deleteWindows (Task Scheduler):
- Create task to run every 30 minutes
- Action:
forfiles /p "C:\xampp\htdocs\convertify\outputs" /m *.* /d -1 /c "cmd /c del @path"
-
Upload Files:
- Click the dropzone or drag & drop files
- Supports multiple files (max 10MB each)
-
Select Output Format:
- Choose format for each file individually
- Or use "Apply to all" for batch conversion
-
Convert:
- Click "Convert Now"
- Watch real-time upload progress
- Download individual files or all as ZIP
POST convert.php
curl -F "image=@input.png" -F "to=jpg" \
http://localhost/convertify/convert.phpResponse:
{
"success": true,
"url": "outputs/filename_abc123.jpg",
"filename": "filename_abc123.jpg"
}Error Response:
{
"success": false,
"error": "Unsupported file type"
}convertify/
βββ index.php # Main UI
βββ convert.php # Conversion API endpoint
βββ debug.php # Server diagnostics
βββ .htaccess # Apache configuration
βββ README.md # Documentation
βββ outputs/ # Converted files (auto-created)
β βββ .htaccess # Security rules
βββ assets/
βββ img/
βββ logo.png # Application logo
- Cause: PHP errors before JSON output
- Fix: Check
error.login project root, verify GD extension is enabled
- Cause: Insufficient permissions
- Fix:
chmod 755 outputsorchmod 777 outputs
- Cause: GD not enabled in PHP
- Fix: Enable in
php.iniand restart web server
- Cause: File too large or upload limits
- Fix: Increase limits in
.htaccessorphp.ini
- Cause: PHP version < 7.2 (BMP) or GD compiled without WEBP
- Fix: Update PHP or recompile GD with WEBP support
- β MIME type validation
- β File extension whitelist
- β Unique output filenames
- β Directory listing disabled
- β PHP execution blocked in outputs/
β οΈ No authentication (add if exposing publicly)β οΈ No rate limiting (implement for production)β οΈ Files stored temporarily (implement cleanup)
π¬ Video Conversion (via FFmpeg)
- MP4, MOV, AVI, WEBM
- Resolution/bitrate control
- Video compression
π΅ Audio Conversion (via FFmpeg)
- MP3, M4A, WAV, OGG, FLAC
- Bitrate adjustment
- Audio normalization
π Document Conversion (via LibreOffice)
- DOCX/DOC β PDF
- XLSX/XLS β PDF
- PPTX/PPT β PDF
- RTF β PDF
π¨ SVG Support (via ImageMagick)
- SVG β PNG/JPG
- Raster β SVG (tracing)
β‘ Performance Improvements
- Queue system for large files
- Background processing
- Server-side ZIP generation
π Security Enhancements
- User authentication
- API rate limiting
- File encryption at rest
π Advanced Features
- Image editing (crop, resize, rotate)
- Batch operations
- Conversion history
- Cloud storage integration
- FFmpeg (video/audio)
- LibreOffice (documents)
- ImageMagick (SVG)
- Redis/Database (queue system)
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Submit a pull request
MIT License - feel free to use in personal and commercial projects.
Mathew Kings
- π Portfolio: mkportfolio.crestdigico.com
- πΌ LinkedIn: linkedin.com/in/mathew-kings
- π¦ Twitter: @mathewkings9
- π§ Email: mk@crestdigico.com
- π Report bugs: GitHub Issues
- π¬ Discussions: GitHub Discussions
- π Documentation: This README
Star β this repo if you find it useful!