Download the PHP package joomla/image without Composer

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

The Image Package Build Status

Latest Stable Version Total Downloads Latest Unstable Version License

This package comprises of 2 main classes, Image and ImageFilter which has 8 filter sub-classes that it can use to apply a desired filter to your image. Image depends on the GD php extension to be loaded on your server. More information on GD can be found at: https://www.php.net/manual/en/book.image.php

Manipulating images in raw PHP using the GD image* functions requires a lot of boilerplate code. The intent of this package is to handle those requirements and make it simple for developers to accomplish those tasks through easy to use (and remember) methods.

All classes in this package are supported by the auto-loader so can be invoked at any time.

Deprecated

The joomla/image package is deprecated with no future updates planned.

Construction

When creating a new Image object, the constructor will check that the gd extension is loaded, and throw a RuntimeException if it is not.

The constructor takes a single optional $source parameter. This argument can be one of two things:

If you choose the first option, the class sets the protected property $handle to the provided image resource. If you choose the second option, the class will call the loadFile method, passing along the $source parameter.

Usage

Keep in mind that most public methods return a Image instance with a valid image handle for easy method chaining. The examples for each method will break each method call out to be able to comment on what the code is doing, but production code can be chained like so (if you prefer):

Since Platform version 12.3, there is a new destroy() method that gets called in appropriate places throughout the class which runs the imagedestroy function to free memory associated with an image handle. This method is called before each time an image handle is replaced (when $createNew is set to false) as well as in the class __descruct method as a final cleanup.

The resize method

Accepted Parameters

Example: Using Image::resize() to generate a resized image.

The crop method

Accepted Parameters

Example: Using Image::crop() to generate a cropped image.

To crop in image after resizing it to maintain proportions use cropResize method with familiar arguments $width, $height and $createNew.

The createThumbs method

Accepted Parameters

Example: Using Image::createThumbs() to generate thumbnails of an image.

In this example, we use the createThumbs method of Image. This method takes 2 parameters. The first parameter can be a string containing a single size in WIDTHxHEIGHT format, or it can be an array of sizes in the format (as shown in the example). The second parameter specifies the resize method. (See Resize Methods below)

To receive Image instances without saving them to disk, use generateThumbs method with arguments $thumbSizes and $creationMethod.

Resize Methods

The resize, createThumbs and generateThumbs methods take an optional parameter that defines what method to use when scaling an image. This parameter can be one of the following:

The toFile method

Accepted Parameters

Example: Using Image::toFile() to save the image as JPEG with 65 compression level

Example: Using Image::toFile() to retrieve data blob of an image.

Installation via Composer

Add "joomla/image": "2.0.*@dev" to the require block in your composer.json and then run composer install.

Alternatively, you can simply run the following from the command line:

If you want to include the test sources, use


All versions of image with dependencies

PHP Build Version
Package Version
Requires php Version ^5.3.10|~7.0
ext-gd Version *
psr/log Version ~1.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 joomla/image contains the following files

Loading the files please wait ....