1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-17 19:26:25 +02:00

Re-enable auto orientation for gd driver

This commit is contained in:
Oliver Vogel
2023-11-27 19:56:33 +01:00
parent 59832ada80
commit 81b95db65e

View File

@@ -33,19 +33,17 @@ class BinaryImageDecoder extends AbstractDecoder implements DecoderInterface
$this->decodeExifData($input)
);
return $image;
// fix image orientation
// return match ($image->exif('IFD0.Orientation')) {
// 2 => $image->flip(),
// 3 => $image->rotate(180),
// 4 => $image->rotate(180)->flip(),
// 5 => $image->rotate(270)->flip(),
// 6 => $image->rotate(270),
// 7 => $image->rotate(90)->flip(),
// 8 => $image->rotate(90),
// default => $image
// };
return match ($image->exif('IFD0.Orientation')) {
2 => $image->flip(),
3 => $image->rotate(180),
4 => $image->rotate(180)->flip(),
5 => $image->rotate(270)->flip(),
6 => $image->rotate(270),
7 => $image->rotate(90)->flip(),
8 => $image->rotate(90),
default => $image
};
}
private function coreFromString(string $input): Core