Вход Регистрация
Файл: vendor/intervention/image/src/Drivers/Imagick/Modifiers/StripMetaModifier.php
Строк: 43
<?php

declare(strict_types=1);

namespace 
InterventionImageDriversImagickModifiers;

use 
InterventionImageCollection;
use 
InterventionImageInterfacesImageInterface;
use 
InterventionImageInterfacesModifierInterface;
use 
InterventionImageInterfacesSpecializedInterface;

class 
StripMetaModifier implements ModifierInterfaceSpecializedInterface
{
    
/**
     * {@inheritdoc}
     *
     * @see InterventionImageInterfacesModifierInterface::apply()
     */
    
public function apply(ImageInterface $image): ImageInterface
    
{
        
// preserve icc profiles
        
$profiles $image->core()->native()->getImageProfiles('icc');

        
// remove meta data
        
$image->core()->native()->stripImage();
        
$image->setExif(new Collection());

        if (
$profiles !== []) {
            
// re-apply icc profiles
            
$image->core()->native()->profileImage("icc"$profiles['icc']);
        }
        return 
$image;
    }
}
Онлайн: 0
Реклама