phpbb_users
user_avatar
- not an empty string user_avatar_height
- empty string or 0phpbb_users
user_avatar
- not an empty string user_avatar_height
- empty string or 0In any case it can be avoided I think, such an error. Like providing a fallback.Татьяна5 wrote: Mon Dec 13, 2021 6:37 pm ...
Someone has an avatar set but its height is zero. This cannot be, this is an error in the database.
That's perfectly fine as per https://github.com/phpbb/phpbb/blob/dc9 ... 1051-L1052HaioPaio wrote: Tue Dec 14, 2021 10:19 am There are indeed a number of users in my database with an widht and height entry of zero
As I said in that topic, you do not have problems with your DB.HaioPaio wrote: Tue Dec 14, 2021 10:19 am ...
I have opened a separate topic for my database problem here viewtopic.php?f=661&t=2609321.
user_avatar_type
and user_avatar
with user_avatar_width
and user_avatar_height
... somehow, IMHO.0
for avatar width and height in the database is not a malfunction. Code: Select all
'avatar_height' => $file->get('height'),
Code: Select all
if (($width <= 0 || $height <= 0) && (($image_data = $this->imagesize->getImageSize($url)) === false))
{
$error[] = 'UNABLE_GET_IMAGE_SIZE';
return false;
}
Code: Select all
$dims = $this->imagesize->getImageSize($file_path . '/' . $image);
Code: Select all
if (($row['avatar_width'] <= 0 || $row['avatar_height'] <= 0) && (($image_data = $this->imagesize->getImageSize($url)) === false))
{
$error[] = 'UNABLE_GET_IMAGE_SIZE';
return false;
}
The default value, 0, can be set if the user_avatar is empty3Di wrote: Tue Dec 14, 2021 10:40 amThat's perfectly fine as per https://github.com/phpbb/phpbb/blob/dc9 ... 1051-L1052HaioPaio wrote: Tue Dec 14, 2021 10:19 am There are indeed a number of users in my database with an widht and height entry of zero
The issue here is how the maths are done.
Avoiding a "division by zero" is something I personally faced a bunch of times, BTW.
You are missing the obvious, ZERO is the default value for anyone since the phpBB is installed, vanilla.Татьяна5 wrote: Tue Dec 14, 2021 1:32 pm The default value, 0, can be set if the user_avatar is empty
131
IMHOCode: Select all
if ($row['user_avatar'])