Skip to main content
17-Peridot
November 11, 2022
Solved

Base64 URL with Image Widget

  • November 11, 2022
  • 2 replies
  • 3877 views

Is it possible to load base64 string as source URL to image widget and display the image?

 

I tried as below with jpeg image, but it's not working... It doesn't showing any Image. just white space.

 

Sathishkumar_C_0-1668172347454.png

 

Example: Display Base64 Images in HTML

Best answer by slangley

Hi @Sathishkumar_C.

 

ThingWorx 9.3.8 has been released.  Please validate the fix for this issue is as expected.

 

Regards.

 

--Sharon

2 replies

16-Pearl
November 15, 2022

I tried using "Image" widget and "ValueDisplay" and both were working fine on TWX 9.1.1:

nmutter_1-1668525971775.png

 

 

- ValueDisplay-widget you can set the renderer to "Image"

nmutter_0-1668525692738.png

and set the data to your <base64_string> without the prefix - it automatically seems to add "data:image/png;base64," to it

 

Image widget choose "ImageURL" and paste the whole string ( I used the example from your linked page).

nmutter_2-1668526002893.png

 

You need to adapt the width/height of the image urself.

 

Edit: attached my sample mashup 

17-Peridot
November 16, 2022

Thanks for the replay. I'm fine with given suggestion.

But, I reframe the question... When I'm trying to pass base64 string as dynamic source URL to image widget. Its giving me a whitespace.

 

The same working with Value Display. I want use image widget with source URL with base64 string.

16-Pearl
November 25, 2022

I also tried to bind it but was not yet successful. It always puts the hostname before the base64 string - e.g. "https://localhost/data&colon;image png...." which does not work

17-Peridot
December 13, 2022

As of now, don't have solution for this. PTC team confirmed, this feature will be available from Thingworx 9.3.8.

slangleyCommunity ManagerAnswer
Community Manager
May 1, 2023

Hi @Sathishkumar_C.

 

ThingWorx 9.3.8 has been released.  Please validate the fix for this issue is as expected.

 

Regards.

 

--Sharon