File: D:/HostingSpaces/SBogers10/honger.komma.pro/app/KommaApp/Images/CropperInterface.php
<?php
namespace App\KommaApp\Images;
/**
* Interface CropperInterface
*
* @package App\KommaApp\Images
*/
interface CropperInterface
{
const TOP_LEFT = "top-left";
const TOP = "top";
const TOP_RIGHT = "top-right";
const LEFT = "left";
const CENTER = "center";
const RIGHT = "right";
const BOTTOM_LEFT = "bottom-left";
const BOTTOM = "bottom";
const BOTTOM_RIGHT = "bottom-right";
/**
* @param string $file Path to the source image location
* @return mixed
*/
public function open(string $file):bool;
/**
* Cut out a rectangular part of the current image with given width and height.
* Define optional x,y coordinates to move the top-left corner of the cutout to a certain position.
*
* @param int $width
* @param int $height|null
* @param int $x X-Coordinate of the top-left corner if the rectangular cutout.
* @param int $y Y-Coordinate of the top-left corner if the rectangular cutout.
* @return bool true on success, false on failure
*/
public function crop(int $width, int $height = null, int $x = null, int $y = null):bool;
/**
* Combine cropping and resizing to format image in a smart way.
* The method will find the best fitting aspect ratio of your given width and height on the current image automatically,
* cut it out and resize it to the given dimension
*
* @param int $width
* @param int|null $height
* @param string $position Set a position where cutout will be positioned.
* @return bool true on success, false on failure
*/
public function fit(int $width, int $height = null, string $position = self::CENTER):bool;
/**
* Saves the image
*
* @param string $to
* @param int $quality
* @return bool true on success, false on failure
*/
public function save(string $to, int $quality = 87):bool;
/**
* returns a gd resource or imagick class instance or null if the core is not available
*
* @return resource|object|null
*/
public function getCore():resource;
/**
* Determine whether an image should be encoded in interlaced or standard mode
*
* @param bool $enable
* @return true on success, false on failure
*/
public function enableProgressive(bool $enable);
/**
* Destroys the internal image freeing up memory. After this you need to call open again to use this cropper
*
* @return bool true on success, false on failure
*/
public function destroy():bool;
}