1. Go to this page and download the library: Download outerweb/image-library 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/ */
outerweb / image-library example snippets
use OuterWeb\ImageLibrary\Facades\ImageLibrary;
use OuterWeb\ImageLibrary\Entities\AspectRatio;
use OuterWeb\ImageLibrary\Entities\ConversionDefinition;
use OuterWeb\ImageLibrary\Entities\Effects;
ImageLibrary::addConversionDefinition(
ConversionDefinition::make()
->name('thumbnail')
->label('Thumbnail')
->translateLabel()
->aspectRatio(
AspectRatio::make()
->x(1)
->y(1)
)
->defaultWidth(100)
->defaultHeight(100)
->effects(
Effects::make()
->blur(10)
->pixelate(10)
->greyscale()
->sepia()
->sharpen(10)
)
->createSync()
);
use OuterWeb\ImageLibrary\Entities\ConversionDefinition;
ConversionDefinition::make()
->name('thumbnail');
use OuterWeb\ImageLibrary\Entities\ConversionDefinition;
ConversionDefinition::make()
->label('Thumbnail');
use OuterWeb\ImageLibrary\Entities\ConversionDefinition;
ConversionDefinition::make()
->label('conversions.labels.thumbnail');
->translateLabel();
use OuterWeb\ImageLibrary\Entities\AspectRatio;
use OuterWeb\ImageLibrary\Entities\ConversionDefinition;
ConversionDefinition::make()
->aspectRatio(
AspectRatio::make()
->x(1)
->y(1)
);
use OuterWeb\ImageLibrary\Entities\ConversionDefinition;
ConversionDefinition::make()
->aspectRatio('16:9');
use OuterWeb\ImageLibrary\Entities\ConversionDefinition;
ConversionDefinition::make()
->aspectRatio([16, 9]);
use OuterWeb\ImageLibrary\Entities\ConversionDefinition;
ConversionDefinition::make()
->defaultWidth(100)
->defaultHeight(100);
use OuterWeb\ImageLibrary\Entities\ConversionDefinition;
use OuterWeb\ImageLibrary\Entities\Effects;
ConversionDefinition::make()
->effects(
Effects::make()
->blur(10)
->pixelate(10)
->greyscale()
->sepia()
->sharpen(10)
);