0

can anyone figure out why my Bot Hero Card isn't displaying an image (provided as Base64 string)? It just shows as a broken image. Not sure what I'm doing wrong. I obtain the base64 string from an external function, then use it as per the below:

            var messageCard = context.MakeMessage();
            var rbmCard = new HeroCard
            {
                Title = rbm,
                Subtitle = userDetails.department,
                Images = new List<CardImage> { new CardImage(url:$"data:image/jpeg;base64,{userThumbnail}") },
                Text = $"{userDetails.givenName} is based at {userDetails.streetAddress}. Here are some additional information and activities available for this person",
                Buttons = new List<CardAction> { new CardAction(ActionTypes.OpenUrl,$"Call {rbm}",null,null, $"http://tel: +{userDetails.mobile}"), new CardAction(ActionTypes.OpenUrl,"Email",null,null,$"http://mailto:{userDetails.mail}") }
            };

            messageCard.Attachments = new List<Connector.Attachment>();
            messageCard.Attachments.Add(rbmCard.ToAttachment());
            await context.PostAsync(messageCard);
JamesMatson
  • 2,522
  • 2
  • 37
  • 86

1 Answers1

0

Try replacing jpeg to svg+xml.. it worked for me.

Images = new List { new CardImage(url:$"data:image/svg+xml;base64,{userThumbnail}") },

Kam.B
  • 21
  • 2