Skip to content

Commit

Permalink
Add support for enhance effect
Browse files Browse the repository at this point in the history
  • Loading branch information
const-cloudinary committed Oct 23, 2024
1 parent 8c22547 commit 0a24cb0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Transformation/Effect/Generative/GenerativeEffect.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ abstract class GenerativeEffect
const GENERATIVE_REPLACE = 'gen_replace';
const GENERATIVE_RESTORE = 'gen_restore';
const UPSCALE = 'upscale';
const ENHANCE = 'enhance';

use GenerativeEffectTrait;
}
10 changes: 10 additions & 0 deletions src/Transformation/Effect/Generative/GenerativeEffectTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,14 @@ public static function upscale()
{
return new GenerativeEffectAction(GenerativeEffect::UPSCALE);
}

/**
* Uses AI to analyze an image and make adjustments to enhance the appeal of the image.
*
* @return GenerativeEffectAction
*/
public static function enhance()
{
return new GenerativeEffectAction(GenerativeEffect::ENHANCE);
}
}
8 changes: 8 additions & 0 deletions tests/Unit/Transformation/Image/GenerativeEffectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,12 @@ public function testGenerativeUpscale()
(string)Effect::upscale()
);
}

public function testGenerativeEnhance()
{
self::assertStrEquals(
'e_enhance',
Effect::enhance()
);
}
}

0 comments on commit 0a24cb0

Please sign in to comment.