Файл: vendor/intervention/image/src/Drivers/Imagick/Modifiers/RemoveProfileModifier.php
Строк: 44
<?php
declare(strict_types=1);
namespace InterventionImageDriversImagickModifiers;
use ImagickException;
use InterventionImageExceptionsModifierException;
use InterventionImageInterfacesImageInterface;
use InterventionImageInterfacesSpecializedInterface;
use InterventionImageModifiersRemoveProfileModifier as GenericRemoveProfileModifier;
class RemoveProfileModifier extends GenericRemoveProfileModifier implements SpecializedInterface
{
/**
* @throws ModifierException
*/
public function apply(ImageInterface $image): ImageInterface
{
$imagick = $image->core()->native();
try {
$result = $imagick->profileImage('icc', null);
if ($result === false) {
throw new ModifierException(
'Failed to apply ' . self::class . ', unable to remove ICC color profile',
);
}
} catch (ImagickException $e) {
throw new ModifierException(
'Failed to apply ' . self::class . ', unable to remove ICC color profile',
previous: $e,
);
}
return $image;
}
}