@@ -93,17 +93,17 @@ public function __toString()
9393 $ quality = 9 ;
9494 }
9595
96- imagepng ($ this ->resource , null , $ quality );
96+ imagepng ($ this ->resource , null , floor ( $ quality) );
9797 break ;
9898 case 'bmp ' :
9999 case 'wbmp ' :
100- imagewbmp ($ this ->resource , null , $ this ->quality );
100+ imagewbmp ($ this ->resource , null , floor ( $ this ->quality ) );
101101 break ;
102102 case 'jpg ' :
103103 case 'jpeg ' :
104104 case 'pjpeg ' :
105105 default :
106- imagejpeg ($ this ->resource , null , $ this ->quality );
106+ imagejpeg ($ this ->resource , null , floor ( $ this ->quality ) );
107107 break ;
108108 }
109109
@@ -287,7 +287,17 @@ public function crop($width = null, $height = null)
287287 }
288288
289289 //render the image
290- imagecopyresampled ($ crop , $ this ->resource , 0 , 0 , $ xPosition , $ yPosition , $ width , $ height , $ orgWidth , $ orgHeight );
290+ imagecopyresampled (
291+ $ crop ,
292+ $ this ->resource ,
293+ 0 , 0 ,
294+ floor ($ xPosition ),
295+ floor ($ yPosition ),
296+ floor ($ width ),
297+ floor ($ height ),
298+ floor ($ orgWidth ),
299+ floor ($ orgHeight )
300+ );
291301
292302 //destroy the original resource
293303 imagedestroy ($ this ->resource );
@@ -637,19 +647,19 @@ public function save($path, $type = null)
637647 $ quality = 9 ;
638648 }
639649
640- imagepng ($ this ->resource , $ path , $ quality );
650+ imagepng ($ this ->resource , $ path , floor ( $ quality) );
641651 break ;
642652 case 'bmp ' :
643653 case 'wbmp ' :
644- imagewbmp ($ this ->resource , $ path , $ this ->quality );
654+ imagewbmp ($ this ->resource , $ path , floor ( $ this ->quality ) );
645655 break ;
646656 case 'jpg ' :
647657 // @codeCoverageIgnoreStart
648658 case 'jpeg ' :
649659 case 'pjpeg ' :
650660 // @codeCoverageIgnoreEnd
651661 default :
652- imagejpeg ($ this ->resource , $ path , $ this ->quality );
662+ imagejpeg ($ this ->resource , $ path , floor ( $ this ->quality ) );
653663 break ;
654664 }
655665
0 commit comments