Vice Admiral
Vice Admiral
1208 views

Export photo attribute to file

Hi,

I've to export the user's photo attribute to a jpg file with a null driver.
Is there a function that allows it to be done in reverse of how it works is: readImage ($ varFilePath)?

Any other idea?

Regards

José Luis

Labels (1)
0 Likes
8 Replies
Commander
Commander

I don't believe there is a built-in IDM token for reading from the file system but you could easily accomplish this with an ECMAScript function.  For example:

function readImage(imagePath)
{
BufferedImage img = null; try { img = ImageIO.read(new File(imagePath)); }
catch (IOException e) { }
return img;
}

 

Knowledge Partner Knowledge Partner
Knowledge Partner

Null is probably the wrong tool for the job. Use the DelimText driver where that's a built in feature. Make sure to get the latest patch for the driver shim.
Knowledge Partner Knowledge Partner
Knowledge Partner

By the way, Stefaan's Generic File Driver for IDM include functionality for support images from version 1.1
https://community.microfocus.com/t5/Identity-Manager-Tips/Generic-File-Driver-for-IDM-v-1-2/ta-p/1771901

version 1.1, 17-JAN-2018 (package 0.9, sample config package 0.1)
Shim feature: Added option to define sensitive attributes
Shim feature: Added ImageFileReader and RawFileReader

Knowledge Partner Knowledge Partner
Knowledge Partner

Have to second Stefaan's driver.  In addition to reading/writing images, it also adds meta data with the image size in pixels..  You can then use it to resize the images to as standard size, or use the info about the size in policy.

Very cool.

 

Knowledge Partner Knowledge Partner
Knowledge Partner

>Have to second Stefaan's driver
Are you talking about Universal driver for Text Protocols?

According to documentation and presentation it doing a really cool things!
0 Likes
Knowledge Partner Knowledge Partner
Knowledge Partner

Alex: No, I was referring to his Generic File Driver. I  would like t play with Universal Driver for Text protcols. I played with an early version of his HTTP driver, before he made it commercial (Good for him!) and it was mighty clever.

 

Knowledge Partner Knowledge Partner
Knowledge Partner

I see...
I didn't tried image functionality of Generic File driver yet. Just "native" (and really cool) CSV files handling functionality.
Knowledge Partner Knowledge Partner
Knowledge Partner

Basically he uses ImageMagik to do the resizing, since it is Java based, so using existing code and had to write minimal amounts of his own. Clever fellow that Stefan.

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.