Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed an issue with imagerotate (see http://stackoverflow.com/questions/24643783/php-gd-imagerotate-fails-when-1-is-passed-for-bgd-color) #219

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions fImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
* @package Flourish
* @link http://flourishlib.com/fImage
*
* @version 1.0.0b35
* @version 1.0.0b36
* @changes 1.0.0b36 Fixed an issue with imagerotate (see http://stackoverflow.com/questions/24643783/php-gd-imagerotate-fails-when-1-is-passed-for-bgd-color) [bs, 2015-05-19]
* @changes 1.0.0b35 Fixed an issue with ImageMagick 6.7.5+ and colorspace argument [jt, 2014-01-09]
* @changes 1.0.0b34 Fixed a bug in getImageType() where the fread was not reading enough bytes [jt, 2012-06-05]
* @changes 1.0.0b33 Fixed a method signature [wb, 2011-08-24]
Expand Down Expand Up @@ -1054,7 +1055,7 @@ private function processWithGD($output_file, $jpeg_quality)
unset($new_gd_res);
}

$new_gd_res = imagerotate($gd_res, $mod['degrees'], -1);
$new_gd_res = imagerotate($gd_res, $mod['degrees'], imagecolorallocatealpha($gd_res, 0, 0, 0, 127));

// If you don't set the alpha mode for PNG, images that
// contain transparency and are rotated will be distored
Expand Down