O2System Image is a PHP image handling and manipulation library for O2System Framework which provides an easier and expressive way to manipulate an image. It allows different PHP Image Processor and Generator to be used.
Processors | Support | Tested | |
---|---|---|---|
GD2 | Yes |
Yes |
http://php.net/image |
GMagick | Yes |
Yes |
http://php.net/gmagick |
ImageMagick | Yes |
Yes |
http://php.net/imagemagick |
The best way to install O2System Image is to use Composer
composer require o2system/image
use O2System\Image;
// Manipulate Image
$manipulation = new Image\Manipulation();
$manipulation->setImageFile( 'path/to/images/kawah-putih.jpg' );
$manipulation->scaleImage( 15 );
// Watermark Image
$manipulation->watermarkImage( ( new Text() )
->setPosition( 'MIDDLE_BOTTOM' )
->setPadding( 10 )
->signature( 'Braunberrie Timeless Portraiture' )
->copyright( 'Copyright © ' . date( 'Y' ) . ' Poniman Mulijadi' . PHP_EOL . 'Braunberrie Timeless Portraiture' )
);
// Send to browser
$manipulation->displayImage();
// Save Image
$manipulation->saveImage( 'path/to/save/images/kawah-putih.jpg' );
Documentation is available on this repository wiki or visit this repository github page.
Please kindly mail us at contact@o2system.id
Please kindly submit your issues at Github so we can track all the issues along development and send a pull request to this repository.
- PHP 7.2+
- Composer
- O2System Kernel
- Image Optimizer by Piotr Śliwa
- Jellyka Saint Andrew's Queen by Jellyka Neveran used as default signature font.
- Express Way Regular - Truetype Font by Typodermic Fonts used as default copyright font.
- Kawah Putih by Poniman Mulijadi - Braunberrie Timeless Portraiture
All photographs above is used as examples in the script O2System Framework.