$image_library
$image_library :
Can be: imagemagick, netpbm, gd, gd2
图片处理类
image_reproportion() : void
Re-proportion Image Width/Height
When creating thumbs, the desired width/height can end up warping the image due to an incorrect ratio between the full-sized image and the thumb.
This function lets us re-proportion the width/height if users choose to maintain the aspect ratio when resizing.
size_calculator( $vals) : array
Size calculator
This function takes a known width x height and recalculates it to a new size. Only one new variable needs to be known
$props = array( 'width' => $width, 'height' => $height, 'new_width' => 40, 'new_height' => '' );
$vals |
explode_name( $source_image) : array
Explode source_image
This is a helper function that extracts the extension from the source_image. This function lets us deal with source_images with multiple periods, like: my.cool.jpg It returns an associative array with two elements: $array['ext'] = '.jpg'; $array['name'] = 'my.cool';
$source_image |
thumb(string $img, \Phpcmf\Library\intval $width, \Phpcmf\Library\intval $height, \Phpcmf\Library\intval $water, $mode = 'auto') : \Phpcmf\Library\url
图片缩略图显示
string | $img | 图片id或者路径 |
\Phpcmf\Library\intval | $width | 输出宽度 |
\Phpcmf\Library\intval | $height | 输出高度 |
\Phpcmf\Library\intval | $water | 是否水印 |
$mode |