Imageクラスに入れるのはまた今度やる。
$image_path = 'images/iphone.jpg'; $exif = exif_read_data($image_path); if (!empty($exif['Orientation'])) { $image = \Image::load($image_path); switch($exif['Orientation']) { case 2: $image->flip('horizontal')->save($image_path); break; case 3: $image->rotate(180)->save($image_path); break; case 4: $image->flip('vertical')->save($image_path); break; case 5: $image->rotate(-90)->flip('vertical')->save($image_path); break; case 6: $image->rotate(90)->save($image_path); break; case 7: $image->rotate(90)->flip('vertical')->save($image_path); break; case 8: $image->rotate(-90)->save($image_path); break; } }