Note that there are some explanatory texts on larger screens.

plurals
  1. PONo change in image rotation using php imagerotate()
    primarykey
    data
    text
    <p>Ok.. now I have been trying this for long time now.</p> <p>I am trying to rotate image if it has some orientation . I got reference from <a href="https://stackoverflow.com/questions/3657023/how-to-detect-shot-angle-of-photo-and-auto-rotate-for-website-display-like-desk">Here</a></p> <p>I also refered <a href="https://stackoverflow.com/questions/13474634/imagerotate-doesnt-work">this</a></p> <p>Here is function I am using </p> <pre><code>function adjustPicOrientation($full_filename){ $exif = exif_read_data($full_filename); if($exif &amp;&amp; isset($exif['Orientation'])) { $orientation = $exif['Orientation']; if($orientation != 1){ $img = imagecreatefromjpeg($full_filename); $mirror = false; $deg = 0; switch ($orientation) { case 2: $mirror = true; break; case 3: $deg = 180; break; case 4: $deg = 180; $mirror = true; break; case 5: $deg = 270; $mirror = true; break; case 6: $deg = 270; break; case 7: $deg = 90; $mirror = true; break; case 8: $deg = 90; break; } if ($deg) $img = imagerotate($img, $deg, 0); $full_filename = str_replace('.jpg', "-O$orientation.jpg", $full_filename); imagejpeg($img, $full_filename, 95); } } return $full_filename; } </code></pre> <p>A new image with new name is getting saved but there is no rotation change.</p> <p>Actually I am facing very unexpected issue .. when I rotate image with static rotation angle it is working fine .. but it is not working for the rotation angles mentioned in conditions .. I am no able to figure it out ... </p> <p>Can I body suggest me what went wrong .. Any help will be appreciated</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload