Skip to content

Commit

Permalink
make utility functions usable for subclasses (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
s4msung authored and claviska committed Sep 26, 2019
1 parent 18592bf commit 3786d80
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/claviska/SimpleImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public function fromString($string) {
//
// Returns an array containing the image data and mime type.
//
private function generate($mimeType = null, $quality = 100) {
protected function generate($mimeType = null, $quality = 100) {
// Format defaults to the original mime type
$mimeType = $mimeType ?: $this->mimeType;

Expand Down Expand Up @@ -383,7 +383,7 @@ public function toString($mimeType = null, $quality = 100) {
//
// Returns an int|float value.
//
private static function keepWithin($value, $min, $max) {
protected static function keepWithin($value, $min, $max) {
if($value < $min) return $min;
if($value > $max) return $max;
return $value;
Expand Down Expand Up @@ -464,7 +464,7 @@ public function getWidth() {
//
// Same as PHP's imagecopymerge, but works with transparent images. Used internally for overlay.
//
private static function imageCopyMergeAlpha($dstIm, $srcIm, $dstX, $dstY, $srcX, $srcY, $srcW, $srcH, $pct) {
protected static function imageCopyMergeAlpha($dstIm, $srcIm, $dstX, $dstY, $srcX, $srcY, $srcW, $srcH, $pct) {
// Are we merging with transparency?
if($pct < 100) {
// Disable alpha blending and "colorize" the image using a transparent color
Expand Down Expand Up @@ -1577,7 +1577,7 @@ public function sketch() {
//
// Returns a color identifier.
//
private function allocateColor($color) {
protected function allocateColor($color) {
$color = self::normalizeColor($color);

// Was this color already allocated?
Expand Down

0 comments on commit 3786d80

Please sign in to comment.