-
-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Spatie\Image\Test\Manipulations; | ||
|
||
use Spatie\Image\Drivers\ImageDriver; | ||
use Spatie\Image\Exceptions\InvalidManipulation; | ||
|
||
it('can change the contrast of an image', function (ImageDriver $driver) { | ||
$targetFile = $this->tempDir->path("{$driver->driverName()}/contrast.jpg"); | ||
|
||
$driver->load(getTestPhoto())->contrast(30)->save($targetFile); | ||
|
||
expect($targetFile)->toBeFile(); | ||
})->with('drivers'); | ||
|
||
it('will throw an exception when passing an invalid contrast value', function (ImageDriver $driver) { | ||
$driver->load(getTestPhoto())->brightness(101); | ||
})->with('drivers')->throws(InvalidManipulation::class); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Spatie\Image\Test\Manipulations; | ||
|
||
use Spatie\Image\Drivers\ImageDriver; | ||
|
||
it('can apply gamma to an image', function (ImageDriver $driver) { | ||
$targetFile = $this->tempDir->path("{$driver->driverName()}/gamma.jpg"); | ||
|
||
$driver->load(getTestJpg())->gamma(4.8)->save($targetFile); | ||
|
||
expect($targetFile)->toBeFile(); | ||
})->with('drivers'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.