HEX
Server: LiteSpeed
System: Linux premium221.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
User: madepabj (2566)
PHP: 8.3.26
Disabled: NONE
Upload Files
File: /home/madepabj/hc-cosmetics.com/wp-content/plugins/newsletter/classes/Newsletter/Composer/Image.php
<?php
namespace Newsletter\Composer;

defined('ABSPATH') || exit;

/**
 * Used only for IDE autocompletion!
 */
class Image {
    var $id;
    var $url;
    var $width;
    var $height;
    var $alt;
    var $link;
    var $align = 'center';

    /** Sets the width keeping the aspect ratio */
    public function set_width($width) {
        $width = (int) $width;
        if (empty($width)) {
            return;
        }
        if ($this->width < $width) {
            return;
        }
        $this->height = floor(($width / $this->width) * $this->height);
        $this->width = $width;
    }

    /** Sets the height  keeping the aspect ratio */
    public function set_height($height) {
        $height = (int) $height;
        if (empty($height)) {
            return;
        }
        $this->width = floor(($height / $this->height) * $this->width);
        $this->height = $height;
    }
}