4
4
5
5
use Gregwar \Image \Image ;
6
6
use Gregwar \Image \ImageColor ;
7
+ use Gregwar \Image \Utils \FileUtils ;
7
8
8
9
class GD extends Common
9
10
{
@@ -609,7 +610,7 @@ public function saveJpeg($file, $quality)
609
610
*/
610
611
protected function openJpeg ($ file )
611
612
{
612
- if (file_exists ($ file ) && filesize ($ file )) {
613
+ if (FileUtils:: safeExists ($ file ) && filesize ($ file )) {
613
614
$ this ->resource = @imagecreatefromjpeg ($ file );
614
615
} else {
615
616
$ this ->resource = false ;
@@ -621,7 +622,7 @@ protected function openJpeg($file)
621
622
*/
622
623
protected function openGif ($ file )
623
624
{
624
- if (file_exists ($ file ) && filesize ($ file )) {
625
+ if (FileUtils:: safeExists ($ file ) && filesize ($ file )) {
625
626
$ this ->resource = @imagecreatefromgif ($ file );
626
627
} else {
627
628
$ this ->resource = false ;
@@ -633,7 +634,7 @@ protected function openGif($file)
633
634
*/
634
635
protected function openPng ($ file )
635
636
{
636
- if (file_exists ($ file ) && filesize ($ file )) {
637
+ if (FileUtils:: safeExists ($ file ) && filesize ($ file )) {
637
638
$ this ->resource = @imagecreatefrompng ($ file );
638
639
} else {
639
640
$ this ->resource = false ;
@@ -645,7 +646,7 @@ protected function openPng($file)
645
646
*/
646
647
protected function openWebp ($ file )
647
648
{
648
- if (file_exists ($ file ) && filesize ($ file )) {
649
+ if (FileUtils:: safeExists ($ file ) && filesize ($ file )) {
649
650
$ this ->resource = @imagecreatefromwebp ($ file );
650
651
} else {
651
652
$ this ->resource = false ;
0 commit comments