Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Aiheen aloitti: Nomadic - syyskuu 19, 2011, 05:16:58 IP

Otsikko: Avatars not resizing properly
Kirjoitti: Nomadic - syyskuu 19, 2011, 05:16:58 IP
SMF Version: 1.1.15
Theme: Silverplus
Site: www.thecbg.org (http://www.thecbg.org)

Haha yes I'm back, well more correctly this is another avatar issue but as it's separate I figured it would be better to create a separate thread. Basically if anyone uploads an avatar to my forums if the avatar is a jpg image instead of resizing it so that the height and width are each 100px or less it resizes the height to 90px and ignores the width. The end result being that any very small avatars get blown up and pixelated and any short avatars get so wide that it creates a scrollbar under the avatar. It doesn't do this for png images (they get scaled right). For settings I'm using this:



Though I don't think it's that I think it's something in the code itself. The reason I say that is that the jpegs DO scale right in the profile avatar preview window the only place they screw up is the avatar image in posts and the avatar image when you look at the actual profile main page.
Otsikko: Re: Avatars not resizing properly
Kirjoitti: Antechinus - syyskuu 19, 2011, 07:22:02 IP
Use the javascript resize. Frankly, I think the HTML resize option should be dropped as it's pretty much useless.
Otsikko: Re: Avatars not resizing properly
Kirjoitti: Nomadic - syyskuu 20, 2011, 04:23:32 AP
Lainaus käyttäjältä: Antechinus - syyskuu 19, 2011, 07:22:02 IP
Use the javascript resize. Frankly, I think the HTML resize option should be dropped as it's pretty much useless.

Unfortunately the javascript resize does nothing. HTML resize resizes things at least (though it makes them all 1:1 aspect ratio) and the GD resize works as long as the image is a png. Javascript does nothing.

Update: looks like GD resize isn't working either. Basically I have a site where it's critical that avatars have a maximum size and they aren't getting resized right. They are randomly getting resized so that they have a height of 90px. Thus an image that is 100 wide and 30 high gets scaled to 300 wide and 90 high. Not all avatars are doing this, but quite a few are.
Otsikko: Re: Avatars not resizing properly
Kirjoitti: Nomadic - syyskuu 21, 2011, 02:41:51 IP
Giving this a bump
Otsikko: Re: Avatars not resizing properly
Kirjoitti: Angelina Belle - syyskuu 26, 2011, 04:58:14 IP
Does this also happen in the default theme?
Otsikko: Re: Avatars not resizing properly
Kirjoitti: Antechinus - syyskuu 26, 2011, 05:34:41 IP
Not sure what is going on here. I use the js resize with 1.1.x on a site and it works as it should. I stopped using the HTML resize because the js was so much better. The only way that I can think of the js not working is if somebody disabled it, either by a browser/add-on setting or by editing the default code.

ETA: The other thing you can do is use css to override the admin settings. I have a smartphone theme that uses smaller avatars than the full size theme. This is achieved by using css override, like this:

div.avatars{float:left; overflow:hidden; width:125px; padding:3px; height:75px;}
div.avatars img{width:63px; height:75px; border-radius: 0.5em;}
Otsikko: Re: Avatars not resizing properly
Kirjoitti: Angelina Belle - syyskuu 26, 2011, 08:27:26 IP
* Maybe the custom theme has modified JS
* Maybe another JS file is missing, causing the resize JS to fail
* Maybe a mod has done "something else" unexpected.