Modules - Extras: Resize profile photo to defined size
This feature was added in extras 3.9.0.
This feature is disabled by default. Enable to processor "extras-photo-resize-processor" to use it.
This feature allows you to resize user profile photos to a defined size. The processor automatically adjusts the size of the inserted profile photo according to the specified configuration and the new photo saves.
Configuration:
- idm.sec.extras.profile.photo.max.height = PX (a number representing the maximum pixels a photo can have in height)
- idm.sec.extras.profile.photo.max.size.kb = Kb (a number representing the maximum photo size in Kb)
- idm.sec.extras.profile.photo.max.width = PX (a number representing the maximum pixels a photo can have in width)
New groovy scripts:
Extras 3.9.0. also includes new Groovy scripts that are useful for working with profile photos.
- extrasGetProfilePhotoFromAD - Script for synchronization from Active Directory, which sets the user's profile photo according to the value of the thumbnailPhoto attribute. It only works if the login in IdM is the same as sAMAccountName. Is necessary to map the script to some new text eav. Eav can be deleted after the synchronization is finished.
- extrasGetProfilePhotoResized - Script for provisioning user profile photo to the connected system with a similar function as with extras-photo-resize-processor, with the difference, that the profile photo is resized during provisioning to the system. The script returns the profile photo resize according to the configuration as a byte array. The following property must be added to the script call .addParameter('imageMaxWidth', VALUE IN PX) .addParameter('imageMaxHeight', VALUE IN PX) .addParameter('imageMaxSizeKb', VALUE IN Kb). The script is suitable to use if you need to send a photo in a different format to each of the connected systems. Extras-photo-resize-processor does not need to be activated for the script to work properly. If you don't need to change the photo format, you can use the extrasGetProfilePhoto script, which only converts the photo into a byte array.