For work with images in the file includes/image.php define class Image.
boolean resize (string $src_image, integer $dest_width, integer $dest_height, [integer $quality = 80], [boolean $max = false]) – Изменяет размеры изображения.
This method is widely used every time you load a new graphic image, or change the dimensions of the existing file. The main "exploiter" of this method – class Images_inc.
Example:
// reduce size of image userfiles/watermark/logo.png
// up to 50x100, preserving the aspect ratio
Image::resize(ABSOLUTE_PATH.'userfiles/my_image.jpg', 50, 100, 90);
boolean crop (string $original, integer $width, integer $height, integer $quality, string $vertical, integer $sy, string $horizontal, integer $sx) – Обрезает изображение.
Example:
// cut off the image userfiles/watermark/logo.png
// to 100x200 size
// receded by 10 pixels from the top and left
Image::crop(ABSOLUTE_PATH.'userfiles/my_image.jpg', 1000, 200, 90, 'top', 10, 'left', 10);
boolean watermark (string $original, string $watermark, integer $quality, string $vertical, integer $sy, string $horizontal, integer $sx) – Добавляет водяной знак на изображение.
Example:
// put watermark userfiles/watermark/logo.png
// image userfiles/my_image.jpg
// receded by 10 pixels to the right and bottom
Image::watermark(ABSOLUTE_PATH.'userfiles/my_image.jpg', ABSOLUTE_PATH.'userfiles/watermark/logo.png', 90, 'bottom', 10, 'right', 10);
boolean wb (string $original, integer $quality) – Обесцвечивает изображение.
Example:
// is applicable to the image userfiles/my_image.jpg filter
// IMG_FILTER_GRAYSCALE transforming it in shades of gray
Image::wb(ABSOLUTE_PATH.'userfiles/my_image.jpg', 90);