Download the PHP package randomhost/image without Composer

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

Build Status

randomhost/image

1. Purpose

This package encapsulates some common GD library operations in PHP classes. It was created as part of the randomhost/webcamoverlay package but is released as a separate component, so it can be used in other packages.

Because it was created as a dependency of the randomhost/webcamoverlay package, it does only support a small subset of the available image handling functions.

2. Usage

A basic approach at using this package could look like this:

This will instantiate two image objects using image files from the file system, merge the images and render an overlay text on top.

Assuming that you named this file image.php, you should now be able to access the image at http://example.com/image.php

2.1. The Image object

The Image object represents an image in a (remote) filesystem or created in memory. It provides methods for retrieving information about the image and for merging other Image instances.

2.1.1. Instantiation

There are two methods for creating an Image object instance:

  1. Image::getInstanceByPath($path, $cacheDir = '')
    Creates an instance from an existing local or remote image file.
    • $path
      Path or URL to the image file.
    • $cacheDir
      Optional: Directory path for caching image files. This comes in handy when retrieving images from remote locations as caching them locally reduces the amount of HTTP requests which have to be made.
  2. Image::getInstanceByCreate($width, $height)
    Creates an empty instance with the given image dimensions which can be used to merge (multiple) other Image instances into it.
    • $width
      Width of the generated image.
    • $height
      Height of the generated image.

2.1.2. Retrieving image data

The following public methods for retrieving image related data are available:

2.1.3. Combining images

2.1.4. Scaling strategies

2.1.5. Rendering the image

2.2. The Color object

The Color object is merely a data container for defining color values to be used within the PHP_Image package. It comes with a set of setters and getters for setting and retrieving color and alpha channel data.

2.2.1. Constructor

The constructor takes 4 parameters which are all optional:

2.2.2. Configuring the color

2.2.3. Retrieving color data

2.2.4. Validating color data

2.3. The Image/Text/Generic object

The Image/Text/Generic object is a generic text rendering object which can be extended with additional functionality using decorators.

2.3.1. Constructor

The constructor takes 1 optional parameter:

2.3.2. Configuring the text

2.3.3. Retrieving text data

2.3.4. Rendering the text

2.4. The Image/Text/Decorator object family

The Image/Text/Decorator object family contains decorators for text rendering objects which add additional functionality to the Image/Text/Generic object or other objects implementing the Image\Text\Text interface.

Since they wrap around any Image\Text\Text implementation which could also be another Image/Text/Decorator instance, they share all methods of the decorated object and might also define their own.

2.4.1. Constructor

The constructor depends on the specific Image/Text/Decorator implementation but usually takes at least one parameter which is the object to decorate:

2.4.2. Retrieving text decorator data

2.4.3. Rendering text using a decorator

Since all decorators implement the same interface as the standard Image/Text/Generic object, rendering using decorated text objects works the same way as rendering using non-decorated objects:

2.5. The Image/Text/Decorator/Border object

The Image/Text/Decorator/Border object is a decorator for text rendering objects which adds a simple border to the rendered text.

2.5.1. Configuring the border

2.5.2. Retrieving border data

3. License

See LICENSE.txt for full license details.


All versions of image with dependencies

PHP Build Version
Package Version
Requires php Version ~8.0
ext-gd Version *
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 randomhost/image contains the following files

Loading the files please wait ....