Файл: vendor/intervention/image/src/Drivers/Imagick/Modifiers/ResolutionModifier.php
Строк: 50
<?php
declare(strict_types=1);
namespace InterventionImageDriversImagickModifiers;
use ImagickException;
use InterventionImageExceptionsModifierException;
use InterventionImageInterfacesImageInterface;
use InterventionImageInterfacesSpecializedInterface;
use InterventionImageModifiersResolutionModifier as GenericResolutionModifier;
class ResolutionModifier extends GenericResolutionModifier implements SpecializedInterface
{
/**
* @throws ModifierException
*/
public function apply(ImageInterface $image): ImageInterface
{
$imagick = $image->core()->native();
try {
$result = $imagick->setImageResolution($this->x, $this->y);
if ($result === false) {
throw new ModifierException(
'Failed to apply ' . self::class . ', unable to set image resolution',
);
}
} catch (ImagickException $e) {
throw new ModifierException(
'Failed to apply ' . self::class . ', unable to set image resolution',
previous: $e,
);
}
return $image;
}
}