Ver código fonte

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

feature/rotating_product
Guillaume Bourgeois 5 meses atrás
pai
commit
1b577fc6a9
1 arquivos alterados com 3 adições e 0 exclusões
  1. +3
    -0
      common/helpers/Upload.php

+ 3
- 0
common/helpers/Upload.php Ver arquivo

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

Carregando…
Cancelar
Salvar