@@ -58,6 +58,9 @@ class Upload | |||
if ($width > 500) { | |||
$image = Yii::$app->image->load($path_file); | |||
// fix exif orientation | |||
$image->rotate(array_values([0, 0, 0, 180, 0, 0, 90, 0, -90])[@exif_read_data($path_file)['Orientation'] ?: 0]); | |||
// big | |||
if ($width > 1600) { | |||
$image->resize(1600)->save($dir_file . $file_name . '-big.' . $file->extension); |