Skip to content

Commit

Permalink
Update methods in CalculationTrait to be public.
Browse files Browse the repository at this point in the history
This allowed usage from outside this package.
  • Loading branch information
ve3 committed Mar 12, 2024
1 parent 6a453f9 commit 409f893
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Rundiz/Image/ImageInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PHP Image manipulation class.
*
* @package Image
* @version 3.1.1
* @version 3.1.2
* @author Vee W.
* @license http://opensource.org/licenses/MIT
*/
Expand Down
6 changes: 3 additions & 3 deletions Rundiz/Image/Traits/CalculationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ protected function calculateImageSizeRatio($width, $height)
* @param int $canvasWidth Canvas size.
* @return int Calculated size.
*/
protected function calculateStartXOfCenter($objWidth, $canvasWidth)
public function calculateStartXOfCenter($objWidth, $canvasWidth)
{
if (!is_numeric($objWidth) || !is_numeric($canvasWidth)) {
return 0;
Expand All @@ -246,7 +246,7 @@ protected function calculateStartXOfCenter($objWidth, $canvasWidth)
* @return array Return array with width as index 0, height as index 1.
* @throws \InvalidArgumentException Throw exception if invalid argument type was specified.
*/
protected function calculateWatermarkImageStartXY($wmStartX, $wmStartY, $imgWidth, $imgHeight, $wmWidth, $wmHeight, array $options = [])
public function calculateWatermarkImageStartXY($wmStartX, $wmStartY, $imgWidth, $imgHeight, $wmWidth, $wmHeight, array $options = [])
{
if (!is_numeric($imgHeight) || !is_numeric($imgWidth)) {
throw new \InvalidArgumentException('The $imgWidth and $imgHeight must be number.');
Expand Down Expand Up @@ -313,7 +313,7 @@ protected function calculateWatermarkImageStartXY($wmStartX, $wmStartY, $imgWidt
* @param int $number Alpha number (0 to 127). 127 is completely transparent.
* @return string Return RGBA value (1.00 to 0.00). 0.00 is completely transparent.
*/
protected function convertAlpha127ToRgba($number)
public function convertAlpha127ToRgba($number)
{
$alpha_min = 0; // 100%
$alpha_max = 127; // 0%
Expand Down
27 changes: 0 additions & 27 deletions tests/phpunit/ExtendedAbstractImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,38 +47,11 @@ public function calculateVariableSpace($currentSize, $minSize, $minSpace, $diffe
}// calculateVariableSpace


/**
* {@inheritDoc}
*/
public function calculateStartXOfCenter($objWidth, $canvasWidth)
{
return parent::calculateStartXOfCenter($objWidth, $canvasWidth);
}// calculateStartXOfCenter


/**
* {@inheritDoc}
*/
public function calculateWatermarkImageStartXY($wmStartX, $wmStartY, $imgWidth, $imgHeight, $wmWidth, $wmHeight, array $options = [])
{
return parent::calculateWatermarkImageStartXY($wmStartX, $wmStartY, $imgWidth, $imgHeight, $wmWidth, $wmHeight, $options);
}// calculateWatermarkImageStartXY


public function clear()
{
}


/**
* {@inheritDoc}
*/
public function convertAlpha127ToRgba($number)
{
return parent::convertAlpha127ToRgba($number);
}// convertAlpha127ToRgba


public function crop($width, $height, $start_x = '0', $start_y = '0', $fill = 'transparent')
{
}
Expand Down

0 comments on commit 409f893

Please sign in to comment.