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);
Methods with the same name as their class will not be constructors in a future version of PHP; Markdown_Parser has a deprecated constructor #1 include_once() called at [/var/www/diafan/data/www/diafancms.com/modules/docs/docs.model.php:499] #2 Docs_model->prepare_text( For work with images in the file *includes/image.php* define class *Image*. <insert name="show_func" module="docs" file="image" folder="includes"> ) called at [/var/www/diafan/data/www/diafancms.com/modules/docs/docs.model.php:94] #3 Docs_model->show() called at [/var/www/diafan/data/www/diafancms.com/modules/docs/docs.php:29] #4 Docs->init() called at [/var/www/diafan/data/www/diafancms.com/includes/init.php:474] #5 Init->module() called at [/var/www/diafan/data/www/diafancms.com/includes/init.php:119] #6 Init->start() called at [/var/www/diafan/data/www/diafancms.com/index.php:62] | /var/www/diafan/data/www/diafancms.com/modules/docs/docs.model.php:499 |