mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-13 03:52:50 +00:00
perf: 优化iOS上传图片颠倒的问题
This commit is contained in:
parent
07a290dbf9
commit
14f54e9df4
@ -2063,13 +2063,18 @@ class Base
|
|||||||
$exif = @exif_read_data($array['file']);
|
$exif = @exif_read_data($array['file']);
|
||||||
if (!empty($exif['Orientation'])) {
|
if (!empty($exif['Orientation'])) {
|
||||||
$data = match ($exif['Orientation']) {
|
$data = match ($exif['Orientation']) {
|
||||||
8 => imagerotate($data, 90, 0),
|
2 => imageflip($data, IMG_FLIP_HORIZONTAL),
|
||||||
3 => imagerotate($data, 180, 0),
|
3 => imagerotate($data, 180, 0),
|
||||||
|
4 => imageflip($data, IMG_FLIP_VERTICAL),
|
||||||
|
5 => imageflip(imagerotate($data, -90, 0), IMG_FLIP_HORIZONTAL),
|
||||||
6 => imagerotate($data, -90, 0),
|
6 => imagerotate($data, -90, 0),
|
||||||
|
7 => imageflip(imagerotate($data, 90, 0), IMG_FLIP_HORIZONTAL),
|
||||||
|
8 => imagerotate($data, 90, 0),
|
||||||
default => null,
|
default => null,
|
||||||
};
|
};
|
||||||
if ($data !== null) {
|
if ($data !== null) {
|
||||||
imagejpeg($data, $array['file']);
|
imagejpeg($data, $array['file']);
|
||||||
|
imagedestroy($data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user