Plone Portrait Resolution

Hi peeps, I'm wondering what the best way is to increase the default portrait resolution of a user in Plone. At the moment it always outputs a 74x75px image, whereas the default image is 100x100px. This makes it a little hard to use in templates... I tried just setting it as a background image on an element but the resolution really is 1998.

I had a look at the https://github.com/4teamwork/ftw.avatar package but it doesn't work in Plone 5, I get the same error which is reported here https://github.com/4teamwork/ftw.avatar/issues/14.

So then my question is, HOW do you exactly increase the resolution of the portrait image, is there a simple solution to this or is it a lost cause..?

I made a custom user folder and CT for another project, however I'd like to avoid having to do all that simply for a portrait image.

Thanks for the help!

You are obviously mixing resolution and image size. AFAIK: the uploaded image is preserved as-is and scaled down for rendering on the fly (likely using plone.app.image) to the given size. There is neither upsampling nor downsampling involved. The image is just scaled down. Of course the "quality" (in particular for JPEG) may cause some quality issues. That's all.

-aj

1 Like

OK, so I kind of managed to get the result I was looking for by using this method and patching on instance start...

# -*- coding: utf-8 -*-
import logging


logger = logging.getLogger('my.site')

MEMBER_IMAGE_SCALE = (300, 300)
MEMBER_IMAGE_QUALITY = 100


def apply_portrait_patch():
    logger.info('Patching portrait scale to {0}'.format(MEMBER_IMAGE_SCALE))
    from Products.PlonePAS import config
    config.MEMBER_IMAGE_SCALE = MEMBER_IMAGE_SCALE
    config.IMAGE_SCALE_PARAMS['scale'] = MEMBER_IMAGE_SCALE
    config.IMAGE_SCALE_PARAMS['quality'] = MEMBER_IMAGE_QUALITY

Taken from the ftw.avatar package FYI...