CoreFiles by mySites.guru
Smooth.php45 lines, 1,227 bytes, from Joomla_4.2.2-Stable-Full_Package.zip
Raw History Compare with 4.2.1
md5
7c9e6f79e8e71d677e335d861711dce9
sha1
d27f83bbbef29a1893f8f63caf8d7702ff9f0070
sha256
71753d342cb48d0f49dc05c7c262012e3bf9915788245adbf8b8b30e3a5bff5e
<?php

/**
 * Joomla! Content Management System
 *
 * @copyright   (C) 2005 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

namespace Joomla\CMS\Image\Filter;

use Joomla\CMS\Image\ImageFilter;

// phpcs:disable PSR1.Files.SideEffects
\defined('JPATH_PLATFORM') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Image Filter class adjust the smoothness of an image.
 *
 * @since  2.5.0
 */
class Smooth extends ImageFilter
{
    /**
     * Method to apply a filter to an image resource.
     *
     * @param   array  $options  An array of options for the filter.
     *
     * @return  void
     *
     * @since   2.5.0
     * @throws  \InvalidArgumentException
     */
    public function execute(array $options = [])
    {
        // Validate that the smoothing value exists and is an integer.
        if (!isset($options[IMG_FILTER_SMOOTH]) || !\is_int($options[IMG_FILTER_SMOOTH])) {
            throw new \InvalidArgumentException('No valid smoothing value was given.  Expected integer.');
        }

        // Perform the smoothing filter.
        imagefilter($this->handle, IMG_FILTER_SMOOTH, $options[IMG_FILTER_SMOOTH]);
    }
}

The same content is in 27 releases, Joomla 4.2.1 to 4.3.1. See them all, or every version of this file.