PHP code example of realitaetsverlust / imagewrapper
1. Go to this page and download the library: Download realitaetsverlust/imagewrapper library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
realitaetsverlust / imagewrapper example snippets
use Realitaetsverlust\Wrapper\ImageTypes\Jpeg;
use Realitaetsverlust\Wrapper\ImageTypes\Png;
$image = new Png('test.png');
$image->convert(new Jpeg());
$image->output('test.jpeg');
use Realitaetsverlust\Wrapper\ImageTypes\Jpeg;
use Realitaetsverlust\Wrapper\ImageTypes\Png;
$image = new Png('test.png');
$image->convert(new Jpeg())->output('test.jpeg');
use Realitaetsverlust\Wrapper\ImageFactory;
$image = ImageFactory::create('test.png'); // Will return a Png Object
$image = ImageFactory::create('test.jpg'); // Will return a Jpeg Object
$image = ImageFactory::create('image_with_no_extension'); // Will return the correct object, whatever it is