Download the PHP package realitaetsverlust/imagewrapper without Composer

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

ImageWrapper

A simple wrapper for image in PHP

ImageWrapper is one of my simplistic OOP Wrappers for PHP. My goal with this project was to create a library which is lightweight, has little to no dependencies and requires little to no explanation on how it works. And I think that I definitely succeeded. Image wrapper has no dependencies, is not very complex and extremely simple to integrate in existing or new web applications.

Keep in mind that this software is still in development. It's currently in a state that is absolutely useable in productive environments, but it may have occasional bugs here and there, especially with older GDLb versions. If you notice a bug, please leave an issue, stating exactly the PHP Version and GDLib version you're using.

Installation:

You can easiely install ImageWrapper via composer:

composer require realitaetsverlust/imagewrapper

What can ImageWrapper do for you:

For example: You want to load an image called test.png, convert it into a JPEG file and output it:

Tadaa, that's all necessary to convert an image from PNG to JPEG. If you prefer it a little bit fancier, you can also make use of the method chaining ImageWrapper provides:

Almost every method returns itself in the end, with a few exceptions. So you can chain methods as often and as much as you like!

Also, if you don't know which kind of image you have there or you simply don't want to bother, no worries, ImageWrapper got your back. There is ImageFactory::create() that automatically checks the filetype using exif_imagetype() and returns the corresponding object:

ImageWrapper has support for all image types PHP supports, which are:

The elements of the library:

ImageBase:

ImageBase is the base class of all images. It's an abstract class that contains definitions for all methods. Every method maps to one PHP function, sometimes two if the two methods are very similar. A full documentation of methods inside ImageBase is below

Color:

The Color() class is a RGB representation which is used throughout the the library. The main advantage of it is that it can convert RGB values as well as a hex-based string (#ff00ff) and even CMYK.

Every time a function expects a color represenation, you should pass a Color object. This may look like the following:

This will colorize the image red. However, you can, as mentioned above, also add other values that represent a color:

Usually, you never have to care about the allocation of the color, the picture class handles those by itself. However, the method allocateColor() allows you to perform the allocation of colors yourself.

Method-Documentation:

Outputs the image. If $destination is set, the image is saved at the given path. If it is not, it's directly send as output.

This method is ont inside ImageBase, but inside the child classes. PHPs output functions are not very streamlined which makes it really hard to write a proper function for all of them.

Converts an image from one image type to another. Please keep in mind that this function returns a new object you have to use. So something like the following will not work.

Chaining the methods, however, will obviously work.

This method sends the headers as a browser would expect them in the format Content-Type: image/png. They are determined by image_type_to_mime_type(). In general, you don't have to call this function yourself, it is called automatically if the method output() does not get any $destination parameter. However, there may be a situation where you want to fire the function yourself, for example if you want to set some parameters before you send the image to the receiver.

Returns the current file type of the image. This is not determined by the extension, but by exif_imagetype()

Returns the file size of the image.

Returns the minimum quality PHP accepts in the output function.

Returns the maximum quality PHP accepts in the output function.

Set the blending mode for the image

Activate the fast drawing antialiased methods for lines and wired polygons.

Draws an arc. if $style is passed, the arc will be filled

Draws a char horizontally or vertically onto the image.

Fetches the color value at a specific location

Cuts a part from the current image and copies it into a new image

Crops image to given dimension

Draws a line onto the image

Draws an ellipse. If $fill isp passed, the ellipse will be filled with the passed color.

Performs a flood fill onto the image

Draws a polygon. If $fill is passed, the polygon will be filled with the passed color.

Draws a rectangle. If $fill is passed, the rectangle will be filled with the given color.

Inverts the color of an image (white to black, black to white etc)

Convert image into a grayscale image. Alpha components are retained.

Set brightness of given image

Sets contrast of the given image

Colorizes an image

Uses edge detection to highlight the edges in the image.

Embosses the image

Blurs an image. If $useGauss is passed, the gauss blur will be used instead of the selective blur

Transforms the image to have a sketchy look

Smoothes the iamge

Pixelates the iamge

Applies a scatter effect to the image.

Gamma correction method

Flips the image using the given mode. Modes are IMG_FLIP_HORIZONTAL, IMG_FLIP_VERTICAL and IMG_FLIP_BOTH

Enables/Disables interlace

Determines if an image is a true color image

Allocates a color and adds it to the list of allocated colors.


All versions of imagewrapper with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
ext-exif Version *
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 realitaetsverlust/imagewrapper contains the following files

Loading the files please wait ....