| | 131 | if (substr($properties['width'], -1) === '%') |
| | 132 | { |
| | 133 | // Recalculate the percentage to a pixel size |
| | 134 | $properties['width'] = round($width * (substr($properties['width'], 0, -1) / 100)); |
| | 135 | } |
| | 136 | |
| | 137 | if (substr($properties['height'], -1) === '%') |
| | 138 | { |
| | 139 | // Recalculate the percentage to a pixel size |
| | 140 | $properties['height'] = round($height * (substr($properties['height'], 0, -1) / 100)); |
| | 141 | } |
| | 142 | |
| | 143 | if (empty($properties['width'])) |
| | 144 | { |
| | 145 | // Determine the width difference and calculate, don't forget $properties['master'] |
| | 146 | } |
| | 147 | |
| | 148 | if (empty($properties['height'])) |
| | 149 | { |
| | 150 | // Determine the width difference and calculate, don't forget $properties['master'] |
| | 151 | } |
| | 152 | |
| | 170 | // Use current image to rotate |
| | 171 | $img = $this->tmp_image; |
| | 172 | |
| | 173 | // Rotate, setting the transparent color |
| | 174 | $img = imagerotate($img, 360 - $amount, $transparent = imagecolorallocatealpha($img, 255, 255, 255, 127), -1); |
| | 175 | |
| | 176 | // Fill the background with the transparent "color" |
| | 177 | imagecolortransparent($img, $transparent); |
| | 178 | |
| | 179 | // Merge the images |
| | 180 | imagecopymerge($this->tmp_image, $img, 0, 0, 0, 0, imagesx($this->tmp_image), imagesy($this->tmp_image), 100); |
| | 181 | |
| 152 | | imagealphablending($this->tmp_image, TRUE); |
| 153 | | imagesavealpha($this->tmp_image, TRUE); |
| 154 | | |
| 155 | | // Rotate, using -1 as the color to preserve transparency |
| 156 | | $img = imagerotate($this->tmp_image, $amount, -1); |
| 157 | | |
| 158 | | // Destory the current image |
| 159 | | imagedestroy($this->tmp_image); |
| | 183 | imagealphablending($img, TRUE); |
| | 184 | imagesavealpha($img, TRUE); |