1 | <?php |
||
21 | class AutoRotateFilterLoader implements LoaderInterface |
||
22 | { |
||
23 | protected $orientationKeys = [ |
||
24 | 'exif.Orientation', |
||
25 | 'ifd0.Orientation', |
||
26 | ]; |
||
27 | |||
28 | /** |
||
29 | * {@inheritdoc} |
||
30 | */ |
||
31 | public function load(ImageInterface $image, array $options = []) |
||
52 | |||
53 | /** |
||
54 | * calculates to rotation degree from the EXIF Orientation. |
||
55 | * |
||
56 | * @param int $orientation |
||
57 | * |
||
58 | * @return int |
||
59 | */ |
||
60 | private function calculateRotation($orientation) |
||
77 | |||
78 | /** |
||
79 | * @param ImageInterface $image |
||
80 | * |
||
81 | * @return int|null |
||
82 | */ |
||
83 | private function getOrientation(ImageInterface $image) |
||
97 | |||
98 | /** |
||
99 | * Returns true if the image is flipped, false otherwise. |
||
100 | * |
||
101 | * @param int $orientation |
||
102 | * |
||
103 | * @return bool |
||
104 | */ |
||
105 | private function isFlipped($orientation) |
||
109 | } |
||
110 |