Coming soon: Your brand new Help Center & Community! Get a sneak-peek here

GetPersonImage problem in SuperOffice 8.2

I have a customer that has testupgraded to 8.2R06 and then got a problem with the GetPersonImage method.

They get the message «A generic error occurred in GDI+»

They have tried both with the PersonAgent and the BlobAgent. The code worked just fine in both 7.5 and 8.0.

Are there any known bugs with this in 8.2R06?

This is the part of the code:

using (var blob = new BLOBAgent())
            {
                var image = blob.GetPersonImage(693);
                if (image != null)
                {
                    MemoryStream ms = new MemoryStream();
                    image.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                    response = ms.ToByteArray();
                    return response;
                }
                else
                {
                    return new byte[0];
                }
            }

RE: GetPersonImage problem in SuperOffice 8.2

HI Ingar,

I have tried it here using NetServer 8.2 R06 (8.2.6689.1603) and am not able to reproduce this error. Works OK here.

Have you changed something else in your project?

Best regards.

Af: Tony Yates 13. jun 2018

RE: GetPersonImage problem in SuperOffice 8.2

You could also try the GetPersonImage method on the PersonAgent instead of the BLOBAgent. Seem to recall we had some issues where one worked, and one didn't.

Af: Frode Lillerud 13. jun 2018

RE: GetPersonImage problem in SuperOffice 8.2

@Tony

I'll ask ask the customer again if they have done some more changes

@Frode

PersonAgent or BlobAgent both gives the same error

Af: Ingar Karlsen 13. jun 2018

RE: GetPersonImage problem in SuperOffice 8.2

Hi again,

Both of these worked without any issues:

using (var personAgent = new PersonAgent())
{
    var image = personAgent.GetPersonImage(7);

    if (image != null)
    {
        MemoryStream ms = new MemoryStream();
        image.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
        var response = ms.ToByteArray();
        image.Save(@"C:\temp\personImage1.png");
        //return response;
    }
}
using (var blob = new BLOBAgent())
{
    var image = blob.GetPersonImage(7);
    if (image != null)
    {
        MemoryStream ms = new MemoryStream();
        image.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
        var response = ms.ToByteArray();
        image.Save(@"C:\temp\personImage2.png");
        //return response;
    }
}

Best regards.

Af: Tony Yates 14. jun 2018

RE: GetPersonImage problem in SuperOffice 8.2

This problem only occurs with certain types of png files. It has been resolved in NetServer 8.4 R08

Af: Matthijs Wagemakers 5. jun 2019