How to display an image in base64 format?image

Hi all,

I am looking for a way to display an image like that:

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGYAAAAyAQMAAACUDjzAAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAkElEQVQokWNgjO30+zrra9FC4SWaVxhGeaM8IM+BAQhYQQSDCBqv0Pk5R0FzKyN7zeP5IgydDhpTOltYmTpYRQJEGDoYPBZxdTCwBHAKxDEAee5KBv0MLHGcghMZGCoYOhZxdDSwBAp8cGRg4IDzBIA8AUaOKR0dDUwTFVQCGRgeMLJzFD9nYORTPNzHgA8AAJ6CFJM587x7AAAAAElFTkSuQmCC

It is not working because a!imageField is expecting a safeLink value only.

Thanks,

Sebastien

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    Hi adding to above comments,

    Also when you are dealing with Base64 format, it's a memory intensive operation and not recommended to use.

    Use case 1: Let's assume, my document size is 500 MB, when we convert it into Bade64, its size may exceed 500 MB (600 MB approximately) which is much higher than the actual size of the document.

    Use case 2: let's say you are planning to use a smart service which will hold the Base64 data and will convert it to a appian document and store it into Appian's Knowledge Centre, which you use to display in Interface, it's a very Highly memory intensive operation, where a variable will hold 600 MB of Base64 (let's assume) into its memory at once for further processing.

    Use case 3: Let's assume the heap size specified for the JVM of my server instance is 500 MB, in such case while storing these Base64 data into a variable(600 MB) will cause you OutOfMemoryError


    Hope this will add you more clarity about the various pros and cons while dealing with Base64 approach. And hence it's not recommended to use.
Reply
  • 0
    Certified Lead Developer
    Hi adding to above comments,

    Also when you are dealing with Base64 format, it's a memory intensive operation and not recommended to use.

    Use case 1: Let's assume, my document size is 500 MB, when we convert it into Bade64, its size may exceed 500 MB (600 MB approximately) which is much higher than the actual size of the document.

    Use case 2: let's say you are planning to use a smart service which will hold the Base64 data and will convert it to a appian document and store it into Appian's Knowledge Centre, which you use to display in Interface, it's a very Highly memory intensive operation, where a variable will hold 600 MB of Base64 (let's assume) into its memory at once for further processing.

    Use case 3: Let's assume the heap size specified for the JVM of my server instance is 500 MB, in such case while storing these Base64 data into a variable(600 MB) will cause you OutOfMemoryError


    Hope this will add you more clarity about the various pros and cons while dealing with Base64 approach. And hence it's not recommended to use.
Children
No Data