Browse Source

[Administration] Produits > photo : correctif orientation image (données EXIF non prises en compte)

feature/rotating_product
Guillaume Bourgeois 6 months ago
parent
commit
1b577fc6a9
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      common/helpers/Upload.php

+ 3
- 0
common/helpers/Upload.php View File

@@ -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);

Loading…
Cancel
Save