We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 31b29e0 commit 78712d5Copy full SHA for 78712d5
5 files changed
src/Options/Gravity.php
@@ -22,11 +22,11 @@ public function __construct(string $type, ?float $x = null, ?float $y = null)
22
{
23
$this->type = new GravityType($type);
24
25
- if ($x < 0 || $x > 1) {
+ if ($x < 0) {
26
throw new InvalidArgumentException(sprintf('Invalid gravity X: %s', $x));
27
}
28
29
- if ($y < 0 || $y > 1) {
+ if ($y < 0) {
30
throw new InvalidArgumentException(sprintf('Invalid gravity Y: %s', $y));
31
32
tests/Options/CropTest.php
@@ -62,6 +62,7 @@ public function validData(): array
62
[100, 0, 'ce', 'c:100:0:ce'],
63
[100, 200, 'ce', 'c:100:200:ce'],
64
[100, 200, 'ce:0:0', 'c:100:200:ce:0:0'],
65
+ [100, 200, 'ce:200:250', 'c:100:200:ce:200:250'],
66
];
67
68
@@ -85,8 +86,8 @@ public function invalidGravityData(): array
85
86
['foo', 'Invalid gravity: foo'],
87
['ce:bar:0', 'Gravity X should be numeric'],
88
['ce:0:baz', 'Gravity Y should be numeric'],
- ['ce:100:0', 'Invalid gravity X: 100'],
89
- ['ce:0:500', 'Invalid gravity Y: 500'],
+ ['ce:-100:0', 'Invalid gravity X: -100'],
90
+ ['ce:0:-500', 'Invalid gravity Y: -500'],
91
92
93
tests/Options/ExtendAspectRatioTest.php
@@ -44,6 +44,7 @@ public function exampleData(): array
44
[false, null, 'exar:0'],
45
[true, 'ce', 'exar:1:ce'],
46
[false, 'ce:0:0', 'exar:0:ce:0:0'],
47
+ [false, 'ce:200:250', 'exar:0:ce:200:250'],
48
49
50
@@ -56,8 +57,8 @@ public function invalidGravityData(): array
56
57
58
59
60
61
tests/Options/ExtendTest.php
@@ -46,6 +46,7 @@ public function exampleData(): array
[false, null, 'ex:0'],
[true, 'ce', 'ex:1:ce'],
[false, 'ce:0:0', 'ex:0:ce:0:0'],
+ [false, 'ce:200:250', 'ex:0:ce:200:250'],
51
52
@@ -58,8 +59,8 @@ public function invalidGravityData(): array
tests/Options/GravityTest.php
@@ -86,6 +86,7 @@ public function validData(): array
['fp', 0.5, null, 'g:fp:0.5'],
['fp', null, 0.5, 'g:fp::0.5'],
['fp', 0.5, 0.7, 'g:fp:0.5:0.7'],
+ ['fp', 200, 250, 'g:fp:200:250'],
@@ -99,6 +100,7 @@ public function validDataFromString(): array
99
100
['ce:0.5', 'g:ce:0.5'],
101
['ce:0:0', 'g:ce:0:0'],
102
['ce:0.1:0.5', 'g:ce:0.1:0.5'],
103
+ ['ce:200:250', 'g:ce:200:250'],
104
105
106
@@ -131,6 +133,7 @@ public function invalidGravityType(): array
131
133
public function invalidGravityOffset(): array
132
134
135
return [
136
+ [-100],
137
[-1],
138
[-1.01],
139
0 commit comments