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 2323 ],
2424 "require" : {
2525 "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 " ,
3030 "ext-fileinfo" : " *"
3131 },
3232 "require-dev" : {
33- "orchestra/testbench" : " ^8.0|^9.0"
33+ "orchestra/testbench" : " ^8.0|^9.0|^10.0 "
3434 },
3535 "autoload" : {
3636 "psr-4" : {
Original file line number Diff line number Diff line change 22
33namespace LaravelAt \ImageSanitize ;
44
5- use Intervention \Image \Image ;
5+ use Intervention \Image \Drivers \Gd \Driver ;
6+ use Intervention \Image \EncodedImage ;
7+ use Intervention \Image \Encoders \AutoEncoder ;
68use Intervention \Image \ImageManager ;
79use LaravelAt \ImageSanitize \Lists \PatternList ;
810
911class ImageSanitize
1012{
1113 public function __construct (
12- protected ImageManager $ imageManager ,
1314 protected PatternList $ patternList ,
1415 ) {
1516 }
@@ -25,8 +26,12 @@ public function detect(string $content): bool
2526 return false ;
2627 }
2728
28- public function sanitize (string $ content ): Image
29+ public function sanitize (string $ content ): EncodedImage
2930 {
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 ));
3136 }
3237}
You can’t perform that action at this time.
0 commit comments