# Helpers

This are our image helpers. You can use the method or call imagehelper and then the method. By default, imagehelper will be return a string if you printed on a view.

Keep attention

First integer parameter will be always the width.

# Cache

imagehelper($imageUrl);

thumb

# Thumb

Creates a thumb from given image

Keeping the aspect-ratio

thumb($imageUrl, 300, 300); // respect aspect-ratio

//or

imagehelper($imageUrl)->thumb(300, 300);

thumb

Without the aspect-ratio

thumb($imageUrl, 300, 300, true); // don't respect aspect-ratio

//or

imagehelper($imageUrl)->thumb(300, 300, true);

thumb_force

# Resize

Just resize the image maintaining the aspect-ratio.

Height parameter is optional.

resize($imageUrl, 350, 350);
resize($imageUrl, 350);

//or

imagehelper($imageUrl)->resize(350, 350);
imagehelper($imageUrl)->resize(350);

resize

# Square

To create a square from given image

square($imageUrl, 300);

//or

imagehelper($imageUrl)->square(300);

square

Creating the square focusing in the main object

square($imageUrl, 300, true);

//or

imagehelper($imageUrl)->square(300, true);

square_smart

# Crop

To create a square from given image.

Parameters: width, height, x and y.

crop($imageUrl, 400, 400, 1200, 550)

//or

imagehelper($imageUrl)->crop(400, 400, 1200, 550);

square

# Blur

To create a blurred image.

Important: Default value is 5. Valid range from 1 to 100,

blur($imageUrl)
blur($imageUrl, 15)

//or
//
imagehelper($imageUrl)->blur();
imagehelper($imageUrl)->blur(15);

square

Last Updated: 3/25/2019, 10:24:11 AM