File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 23
23
],
24
24
"require" : {
25
25
"php" : " ^8.1" ,
26
- "illuminate/support" : " ^10.0|^11.0" ,
27
- "intervention/image" : " ^2.7|^ 3.4" ,
28
- "illuminate/container" : " ^10.0|^11.0" ,
29
- "illuminate/contracts" : " ^10.0|^11.0" ,
26
+ "illuminate/support" : " ^10.0|^11.0|^12.0 " ,
27
+ "intervention/image" : " ^3.4" ,
28
+ "illuminate/container" : " ^10.0|^11.0|^12.0 " ,
29
+ "illuminate/contracts" : " ^10.0|^11.0|^12.0 " ,
30
30
"ext-fileinfo" : " *"
31
31
},
32
32
"require-dev" : {
33
- "orchestra/testbench" : " ^8.0|^9.0"
33
+ "orchestra/testbench" : " ^8.0|^9.0|^10.0 "
34
34
},
35
35
"autoload" : {
36
36
"psr-4" : {
Original file line number Diff line number Diff line change 2
2
3
3
namespace LaravelAt \ImageSanitize ;
4
4
5
- use Intervention \Image \Image ;
5
+ use Intervention \Image \Drivers \Gd \Driver ;
6
+ use Intervention \Image \EncodedImage ;
7
+ use Intervention \Image \Encoders \AutoEncoder ;
6
8
use Intervention \Image \ImageManager ;
7
9
use LaravelAt \ImageSanitize \Lists \PatternList ;
8
10
9
11
class ImageSanitize
10
12
{
11
13
public function __construct (
12
- protected ImageManager $ imageManager ,
13
14
protected PatternList $ patternList ,
14
15
) {
15
16
}
@@ -25,8 +26,12 @@ public function detect(string $content): bool
25
26
return false ;
26
27
}
27
28
28
- public function sanitize (string $ content ): Image
29
+ public function sanitize (string $ content ): EncodedImage
29
30
{
30
- return $ this ->imageManager ->make ($ content )->encode (null , 100 );
31
+ $ imageManager = new ImageManager (new Driver ());
32
+
33
+ $ image = $ imageManager ->read ($ content );
34
+
35
+ return $ image ->encode (new AutoEncoder (quality: 100 ));
31
36
}
32
37
}
You can’t perform that action at this time.
0 commit comments