Файл: vendor/intervention/image/src/Drivers/Gd/Modifiers/PixelateModifier.php
Строк: 41
<?php
declare(strict_types=1);
namespace InterventionImageDriversGdModifiers;
use InterventionImageExceptionsModifierException;
use InterventionImageInterfacesImageInterface;
use InterventionImageInterfacesSpecializedInterface;
use InterventionImageModifiersPixelateModifier as GenericPixelateModifier;
class PixelateModifier extends GenericPixelateModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*
* @throws ModifierException
*/
public function apply(ImageInterface $image): ImageInterface
{
foreach ($image as $frame) {
$result = imagefilter($frame->native(), IMG_FILTER_PIXELATE, $this->size, true);
if ($result === false) {
throw new ModifierException(
'Failed to apply ' . self::class . ', unable to process pixelation effect',
);
}
}
return $image;
}
}