src/Painter.php
/**
     * Save the current image with fixed width and height cropping the exceeding.
     *
     * @param int    $width  width of the thumbnail
     * @param int    $height height of the thumbnail
     * @param string $dir    File system path to save the image to
     */
Save the current image with fixed width and height cropping the exceeding.
@param int    $width  width of the thumbnail
@param int    $height height of the thumbnail
@param string $dir    File system path to save the image to
Save the current image with fixed width and height cropping the exceeding . @param int $width width of the thumbnail @param int $height height of the thumbnail @param string $dir File system path to save the image to
public function saveThumb(int $width, int $height, string $dir = 'i') : Image
    {
        $this->uploadHandler->image_resize     = true;
        $this->uploadHandler->image_ratio_crop = true;
        $this->uploadHandler->image_x          = $width;
        $this->uploadHandler->image_y          = $height;
        $tmp_path = sys_get_temp_dir() . '/';
        $this->uploadHandler->process($tmp_path);
        $image = $this->persistenceHandler->persistFile(
            $tmp_path . $this->uploadHandler->file_dst_name,
            $dir,
            $this->uploadHandler->file_dst_name
        );
        unlink($tmp_path . $this->uploadHandler->file_dst_name);
        return $image;
    }
public function saveThumb ( int $ width , int $ height , string $ dir = 'i' ) : Image { $ this -> uploadHandler -> image_resize = true ; $ this -> uploadHandler -> image_ratio_crop = true ; $ this -> uploadHandler -> image_x = $ width ; $ this -> uploadHandler -> image_y = $ height ; $ tmp_path = sys_get_temp_dir ( ) . '/' ; $ this -> uploadHandler -> process ( $ tmp_path ) ; $ image = $ this -> persistenceHandler -> persistFile ( $ tmp_path . $ this -> uploadHandler -> file_dst_name , $ dir , $ this -> uploadHandler -> file_dst_name ) ; unlink ( $ tmp_path . $ this -> uploadHandler -> file_dst_name ) ; return $ image ; }
Save the current image with fixed width and height cropping the exceeding.
Save the current image with fixed width and height cropping the exceeding .