bencagri / photon
Installs: 24
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:dev
Requires (Dev)
- symfony/var-dumper: ^4.1@dev
This package is auto-updated.
Last update: 2024-10-28 23:46:28 UTC
README
JETPACK PHOTON WRAPPER
What is Photon?
Photon is an image acceleration and modification service for Jetpack-connected WordPress sites. Converted images are cached automatically and served from the WordPress.com CDN. Images can be cropped, resized, and filtered by using a simple API controlled by GET query arguments. When Photon is enabled in Jetpack, images are updated on the fly.
Why wrapper?
This wrapper allows you to use photon on your host (servers) and its fully object oriented.
Installation
$ composer require bencagri/photon
Notice: to use it on your servers, you need to install gmagick package
Sample implementation.
<?php use Photon\Wrapper\Generate; use Photon\Wrapper\Effect\Height; use Photon\Wrapper\Effect\Width; use Photon\Wrapper\Effects; require 'vendor/autoload.php'; // Set your effects $effects = new Effects( new Width(500), new Height(500) ); $imageUrl = 'http://sample-site.com/sample-image.jpg'; //Generate image with your effects $process = new Generate($imageUrl,$effects); $process->process();
You can combine multiple effects also.
<?php use Photon\Wrapper\Effect\Crop; use Photon\Wrapper\Effect\Filter; use Photon\Wrapper\Effects; $crop = new Crop(500,250,330,300); $effects = new Effects( $crop, new Filter('emboss') );
Full documentation of all effects.
Licence
- The Photon Wrapper is open-sourced software licensed under the MIT license.
- The Photon is open-sourced software licenced under GNU GENERaL PUBLIC LICENCE