@@ -165,8 +165,6 @@ public function __construct($filename)
165165 throw new ImageResizeException ('Could not load image ' );
166166 }
167167
168- finfo_close ($ finfo );
169-
170168 return $ this ->resize ($ this ->getSourceWidth (), $ this ->getSourceHeight ());
171169 }
172170
@@ -257,12 +255,12 @@ public function save($filename, $image_type = null, $quality = null, $permission
257255 $ background = imagecolorallocate ($ dest_image , 255 , 255 , 255 );
258256 imagefilledrectangle ($ dest_image , 0 , 0 , (int ) $ this ->getDestWidth (), (int ) $ this ->getDestHeight (), $ background );
259257 }
260-
258+
261259 imagealphablending ($ dest_image , false );
262260 imagesavealpha ($ dest_image , true );
263-
261+
264262 break ;
265-
263+
266264 case IMAGETYPE_AVIF :
267265 if ( !empty ($ exact_size ) && is_array ($ exact_size ) ){
268266 $ dest_image = imagecreatetruecolor ($ exact_size [0 ], $ exact_size [1 ]);
@@ -273,10 +271,10 @@ public function save($filename, $image_type = null, $quality = null, $permission
273271 $ background = imagecolorallocate ($ dest_image , 255 , 255 , 255 );
274272 imagefilledrectangle ($ dest_image , 0 , 0 , (int ) $ this ->getDestWidth (), (int ) $ this ->getDestHeight (), $ background );
275273 }
276-
274+
277275 imagealphablending ($ dest_image , false );
278276 imagesavealpha ($ dest_image , true );
279-
277+
280278 break ;
281279
282280 case IMAGETYPE_PNG :
@@ -398,8 +396,6 @@ public function save($filename, $image_type = null, $quality = null, $permission
398396 chmod ($ filename , $ permissions );
399397 }
400398
401- imagedestroy ($ dest_image );
402-
403399 return $ this ;
404400 }
405401
0 commit comments