Download the PHP package imagecow/imagecow without Composer

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

Imagecow

Build Status Scrutinizer Code Quality

Created by Oscar Otero http://oscarotero.com [email protected]

What is Imagecow?

It's a php library to manipulate images to web.

Simple usage example:

How use it?

Installation

This package is installable and autoloadable via Composer as imagecow/imagecow.

Creating a Imagecow\Image instance:

resize

Image::resize($width, $height = 0, $cover = false)

Resizes the image keeping the aspect ratio.

Note: If the new image is bigger than the original, the image wont be resized

crop

Image::crop($width, $height, $x = 'center', $y = 'middle')

Crops the image:

Automatic cropping

Imagecow includes some code copied from the great library stojg/crop to calculate the most important parts of the image to crop and resizeCrop automatically. The available methods are:

Note: these methods are available only for Imagick. If you use Gd, the methods fallback to "center", "middle" positions.

To use them:

resizeCrop

Image::resizeCrop($width, $height, $x = 'center', $y = 'middle')

Resizes and crops the image. See crop for the arguments description.

rotate

Image::rotate($angle)

Rotates the image

autoRotate

Image::autoRotate()

Autorotates the image according its EXIF data

opacity

Image::opacity($value)

Set the alpha channel of the image. The value must be between 0 (transparent) to 100 (opaque). Note that the image will be converted to png (if it's not already)

blur

Image::blur($loops = 4)

Applies the gaussian blur to the image. The more loops, the more the image blurs.

watermark

Image::watermark($image, $x = 'right', $y = 'bottom')

Applies a image as a watermark. You can configure the position and opacity.

format

Image::format($format)

Converts the image to other format.

*Note: webp format is only supported when using Imagick. ImageMagick must be built with WEBP support.

save

Save the image to a file.

setBackground

Image::setBackground(array $background)

Set a default background used in some transformations: for example on convert a transparent png to jpg.

quality

Image::quality($quality)

Defines the image compression quality for jpg images

setClientHints

Image::setClientHints(array $clientHints)

Defines the client hints to fix the final size of the image and generate responsive images. The available client hints are:

More information about client hints below.

Display the image

Send the HTTP header with the content-type, output the image data and die:

Insert the image as base64 url:

Get image info:

There are other functions to returns image info:

Execute multiple functions

You can execute some of these functions defined as a string. This is useful to get images transformed dinamically using variables, for example: image.php?transform=resize,200,300|format,png. All operations are separated by | and use commas for the arguments:

Responsive images

Imagecow has support for client hints, that allows to generate responsive images without using cookies or javascript code (like in 1.x version of imagecow). Client Hints is introduced by Google becoming a standard. Here's a deep explain of how to use it

Note that currently this is supported only by chrome and opera browsers.

Simple example:

In your webpage, add the following code:

Now, in the server side:

Other utils

IconExtractor.

Only for Imagick. Class to extract the images from an .ico file and convert to png.

SvgExtractor.

Only for Imagick This class allows generate images from a svg file (useful for browsers that don't support svg format):

Installing ImageMagick with WEBP support

macOS

Via Homebrew:

CentOS/RHEL

Ubuntu

Maintainers:

Thanks to

Stig Lindqvist and Julien Deniau jdeniau for the stojg/crop library


All versions of imagecow with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
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 imagecow/imagecow contains the following files

Loading the files please wait ....