Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to intervention/image 3 #380

Merged
merged 66 commits into from
Jan 27, 2024
Merged
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
31d421c
define missing properties in tests
Art4 Jan 22, 2024
bf55901
bump php requiremet to 8.1
Art4 Jan 22, 2024
47fa747
update to intervention/glide v3
Art4 Jan 22, 2024
3105fa6
Update ServerFactory
Art4 Jan 22, 2024
be8e752
drop php <8.1 in github actions, add php 8.4
Art4 Jan 22, 2024
5ffd4f8
Fix test for Watermark
Art4 Jan 22, 2024
4b26c21
Activate github actions on dev branch
Art4 Jan 22, 2024
ab510fd
Upgrade to PHP-CS-Fixer 3
Art4 Jan 22, 2024
dfe5153
Install php-cs-fixer in github actions
Art4 Jan 22, 2024
d876753
Use new ImageInterface in Size Manipulator
Art4 Jan 22, 2024
50472ff
Fix tests in Sharpen manipulator
Art4 Jan 22, 2024
4a221bc
Fix tests for Pixelate manipulator
Art4 Jan 22, 2024
b7b9c59
Fix tests for Orientation manipulator
Art4 Jan 22, 2024
154ebea
Fix tests for Gamma manipulator
Art4 Jan 22, 2024
8397221
Fix tests for Flip manipulator
Art4 Jan 22, 2024
a1e3200
Fix tests for Filter manipulator
Art4 Jan 22, 2024
a8ae0ae
Update tests for Encode manipulator
Art4 Jan 22, 2024
43ba3cd
Update tests for Crop manipulator
Art4 Jan 22, 2024
8b5239b
Update tests for Contrast manipulator
Art4 Jan 22, 2024
7f87164
Update tests for Brightness manipulator
Art4 Jan 22, 2024
88f1324
Update tests for Border manipulator
Art4 Jan 22, 2024
87e4214
Update tests for Blur manipulator
Art4 Jan 22, 2024
7122694
fix tests for Background manipulator
Art4 Jan 22, 2024
c25ef4d
fix tests for Dimension helper
Art4 Jan 22, 2024
ca4f4cf
Fix tests in ApiTest
Art4 Jan 22, 2024
865cc26
Fix Background manipulator
Art4 Jan 24, 2024
69e4151
Fix watermark manipulator
Art4 Jan 24, 2024
44413aa
Fix size manipulator
Art4 Jan 24, 2024
56504cc
Fix tests in size manipulator
Art4 Jan 24, 2024
59eba7d
fix Orientation manipulator
konnng-dev Jan 24, 2024
aeb6010
Fix Api tests
Art4 Jan 24, 2024
9dd37f3
Fix code style with php-cs-fixer
Art4 Jan 24, 2024
0ed379c
fix Encode manipulator
konnng-dev Jan 24, 2024
c4e647d
Merge branch 'Art4-glide/upgrade-to-glide-3' into upgrade-to-glide-3
konnng-dev Jan 24, 2024
a786e51
Move Encoding into Api::run(), remove orientate(), interlace(), Encod…
Art4 Jan 24, 2024
e3b3dc1
fix Encoder modifier to detect file format properly
konnng-dev Jan 24, 2024
510ec64
fix Encoder Modifier tests
konnng-dev Jan 24, 2024
907b1bc
improve Orientation Modifier
konnng-dev Jan 24, 2024
7fe32ee
fix Orientation Modifier tests
konnng-dev Jan 24, 2024
14bdf5d
fixed code formatting
konnng-dev Jan 24, 2024
3d01591
fix Server Tests
konnng-dev Jan 24, 2024
9bc8881
.gitignore updated
konnng-dev Jan 24, 2024
2957c80
Fix Background Modifier
konnng-dev Jan 24, 2024
f51a627
fix Background Modifier
konnng-dev Jan 24, 2024
6a96ab7
fix Background Modifier Test
konnng-dev Jan 24, 2024
35170bd
Fix border manipulator
Art4 Jan 25, 2024
f5f3476
Fix usage of flip() and flop() in Flip manipulator
Art4 Jan 25, 2024
13ac3da
fix type casting errors
Art4 Jan 25, 2024
8000a81
Fix opacity of Watermark manipulator
Art4 Jan 25, 2024
155587c
Fix return type of watermark
Art4 Jan 25, 2024
eb917be
Fix code style
Art4 Jan 25, 2024
a819414
Merge remote-tracking branch 'konnng/upgrade-to-glide-3' into upgrade…
Art4 Jan 25, 2024
810cdc8
Fix flip and flop
Art4 Jan 25, 2024
a3fd090
Fix code style
Art4 Jan 25, 2024
9d10e69
Fix ApiTest
Art4 Jan 25, 2024
66ad315
Fix Border and Flip test
Art4 Jan 25, 2024
81144ef
Require at least intervention/image v3.2
Art4 Jan 25, 2024
6bc9dec
Fix border test.
ADmad Jan 25, 2024
fadf2d3
Fix size=contain
Art4 Jan 26, 2024
8078854
Fix size=max
Art4 Jan 26, 2024
4b0a0de
Fix "fill-max" resize
ADmad Jan 26, 2024
9e28ec5
Simplify "fill" and "fill-max" resizing.
ADmad Jan 26, 2024
1aea4e6
Fix crop fit
ADmad Jan 26, 2024
b3bde5d
Fix argument type
ADmad Jan 26, 2024
2c27102
Round the values before casting to int
ADmad Jan 26, 2024
cfddb6a
Uncommend Encode manipulator
Art4 Jan 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix border manipulator
  • Loading branch information
Art4 committed Jan 25, 2024
commit 35170bddfb59283c65698f482f948af00f432cca
23 changes: 12 additions & 11 deletions src/Manipulators/Border.php
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

namespace League\Glide\Manipulators;

use Intervention\Image\Geometry\Factories\RectangleFactory;
use Intervention\Image\Interfaces\ImageInterface;
use League\Glide\Manipulators\Helpers\Color;
use League\Glide\Manipulators\Helpers\Dimension;
@@ -139,13 +140,15 @@
*/
public function runOverlay(ImageInterface $image, $width, $color): ImageInterface
{
return $image->rectangle(
return $image->drawRectangle(
(int) round($width / 2),
(int) round($width / 2),
(int) round($image->width() - ($width / 2)),
(int) round($image->height() - ($width / 2)),
function ($draw) use ($width, $color) {
$draw->border($width, $color);
function (RectangleFactory $rectangle) use ($image, $width, $color) {
$rectangle->size(
(int) round($image->width() - $width),
(int) round($image->height() - $width),
);
$rectangle->border($color, $width);

Check failure on line 151 in src/Manipulators/Border.php

GitHub Actions / psalm

InvalidScalarArgument

src/Manipulators/Border.php:151:44: InvalidScalarArgument: Argument 2 of Intervention\Image\Geometry\Factories\RectangleFactory::border expects int, but float provided (see https://psalm.dev/012)
}
);
}
@@ -166,12 +169,11 @@
(int) round($image->width() - ($width * 2)),
(int) round($image->height() - ($width * 2))
)
->resizeCanvas(
->resizeCanvasRelative(
(int) round($width * 2),
(int) round($width * 2),
$color,
'center',
true,
$color
);
}

@@ -186,12 +188,11 @@
*/
public function runExpand(ImageInterface $image, $width, $color): ImageInterface
{
return $image->resizeCanvas(
return $image->resizeCanvasRelative(
(int) round($width * 2),
(int) round($width * 2),
$color,
'center',
true,
$color
);
}
}
Loading