Метод | Описание | |
---|---|---|
optimize ( string $path, integer $svgo, integer $image_optim, integer $picopt, integer $imageOptim ) | Optimizes the image without reducing quality. | |
rasterize ( string $file, string $dest, integer $columns, integer $rows ) | Rasterizes an SVG image to a PNG. | |
smartResize ( integer $columns, integer $rows, boolean $optim = false ) | Resizes the image using smart defaults for high quality and low file size. | |
thumbnailImage ( integer $columns, integer $rows, boolean $bestfit = false, boolean $fill = false, integer $filter = Imagick::FILTER_TRIANGLE ) : boolean | Changes the size of an image to the given dimensions and removes any associated profiles. |
public static optimize ( string $path, integer $svgo, integer $image_optim, integer $picopt, integer $imageOptim ) | ||
$path | string | The path to the file or directory that should be optimized. |
$svgo | integer | The number of times to optimize using SVGO. |
$image_optim | integer | The number of times to optimize using image_optim. |
$picopt | integer | The number of times to optimize using picopt. |
$imageOptim | integer | The number of times to optimize using ImageOptim. |
public static rasterize ( string $file, string $dest, integer $columns, integer $rows ) | ||
$file | string | The path to the file that should be rasterized. |
$dest | string | The path to the directory where the output PNG should be saved. |
$columns | integer | The number of columns in the output image. 0 = maintain aspect ratio based on $rows. |
$rows | integer | The number of rows in the output image. 0 = maintain aspect ratio based on $columns. |
public smartResize ( integer $columns, integer $rows, boolean $optim = false ) | ||
$columns | integer | The number of columns in the output image. 0 = maintain aspect ratio based on $rows. |
$rows | integer | The number of rows in the output image. 0 = maintain aspect ratio based on $columns. |
$optim | boolean | Whether you intend to perform optimization on the resulting image. Note that setting this to `true` doesn’t actually perform any optimization. |
public thumbnailImage ( integer $columns, integer $rows, boolean $bestfit = false, boolean $fill = false, integer $filter = Imagick::FILTER_TRIANGLE ) : boolean | ||
$columns | integer | The number of columns in the output image. 0 = maintain aspect ratio based on $rows. |
$rows | integer | The number of rows in the output image. 0 = maintain aspect ratio based on $columns. |
$bestfit | boolean | Treat $columns and $rows as a bounding box in which to fit the image. |
$fill | boolean | Fill in the bounding box with the background colour. |
$filter | integer | The resampling filter to use. Refer to the list of filter constants at |
Результат | boolean | Indicates whether the operation was performed successfully. |