This is a nice script just one thing that I have not found yet is the fix for Exif Orientation. Have you thought about this or am I just missing something? Thanks.
I use something like this (modified based off code from the Laravel.io forums).
try {
$orientation = $image->exif('Orientation');
if ( ! empty($orientation)) {
switch ($orientation) {
case 8:
$image->rotate(90);
break;
case 3:
$image->rotate(180);
break;
case 6:
$image->rotate(-90);
break;
}
}
} catch (\Exception $e) {}
I would definitely be happy to see that in the core though, as it's a very common problem for photos uploaded from iOS devices.
I think the best solution would be to auto-orientate every image that is loaded.
The reasons why I am contained about this are:
Imagick seems to auto-orientate images by default.
I added orientate method in e0d9c258.
// auto orientation
$img = Image::make('foo.jpg')->orientate();
By default orientation is ignored in both GD and Imagick now.
@olivervogel So is this orientate method going to turn the picture the correct way? Do you have a estimated time on when this feature will be available thanks.
Most helpful comment
I added
orientatemethod in e0d9c258.By default orientation is ignored in both GD and Imagick now.