メインコンテンツまでスキップ
Version: Fegg 5.x(開発版)

Trim::setImage

Set target image and output file path

Description​

public void Trim::setImage( string $org_path, string $cnv_path )

Loads the source image. The output format is decided by the extension of $cnv_path.

注意

This method stops the script with exit when the source file does not exist (Not File), when the output extension is not jpg, gif or png (Error Extension; .jpeg is not accepted), or when the source is not a JPEG, GIF or PNG image (NotImage). Check the files beforehand.

Arguments​

NameData typeDefaultRemarks
$org_pathstringSource image path
$cnv_pathstringOutput image path (.jpg, .gif or .png)

Example​

Controller
use Fegg\Tool\Trim;

$trim = new Trim();
$trim->setImage('path/to/image.jpg', 'path/to/converted.jpg');