Download the PHP package jcupitt/vips without Composer

On this page you can find all versions of the php package jcupitt/vips. 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 vips

PHP binding for libvips

CI

php-vips is a binding for libvips 8.7 and later that runs on PHP 7.4 and later.

libvips is fast and needs little memory. The vips-php-bench repository tests php-vips against imagick and gd. On that test, and on my laptop, php-vips is around four times faster than imagick and needs 10 times less memory.

Programs that use libvips don't manipulate images directly, instead they create pipelines of image processing operations starting from a source image. When the pipe is connected to a destination, the whole pipeline executes at once and in parallel, streaming the image from source to destination in a set of small fragments.

Install

You need to install the libvips library. It's in the linux package managers, homebrew and MacPorts, and there are Windows binaries on the vips website. For example, on Debian:

(--no-install-recommends stops Debian installing a lot of extra packages)

Or macOS:

You'll need to enable FFI in your PHP, then add vips to your composer.json:

php-vips does not yet support preloading, so you need to enable FFI globally. This has some security implications, since anyone who can run php on your server can use it to call any native library they have access to.

Of course if attackers are running their own PHP code on your webserver you are probably already toast, unfortunately.

Finally, on php 8.3 and later you need to disable stack overflow tests. php-vips executes FFI callbacks off the main thread and this confuses those checks, at least in php 8.3.0.

Add:

To your php.ini.

Example

Run with:

See examples/. We have a complete set of formatted API docs.

How it works

php-vips uses php-ffi to call directly into the libvips binary. It introspects the library binary and presents the methods it finds as members of the Image class.

This means that the API you see depends on the version of libvips that php-vips finds at runtime, and not on php-vips. php-vips documentation assumes you are using the latest stable version of the libvips library.

The previous php-vips version that relied on a binary extension and not on php-ffi is still available and supported in the 1.x branch.

Introduction to the API

Almost all methods return a new image as the result, so you can chain them. For example:

will make a mask of pixels greater than 12, then use the mask to set pixels to either 255 or the original image.

Note that libvips operators always make new images, they don't modify existing images, so after the line above, $image is unchanged.

You can use long, double, array and image as parameters. For example:

to add two to every band element, or:

to add 1 to the first band, 2 to the second and 3 to the third. Or:

to add two images. Or:

To make a 3 x 2 image from the array, then add that image to the original.

Almost all methods can take an extra final argument: an array of options. For example:

php-vips comes with API docs. To regenerate these from your sources, type:

And look in docs/.

Unfortunatly, due to php-doc limitations, these do not list every option to every operation. For a full API description you need to see the main libvips documentation:

https://libvips.org/API/current

Test and install

Regenerate auto docs


All versions of vips with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-ffi Version *
psr/log Version ^1.1.3|^2.0|^3.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 jcupitt/vips contains the following files

Loading the files please wait ....