Download the PHP package vishal-pawar/image-convert without Composer
On this page you can find all versions of the php package vishal-pawar/image-convert. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vishal-pawar/image-convert
More information about vishal-pawar/image-convert
Files in vishal-pawar/image-convert
Package image-convert
Short Description this package can convert you image into webp and desired resolution
License MIT
Informations about the package image-convert
🖼️ Image Convert
A powerful PHP package for converting images to WebP format and resizing them with optional object storage support.
✨ Features
- 🚀 Fast WebP Conversion - Convert JPG/PNG images to WebP format
- 📐 Smart Resizing - Resize images to desired dimensions
- ☁️ Object Storage Support - Save directly to cloud storage (DigitalOcean Spaces, AWS S3)
- 🎯 Simple API - Easy-to-use helper functions
- 🔧 Laravel Integration - Seamless integration with Laravel applications
📦 Installation
Install the package via Composer:
🚀 Quick Start
📚 API Reference
Available Methods
Method | Description |
---|---|
saveImage() |
Save image in original format |
resizeSaveImage() |
Resize and save image |
saveWebpImage() |
Convert to WebP and save |
resizeSaveWebpImage() |
Resize, convert to WebP and save |
Method Details
saveImage(path, image, objectStore?)
Save an image in its original format.
Parameters:
path
(string) - Directory path (e.g., 'uploads/images')image
(file) - Image file objectobjectStore
(boolean, optional) - Enable object storage (default: false)
Example:
resizeSaveImage(path, image, height, width, objectStore?)
Resize and save an image.
Parameters:
path
(string) - Directory pathimage
(file) - Image file objectheight
(int) - Target height in pixelswidth
(int) - Target width in pixelsobjectStore
(boolean, optional) - Enable object storage (default: false)
Example:
saveWebpImage(path, image, objectStore?)
Convert image to WebP format and save.
Parameters:
path
(string) - Directory pathimage
(file) - Image file objectobjectStore
(boolean, optional) - Enable object storage (default: false)
Example:
resizeSaveWebpImage(path, image, height, width, objectStore?)
Resize image and convert to WebP format.
Parameters:
path
(string) - Directory pathimage
(file) - Image file objectheight
(int) - Target height in pixelswidth
(int) - Target width in pixelsobjectStore
(boolean, optional) - Enable object storage (default: false)
Example:
☁️ Object Storage Configuration
To enable object storage functionality, create a configuration file:
Step 1: Create Config File
Create app/config/ImageConvert.php
:
Step 2: Environment Variables
Add these variables to your .env
file:
Step 3: Enable Object Storage
Pass true
or 1
as the last parameter to enable object storage:
💡 Usage Examples
Basic Image Upload
Thumbnail Generation
🔧 Requirements
- PHP >= 8.1
- Laravel >= 10.10
- GD or Imagick extension
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📄 License
This package is open-sourced software licensed under the MIT license.
🐛 Issues
If you discover any issues, please create an issue on the GitHub repository.
📧 Support
For support, email [email protected] or create an issue on GitHub.