Skip to content

Using functions

Andrei Coelho edited this page Sep 5, 2019 · 7 revisions

Using Functions

Before using the functions it is necessary to build the image using the class EditImage and the from() method.

EditImage::from('my_image.jpg')

This method will generate a copy of the model image to be manipulated by other functions.

alias

You can set an alias for the image like that

EditImage::from('my_image.jpg', 'my_alias')

The alias is used to not repeat names in copies and to get a specific image for manipulation.

When you do not define alias, it will be defined with an array index ... like [0,1,2, ...]

You can see more about alias in copy() function of the actions methods page

about functions

Functions may require 1 or no parameters, but they all have the alias option except use() and copy() functions.

When the image alias is not set, the function will execute on all copies of the created images.

All functions can be called by the use() function. Obviously the use() function cannot be called by itself.

recommendations

If you need to use the copy function, use it before any other. But feel free to use the other functions as you see fit.


These are the methods like crop, resize, flip, etc...

These are the methods for changing image colors.

Clone this wiki locally