OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



How to Change the Profile Image size

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

How to Change the Profile Image size

Postby dankomed » Sun Feb 16, 2014 2:10 am

In the Editorial Team Bio pages one can display a Profile Image. Currently the accepted image size is 150 x 150 pixels.
Is it possible to edit manually the OJS code, so that to change this size?

I suspect a change in at least of couple of the OJS files will be needed - a place where the display of the profile image is specified, and also a place where the size of the uploaded profile image is checked and rejected if bigger.

It would be helpful to know the folders and the file names that I need to edit in the OJS.

Kind Regards
dankomed
 
Posts: 38
Joined: Thu May 03, 2012 8:09 pm

Re: How to Change the Profile Image size

Postby JasonNugent » Mon Feb 17, 2014 7:12 am

Hi dankomed,

The code for handling uploaded profile images is done in classes/user/form/ProfileForm.inc.php. There is a method called uploadProfileImage() that contains tests for the dimensions of the image. You don't have to edit any of the templates because the image sizes included there are dynamically pulled from the uploaded image itself.

Regards,
Jason
JasonNugent
Site Admin
 
Posts: 849
Joined: Tue Jan 10, 2006 6:20 am

Re: How to Change the Profile Image size

Postby dankomed » Mon Feb 17, 2014 1:06 pm

Dear JasonNugent,

Thanks for the reply. In the uploadProfileImage() function I have edited the following line:
Code: Select all
if ($width > 150 || $height > 150 || $width <= 0 || $height <= 0) {

into:
Code: Select all
if ($width > 250 || $height > 300 || $width <= 0 || $height <= 0) {

and I all worked nice with images 250x300 as expected.

However, when I upload oversized image, the error message says:
" Invalid profile image format or image too big. Accepted formats are .gif, .jpg, or .png, and the image must not exceed 150x150 pixels."

I would like to know in which file this error message is located so that I can edit it consistently with my change.
Thanks in advance!
dankomed
 
Posts: 38
Joined: Thu May 03, 2012 8:09 pm

Re: How to Change the Profile Image size

Postby JasonNugent » Tue Feb 18, 2014 7:21 am

Hi again,

That's just a locale key in lib/pkp/locale/en_US/user.xml. You can search for it pretty quickly.

Regards,
Jason
JasonNugent
Site Admin
 
Posts: 849
Joined: Tue Jan 10, 2006 6:20 am

Re: How to Change the Profile Image size

Postby dankomed » Tue Feb 18, 2014 11:13 am

Thanks! It worked.
dankomed
 
Posts: 38
Joined: Thu May 03, 2012 8:09 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot] and 2 guests