Topic-icon Avatar image quality=not good

Active Subscriptions:

None
10 years 9 months ago #34355 by mortega1
Hi,

I for some reason cannot get the main profile picture/avatar to render properly, and by properly I mean good quality.

In the JomSocial configuration I have set the quality to the highest possible and the path to ImageMagick is /usr/bin/convert (I'm on a CentOs distro).

I'm not sure if this is a JomSocial issue or JLinked. LinkedIn profiles have 2 profile pictures for each user, one small and one large. Which one does JLinkedIn pull to generate the JomSocial avatar?

Any help would be appreciated because I look quite fuzzy right now - def not hot. Thanks! :)

-Manny
The topic has been locked.
Support Specialist
10 years 9 months ago #34377 by alzander
Manny,
JLinked currently imports the default image that the LinkedIn API allows us to get. That image, unfortunately, is only 80 (or may 100) pixels square. It does look like there is a newer method now available that may allow us to fetch the original user profile image (with the LinkedIn logo still). That will require some processing, like is already done with ImageMagick in JomSocial.

We're investigating this alternative method to get a bigger avatar and will let you know when we find something. It will likely take a few days though, but hopefully not too long.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
10 years 9 months ago #34456 by mortega1
Hi Alex,

Thanks for the quick response as always!

Any word on progress implementing this new method for LinkedIn avatar images?

-Manny
The topic has been locked.
Active Subscriptions:

None
10 years 9 months ago #34568 by mortega1
Hi Alex,

Any update on this front?

-Manny
The topic has been locked.
Support Specialist
10 years 9 months ago #34597 by alzander
Manny,
Sorry to keep you waiting on this. It took a little more investigation than I thought, but there is a solution and it's very easy to implement. I can't stress enough that you should watch the avatars that are imported for a while as JomSocial will need to format them properly. It *should*, but if someone happens to have an original profile image with really strange dimensions (like 100x2000px), it may import wonky. Of course, you can try uploading a strange image and trying as well.

To test out the code, edit the /components/com_jlinked/libraries/profile.php file. In the getAvatarURL function, around line 249, you'll see:
$jlinkedLibrary = JLinkedApiLibrary::getInstance();
        $data = $jlinkedLibrary->api('profile', $liMemberId . ':(picture-url)');
        $avatarUrl = $data->get('picture-url');
Modify the last 2 lines like so:
$jlinkedLibrary = JLinkedApiLibrary::getInstance();
        $data = $jlinkedLibrary->api('profile', $liMemberId . ':(picture-urls::(original))');
        $avatarUrl = $data->get('picture-urls.values.0');
One final note.. that function is meant to pull all the original avatars the user has uploaded. Because of that, it's returning a list of images for the user. In my testing, I only ever saw one image returned, and that's why the code above uses "values.0". JLinked will always just return the first image in the list.

I honestly don't know if more images are ever returned, but again, this is something to test.. make sure that the actual profile image for the user on LinkedIn is what's imported into your system of choice.

I hope that helps, but please, please give us feedback either way. This is something we'll test and likely implement in the next JLinked release, but having real-world feedback always helps provide some extra confidence to the solution.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
10 years 8 months ago #34989 by paulzmuda
Thank you thank you thank you thank you! Looking good so far, please add to next version :) I actually came across this via cached version of this thread in a google search result. I've been playing with different variations of picture-urls::(original) to fit next to $avatarUrl the last couple hours. I wish I saw this thread earlier I would've gone to sleep before midnight tonight hehe
The topic has been locked.
Support Specialist
10 years 8 months ago #34999 by alzander
Very glad to hear that got it going for you. Always feel free to ask here first when you are running into issues, and we'll help how we can. This change should be included in the next release.

If you need anything else, just let us know!

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
10 years 8 months ago #35002 by paulzmuda
Actually I did have a couple questions, maybe i'm missing something but...

1) is import of values from LinkedIn to existing JomSocial profiles a feature yet in the newest download? I dug up an old thread where you resolved a question with a workaround (like for the one above) that involved adding a button anywhere you'd like that allows users to re-import their profile. However when I tried it it didnt work for me. Is it because this is already a feature? I can't seem to find it.

2) also for the life of me I havent been able to add "State" and "Country" to the mapped fields in the JLinked setup. I've made sure those fields are visible and published in Jomsocial and they are added to my custom profiles as well. Yet still, the State field and the Country field won't come up. I'm not in the position to be able to make new fields for those because I already have a members database with 99% of the members having that field populated. In a seperate thread in the Joomla 2.5 forum on this site I mentioned a way to parse the address but i'm unable to Parse the State and Country into fields that aren't mapped yet.

3) could you suggest a good plugin (unless I should just develop myself) for a way to search a Jomsocial database in a similar fashion to LinkedIn? The last piece to my puzzle is a good advanced search page (to look just like LinkedIn's) because we can't stand the default Jomsocial search function.

I did some digging around but while I have your attention I hoped to ask if you could point me in the right direction.

Thanks!
The topic has been locked.
Support Specialist
10 years 8 months ago #35018 by alzander
Paul,
1) For import into JomSocial, we still don't have a user-option to allow the import to happen. You can configure whether the profile is imported on registration or login, currently, but not by the user clicking something. We could help you implement this as we've helped others, and it still is on our to-do list, but it's simply not a highly requested feature.

2) The social profile plugins currently only import into text type fields. The reason is that the data from Facebook is usually 'free form' and could be any value. There's not really a guarantee that the country LinkedIn returns would be in the choices in JomSocial, or may be different, like "US" vs "USA" vs "United States". If you want to experiment, you can update the /plugins/socialprofiles/jomsocial/jomsocial.php file. In there, around line 55, you'll see:
protected function getProfileFields()
    {
        $query = 'SELECT * FROM #__community_fields WHERE type="text" OR type="textarea" OR type="date" OR type="birthdate" OR type="url" ORDER BY ordering';
Update that query to:
$query = 'SELECT * FROM #__community_fields WHERE type="text" OR type="textarea" OR type="date" OR type="birthdate" OR type="url" OR type="country" OR type="state" ORDER BY ordering';
That will allow you to see the state and country fields in the Profiles area of JLinked and map them to the state/country fields of Linked. From your other post about parsing out addresses, I think you probably can take it from here and translate US to United States or whatever is necessary.

We have hopes, later this year, to create the proper mappings for all the default JomSocial states/countries to what Facebook and LinkedIn return and have those as fields that can be imported into. It's just not something we support yet.

3) Unfortunately, I don't have any suggestions here. I've never really used their search, don't know how good or bad it is, and don't know of any replacements to suggest at all. Sorry I can't help you here.

I hope that helps, but if you have any other questions, just let us know.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
10 years 8 months ago #35033 by paulzmuda
1) So unless its your first time (registering) new fields won't import from LinkedIn? I have a tester profile that I made additional profile changes in LinkedIn but when logging into Jomsocial again via JLinked the new fields didn't update. I just want to make sure we always have the user's most current info.

2) THAT DID IT!!! AGAIN THANK YOU! Seriously I wouldn't have found that one on my own for weeks. The only part I had to tweak in the query was instead of type="state" for me it was type="select" because in my version of JomSocial under custom profiles there is no state as a type but a select with all the states in it. The Google API I mentioned in the other thread allows me to specify exactly which version short/abbreviated or full name of country/state that I want it to spit out.

3) No worries, I dont think ill ever find something exactly the way we need it. A weekend project :P
The topic has been locked.