Download the PHP package arjanwestdorp/imaginary-client without Composer

On this page you can find all versions of the php package arjanwestdorp/imaginary-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package imaginary-client

Imaginary client

Latest Stable Version License Build Status Quality Score Coverage

Client for the imaginary image service. Imaginary is a service build to resize images on the fly. Unfortunately that service is not open sourced yet.

Installation

The recommended way to install the client is through composer:

composer require arjanwestdorp/imaginary-client

Usage

$client = new Client([
    'client' => 'CLIENT',
    'url' => 'https://imaginaryurl.com',
]);

$client->fetch('http://www.test.com/test.jpg')->url();
// https://imaginaryurl.com/CLIENT/image/fetch/http://www.test.com/test.jpg

$client->fetch('http://www.test.com/test.jpg')
    ->width(100)
    ->height(100)
    ->url();

// https://imaginaryurl.com/CLIENT/image/fetch/w_100,h_100/http://www.test.com/test.jpg

Predefined definitions

You can add predefined sets of manipulations. The idea is that you can reuse the same manipulation multiple times in your whole application by defining it only once.

$client->define('landscape', function($imaginary){
    $imaginary->width(400)
        ->height(300)
        ->fit();
});

$client->fetch('http://www.test.com/test.jpg')
    ->landscape()
    ->url();
// https://imaginaryurl.com/CLIENT/image/fetch/w_400,h_300,c_fit/http://www.test.com/test.jpg

Options

width($width)

Manipulate the width of the image in pixels.

height($height)

Manipulate the height of the image in pixels.

fit($gravity = null)

Fit the resizing in the given dimensions (width, height). By setting the gravity you can mark the position which the cutout will be taken from. By default it will cutout from the center. Options are:

circle($radius = 'max')

Make a circle image. Setting no radius, it will use the size of the image and make it a circle. By setting a radius the image will be resized to match that radius. If the image is bigger then the radius it will automatically use the fit('center') manipulation before making a circle. The circle manipulation will be called after the resizing manipulations like width and height, so you can resize the image to your needs before applying the circle.

Security

If you discover any security issues, please email [email protected] instead of creating an issue.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of imaginary-client with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package arjanwestdorp/imaginary-client contains the following files

Loading the files please wait ....