handle image error in reception view

This commit is contained in:
Schneider Roland
2022-12-27 15:54:09 +01:00
parent 4946421e38
commit 0e566c1d77
3 changed files with 44 additions and 41 deletions

View File

@@ -147,6 +147,7 @@ class GD
public function save($file, $quality = 90)
{
try{
switch($this->_mime) {
case 'image/jpeg':
return imagejpeg($this->_image, $file, $quality);
@@ -159,6 +160,9 @@ class GD
return imagegif($this->_image, $file);
break;
}
}catch (\Exception $e){
\Yii::error("Failed to save image image:", $e->getMessage());
}
return false;
}
}