merge-system icon indicating copy to clipboard operation
merge-system copied to clipboard

avatar dimensions height|width should be width|height

Open frostschutz opened this issue 6 years ago • 3 comments

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}";

frostschutz avatar May 27 '18 22:05 frostschutz

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

AndreRl avatar May 28 '18 07:05 AndreRl

For an issue like this that’s easy to patch, I see no reason to reject a PR or anything if anybody has a chance to write one.

On 28 May 2018, at 08:32, Andre R. | Wires [email protected] wrote:

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

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

euantorano avatar May 28 '18 11:05 euantorano

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 '%|%';

frostschutz avatar May 28 '18 11:05 frostschutz