There was such a problem:
When an image is uploaded to a site, it is processed by the GD library and saved. And if you embed this image on the page of the HTML site, it will be shown in the original.
Is it possible to make on php so that some script checks whether the image has data about the rotation, and if they are, then rotate according to them and save.

    1 answer 1

    $image = imagecreatefromstring(file_get_contents($_FILES['image_upload']['tmp_name'])); $exif = exif_read_data($_FILES['image_upload']['tmp_name']); if(!empty($exif['Orientation'])) { switch($exif['Orientation']) { case 8: $image = imagerotate($image,90,0); break; case 3: $image = imagerotate($image,180,0); break; case 6: $image = imagerotate($image,-90,0); break; } } 

    // taken in php.net comments