Skip to content
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
10 changes: 7 additions & 3 deletions src/PHPThumb/GD.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function __destruct()
* @param array $color
* @return GD
*/
public function pad($width, $height, $color = array(255, 255, 255))
public function pad($width, $height, $color = array(255, 255, 255, 127))
{
// no resize - woohoo!
if ($width == $this->currentDimensions['width'] && $height == $this->currentDimensions['height']) {
Expand All @@ -144,12 +144,16 @@ public function pad($width, $height, $color = array(255, 255, 255))
$this->workingImage = imagecreate($width, $height);
}

imagealphablending($this->workingImage, false);
imagesavealpha($this->workingImage, true);

// create the fill color
$fillColor = imagecolorallocate(
$fillColor = imagecolorallocatealpha(
$this->workingImage,
$color[0],
$color[1],
$color[2]
$color[2],
$color[3]
);

// fill our working image with the fill color
Expand Down