Skip to content

Commit

Permalink
FIX Add transparency percent argument to Image::generatePad to ensure…
Browse files Browse the repository at this point in the history
… transparency works from ::Pad
  • Loading branch information
robbieaverill committed May 16, 2017
1 parent 793a020 commit 197bc53
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions model/Image.php
Expand Up @@ -339,10 +339,11 @@ public function FillMax($width, $height) {
*
* @param integer $width The width to size to
* @param integer $height The height to size to
* @param string $backgroundColor The background colour to use on padded sides (default white)
* @param integer $transparencyPercent Level of transparency
* @return Image|null
*/
public function Pad($width, $height, $backgroundColor='FFFFFF', $transparencyPercent = 0) {
public function Pad($width, $height, $backgroundColor = 'FFFFFF', $transparencyPercent = 0) {
return $this->isSize($width, $height) && !Config::inst()->get('Image', 'force_resample')
? $this
: $this->getFormattedImage('Pad', $width, $height, $backgroundColor, $transparencyPercent);
Expand All @@ -354,12 +355,16 @@ public function Pad($width, $height, $backgroundColor='FFFFFF', $transparencyPer
* @param Image_Backend $backend
* @param integer $width The width to size to
* @param integer $height The height to size to
* @param string $backgroundColor The background colour to use on padded sides (default white)
* @param integer $transparencyPercent Level of transparency
* @return Image_Backend
* @deprecated 4.0 Generate methods are no longer applicable
*/
public function generatePad(Image_Backend $backend, $width, $height, $backgroundColor='FFFFFF') {
public function generatePad(Image_Backend $backend, $width, $height, $backgroundColor = 'FFFFFF',
$transparencyPercent = 0
) {
Deprecation::notice('4.0', 'Generate methods are no longer applicable');
return $backend->paddedResize($width, $height, $backgroundColor);
return $backend->paddedResize($width, $height, $backgroundColor, $transparencyPercent);
}

/**
Expand Down

0 comments on commit 197bc53

Please sign in to comment.