PHPThumb icon indicating copy to clipboard operation
PHPThumb copied to clipboard

height/width transposed in rotateImageNDegrees() function

Open sevenpointsix opened this issue 15 years ago • 1 comments

There is an error in the function rotateImageNDegrees() in the file GdThumb.inc.php.

At line 546, we have:

$newWidth                           = $this->currentDimensions['height'];
$newHeight                          = $this->currentDimensions['width'];

This is incorrect, and reverses the height and width of an image once it's been rotated. This causes problems if you then attempt to determine the size of the image using the getCurrentDimensions() function. Instead, the code should read:

$newWidth                           = $this->currentDimensions['width'];
$newHeight                          = $this->currentDimensions['height'];

sevenpointsix avatar Nov 11 '10 14:11 sevenpointsix

Thanks, that mistakes are hard to find :D

senkal avatar May 05 '11 03:05 senkal