Skip to content

Commit

Permalink
Update CMS.php
Browse files Browse the repository at this point in the history
  • Loading branch information
andrtechno authored Jun 15, 2023
1 parent f1a3c44 commit 86fe1b6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions CMS.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use yii\helpers\Inflector;
use yii\helpers\Url;
use yii\helpers\VarDumper;
use yii\helpers\FileHelper;

/**
* Дополнительные функции системы.
Expand Down Expand Up @@ -215,14 +216,16 @@ public static function processImage($size = false, $filename = 'file.jpg', $uplo
$options['watermark'] = false;
$error = true;
}
$hash = '';
$hash = time();

$exif = exif_read_data($fullPath, 0, true);
if (isset($exif['FILE']['FileDateTime'])) {
$hash = $exif['FILE']['FileDateTime'];
}
if (!file_exists($thumbPath) && file_exists($fullPath)) {
$fileInfo = pathinfo($fullPath);
if(!in_array($fileInfo['extension'], ['png','svg'])){
$exif = exif_read_data(FileHelper::normalizePath($fullPath), 0, true);
if (isset($exif['FILE']['FileDateTime'])) {
$hash = $exif['FILE']['FileDateTime'];
}
}
if (!in_array($fileInfo['extension'], ['svg'])) {
$img = Yii::$app->img;
$img->load($fullPath);
Expand Down

0 comments on commit 86fe1b6

Please sign in to comment.