Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

JoomlaTune Support Forum    JComments component    General discussion    Topic: Avatar is blurry
Pages: [1]   Go Down
  Print  
Author Topic: Avatar is blurry  (Read 1332 times)
0 Members and 1 Guest are viewing this topic.
carystein
Newbie
*

Karma: 0
Offline Offline

Posts: 3


Email
« on: July 01, 2010, 02:27:08 »

Via the 'style.css' i've changed the avatar to 128px and all the Gravatar Avatars are now blurry.

Has anyone got a fix for this?

Cheers
Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #1 on: July 01, 2010, 03:01:40 »

You could edit /components/com_jcomments/jcomments.php and replace:

Code: (php)
$comment->avatar = '<img src="http://www.gravatar.com/avatar.php?gravatar_id='. $comment->gravatar .'&amp;default=' . urlencode(JCommentsFactory::getLink('noavatar')) . '" alt="" />';
with
Code: (php)
$comment->avatar = '<img src="http://www.gravatar.com/avatar.php?gravatar_id='. $comment->gravatar .'&amp;size=128&amp;default=' . urlencode(JCommentsFactory::getLink('noavatar')) . '" alt="'.htmlspecialchars($comment->author).'" />';

But as written on Gravatar site: "You may request images anywhere from 1px up to 512px, however note that many users have lower resolution images, so requesting larger sizes may result in pixelation/low-quality images."
« Last Edit: July 01, 2010, 04:42:01 by smart » Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
carystein
Newbie
*

Karma: 0
Offline Offline

Posts: 3


Email
« Reply #2 on: July 01, 2010, 03:55:22 »

Hmm....I tried your solution but it didn't seem to do anything.  I wiped out the cach and tried multip PCs/browsers and found no change.

Any other ideas?
Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #3 on: July 01, 2010, 04:43:10 »

In my solution I've added '&amp;size=128' to link to gravatar (as described in documentation - http://gravatar.com/site/implement/images/#size) and it must work.
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
carystein
Newbie
*

Karma: 0
Offline Offline

Posts: 3


Email
« Reply #4 on: July 02, 2010, 23:17:27 »

As far as I can tell I've done exactly what you are sugesting.
I've modified 2 files.  See below:


In the file - jcomments.php I added the size=128 attribute.

if (empty($comment->avatar)) {
         $comment->avatar = '<img src="http://www.gravatar.com/avatar.php?gravatar_id='. $comment->gravatar .'&amp;size=128;&amp;default=' . urlencode(JCommentsFactory::getLink('noavatar')) . '" alt="" />';




In the file - style.css I modified the width attribute

/* Avatar */
#comments .comment-avatar img {width: 128px;border: none !important;}



With the modified CSS I get a larger avatar/gravatar, but it's blurry.


Am I doing something wrong?
Thanks so much for your help.
Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    General discussion    Topic: Avatar is blurry
 
Jump to: