Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avatar dimensions height|width should be width|height #208

Open
frostschutz opened this issue May 27, 2018 · 3 comments
Open

avatar dimensions height|width should be width|height #208

frostschutz opened this issue May 27, 2018 · 3 comments

Comments

@frostschutz
Copy link

A user in german forum reported distorted/squashed avatars after merge, and unless I'm completely misreading things, the merge system switched width and height?

makes no difference for avatars that are square, hard to notice for avatars that are almost square, but for portrait/landscape avatars they get their dimensions distorted.

According to MyBB code it should be width|height, not height|width:

usercp.php: $avatar_dimensions = $avatar['width']."|".$avatar['height'];
usercp.php: $avatar_dimensions = (int)$width."|".(int)$height;

In the merge system it's the other way around almost throughout:

width X height: (correct width|height?)

./boards/vbulletin3/users.php:81: $insert_data['avatardimensions'] = $width.'|'.$height;

height X width: (wrong height|width?)

./boards/vbulletin3/avatars.php:80: $insert_data['avatardimensions'] = "{$data['height']}|{$data['width']}";

(No idea why avatardimensions is done twice for vbulletin3)

Others:

./boards/xenforo/avatars.php:63: $this->dimension = "{$maxheight}|{$maxwidth}";
./boards/xenforo/avatars.php:69: $insert_data['avatardimensions'] = "{$data['avatar_height']}|{$data['avatar_width']}";
./boards/wbb4/avatars.php:66: $this->dimension = "{$maxheight}|{$maxwidth}";
./boards/wbb4/avatars.php:72: $insert_data['avatardimensions'] = "{$data['height']}|{$data['width']}";
./boards/wbb3/avatars.php:67: $this->dimension = "{$maxheight}|{$maxwidth}";
./boards/wbb3/avatars.php:73: $insert_data['avatardimensions'] = "{$data['height']}|{$data['width']}";
./boards/vbulletin5/avatars.php:80: $insert_data['avatardimensions'] = "{$data['height']}|{$data['width']}";
./boards/vbulletin4/avatars.php:80: $insert_data['avatardimensions'] = "{$data['height']}|{$data['width']}";
./boards/vbulletin3/avatars.php:80: $insert_data['avatardimensions'] = "{$data['height']}|{$data['width']}";
./boards/smf2/avatars.php:66: $insert_data['avatardimensions'] = "{$data['height']}|{$data['width']}";
./boards/smf/avatars.php:66: $insert_data['avatardimensions'] = "{$data['height']}|{$data['width']}";
./boards/punbb/avatars.php:57: $insert_data['avatardimensions'] = "{$data['avatar_height']}|{$data['avatar_width']}";
./boards/phpbb3/avatars.php:71: $insert_data['avatardimensions'] = "{$data['user_avatar_height']}|{$data['user_avatar_width']}";
./boards/phpbb3/avatars.php:77: $insert_data['avatardimensions'] = "{$data['user_avatar_height']}|{$data['user_avatar_width']}";
./boards/phpbb3/avatars.php:89: $insert_data['avatardimensions'] = "{$maxheight}|{$maxwidth}";
./boards/ipb4/avatars.php:59: $insert_data['avatardimensions'] = "{$data['pp_main_height']}|{$data['pp_main_width']}";
./boards/ipb4/avatars.php:86: $insert_data['avatardimensions'] = "{$maxheight}|{$maxwidth}";
./boards/ipb3/avatars.php:61: $insert_data['avatardimensions'] = "{$data['pp_main_height']}|{$data['pp_main_width']}";
./boards/ipb3/avatars.php:82: $insert_data['avatardimensions'] = "{$maxheight}|{$maxwidth}";
./boards/bbpress/avatars.php:43: $this->dimension = "{$maxheight}|{$maxwidth}";

@AndreRl
Copy link
Contributor

AndreRl commented May 28, 2018

Interesting find, although development for the merge system has seized.

@euantorano
Copy link
Member

euantorano commented May 28, 2018 via email

@frostschutz
Copy link
Author

frostschutz commented May 28, 2018

issues should be reported either way

it's open source, maybe someone will pick it up, or it will be necessary to do a minor update release for mybb 1.9, who knows

there is not much development necessary for a merger that is mostly in working order and will be used only once

so I'm just leaving this here. also came up with some queries to flip the height|width values after merge, still untested though:


UPDATE mybb_users
SET avatardimensions = CONCAT(
   SUBSTRING(avatardimensions, LOCATE('|', avatardimensions) + 1),
   '|',
   SUBSTRING(avatardimensions, 1, LOCATE('|', avatardimensions) - 1)
)
WHERE avatardimenions LIKE '%|%';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants