if ($width > 500) { | if ($width > 500) { | ||||
$image = Yii::$app->image->load($path_file); | $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 | // big | ||||
if ($width > 1600) { | if ($width > 1600) { | ||||
$image->resize(1600)->save($dir_file . $file_name . '-big.' . $file->extension); | $image->resize(1600)->save($dir_file . $file_name . '-big.' . $file->extension); |