Skip to content

Commit

Permalink
Add shortcut method Image::removeProfile()
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Nov 26, 2023
1 parent d3ccbe2 commit 64b2ca1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
use Intervention\Image\Modifiers\PixelateModifier;
use Intervention\Image\Modifiers\PlaceModifier;
use Intervention\Image\Modifiers\ProfileModifier;
use Intervention\Image\Modifiers\ProfileRemovalModifier;
use Intervention\Image\Modifiers\RemoveAnimationModifier;
use Intervention\Image\Modifiers\ResizeDownModifier;
use Intervention\Image\Modifiers\ResizeModifier;
Expand Down Expand Up @@ -181,6 +182,11 @@ public function setProfile(ProfileInterface $profile): ImageInterface
return $this->modify(new ProfileModifier($profile));
}

public function removeProfile(): ImageInterface
{
return $this->modify(new ProfileRemovalModifier());
}

public function sharpen(int $amount = 10): ImageInterface
{
return $this->modify(new SharpenModifier($amount));
Expand Down
7 changes: 7 additions & 0 deletions src/Interfaces/ImageInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,13 @@ public function profile(): ProfileInterface;
*/
public function setProfile(ProfileInterface $profile): ImageInterface;

/**
* Remove ICC color profile from the current image
*
* @return ImageInterface
*/
public function removeProfile(): ImageInterface;

/**
* Sharpen the current image with given strength
*
Expand Down
2 changes: 1 addition & 1 deletion src/Modifiers/ProfileRemovalModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

namespace Intervention\Image\Modifiers;

class ProfileModifier extends AbstractModifier
class ProfileRemovalModifier extends AbstractModifier
{
}

0 comments on commit 64b2ca1

Please sign in to comment.