mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/15769] Minor clean up of avatar cropping
PHPBB3-15769
This commit is contained in:
parent
4d860bf967
commit
0bff9e605b
2 changed files with 4 additions and 7 deletions
|
@ -24,7 +24,7 @@ use phpbb\storage\exception\exception as storage_exception;
|
|||
use phpbb\storage\storage;
|
||||
|
||||
/**
|
||||
* Handles avatars uploaded to the board
|
||||
* Handles avatars uploaded to the board.
|
||||
*/
|
||||
class upload extends \phpbb\avatar\driver\driver
|
||||
{
|
||||
|
@ -241,7 +241,6 @@ class upload extends \phpbb\avatar\driver\driver
|
|||
*/
|
||||
public function delete($row)
|
||||
{
|
||||
|
||||
$error = array();
|
||||
$prefix = $this->config['avatar_salt'] . '_';
|
||||
$ext = substr(strrchr($row['avatar'], '.'), 1);
|
||||
|
|
|
@ -213,7 +213,7 @@ class image_cropper
|
|||
$flip_mode |= $flip_horizontally ? IMG_FLIP_HORIZONTAL : 0;
|
||||
$flip_mode |= $flip_vertically ? IMG_FLIP_VERTICAL : 0;
|
||||
|
||||
if ($flip_mode !== 0)
|
||||
if (0 !== $flip_mode)
|
||||
{
|
||||
imageflip($image, $flip_mode);
|
||||
}
|
||||
|
@ -249,13 +249,11 @@ class image_cropper
|
|||
*/
|
||||
public static function crop_image($image, int $x, int $y, int $width, int $height)
|
||||
{
|
||||
$new_image = imagecrop($image, [
|
||||
return false !== ($new_image = imagecrop($image, [
|
||||
'x' => $x,
|
||||
'y' => $y,
|
||||
'width' => $width,
|
||||
'height' => $height,
|
||||
]);
|
||||
|
||||
return false !== $new_image ? $new_image : $image;
|
||||
])) ? $new_image : $image;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue