title: How to get new width and height after an image has been rotated with imagerotate()?
body: <p>How do I actually get the new width and height that is set after image is rotated?</p>
  
  <pre><code>$ps['product_angle'] = 77; //Could be any angle
  $filename = 'test.png'     //filename to the original product
  
  list($source_width, $source_height) = getimagesize($filename);
  $source_image = imagecreatefromjpeg($filename);         
  $angle = $ps['product_angle'];
  if (intval($angle) &lt;&gt; 0) {
      $source_image = imagerotate($source_image, 360-$angle, imageColorAllocateAlpha($source_image, 255, 255, 255, 127));
  }
  
  $ps['source_image'] = $source_image;
  </code></pre>
  
  <p>I want this because I want to do an image resize based on above image created. (<code>$ps['source_image']</code>)</p>
  
  <pre><code>//If I do an image 
  list($source_width, $source_height) =     getimagesize($filename);
  
  $dest_width = (int)$ps['product_width'];
  $dest_height = (int)$ps['product_height'];
  
  //Resize source-image to new width and height
  //But this width and height are incorrect because they are 
  //set before image is rotated and often the image is just "cut off" 
  //
  imagecopyresized($dest_image, $ps['source_image'], 0, 0, 0, 0, $dest_width, $dest_height, $source_width, $source_height);    
  </code></pre>