diff --git a/File.php b/File.php index 04a3cfa..fdb7f1d 100644 --- a/File.php +++ b/File.php @@ -375,6 +375,7 @@ class File extends \yii\db\ActiveRecord $patch = $this->getDir(true); $fileName = $this->name . '.' . $this->ext; $filePatch = $patch . $fileName; + $this->cropFile = $this->cropFile && file_exists($this->cropFile) ? $this->cropFile : null; $quality = $quality > 100 || $quality <= 0 ? 90 : $quality; if (file_exists($filePatch) && in_array(exif_imagetype($filePatch), [IMAGETYPE_JPEG, IMAGETYPE_PNG])) {