Skip to content

Commit

Permalink
fix php 8.1 deprecated warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
antonlukin committed Aug 23, 2023
1 parent 6ae4173 commit 1e0b7e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "antonlukin/poster-editor",
"version": "5.9",
"version": "5.10",
"description": "Wrapper for PHP's GD Library for easy image manipulation",
"keywords": ["php", "image", "text", "gd"],
"homepage": "https://github.com/antonlukin/poster-editor",
Expand Down
6 changes: 3 additions & 3 deletions src/PosterEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @package PosterEditor
* @author Anton Lukin <[email protected]>
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
* @version Release: 5.9
* @version Release: 5.10
* @link https://github.com/antonlukin/poster-editor
*/
class PosterEditor
Expand Down Expand Up @@ -945,7 +945,7 @@ function ($c) {
);
}

$opacity = $options['opacity'] / 100 * 127;
$opacity = intval($options['opacity'] / 100 * 127);

// Create image color width opacity.
return imagecolorallocatealpha($this->resource, $rgb[0], $rgb[1], $rgb[2], $opacity);
Expand Down Expand Up @@ -1018,7 +1018,7 @@ protected function getOffset($options, $lines, $index)
$y = $y + ($options['height'] - $height * $bias) / ($bias - 1) * $index;
}

return array($x, $y, $width, $height);
return array_map('intval', array($x, $y, $width, $height));
}

/**
Expand Down

0 comments on commit 1e0b7e2

Please sign in to comment.