Skip to main content
Version: Fegg 5.x

Trim::view

Output the saved image to the browser

Description​

public void Trim::view()

Sends the Content-Type header and outputs the file at the output path. Call Trim::create first: nothing is output when the file does not exist. To send the image without saving it, use Trim::output.

Example​

Controller
use Fegg\Tool\Trim;

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

$trim->resizeTrim(300, 300, 'm');
$trim->create();
$trim->view();