1

It seems that Drupal doesn't store the width and height of uploaded user profile pictures (standard profile, not profile2).

I would like to be able to link the profile thumbnail to a larger version if the uploaded image is larger than 480 pixels.

Is that possible without jumping through too many hoops?

I can require new users to upload pictures with a minimum size but I have imported lots of profile pictures and many are smaller than 480 pixels wide or high.

2

You can add an image field to the user entity. Then you can create a custom field formatter that can check if images are over a certain size and display a link to the larger size if they are. Here is an article on creating a field formater in Drupal 7: http://www.computerminds.co.uk/articles/creating-new-field-formatters-drupal-7

1

You should be able to so everything with Image cache. Create a layout for the user profile picture and tell fields to link to the original One.

  • thanks. I don't want to link to the original if the original isn't larger enough. However, for simplicity I might just do that. I'm sure one day user pictures will be real entities in Drupal which will solve this issue. – uwe Feb 25 '12 at 21:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.