3 Replies Latest reply: Jun 25, 2012 5:02 AM by Menno_H RSS

    Show base64 encoded image

    Menno_H
      Hi,

      I have an image that's saved in a blob field in the database as base64 encoded string. How can i display this image on the screen?

      I tried altering the source property like this:

      <amx:image source="data:image/gif,base64,#{bindings.Logo.inputValue}"/>

      But this doesn't seem to work, any ideas?

      Menno
        • 1. Re: Show base64 encoded image
          Denis T
          I had no problem with this with the following code. It may be an issue if your image is too large. Try with a different image or try re-encoding your base image to ensure it isn't corrupted.


          The following Java file:

          package mobile;

          public class MyClass {
          public MyClass() {
          super();
          }

          String myImage;
          String myImage2;

          public void setMyImage(String myImage) {
          this.myImage = myImage;
          }

          public String getMyImage() {
          return "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADkAAAA5CAYAAACMGIOFAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAADxtJREFUaN7tmnmMXVd9xz9nufets4/HY89iO3a8LxgCwQkxMVlwAnKTIoIAtZBSVS2lVf+gf1RCQm3VqkhVW9Q/qiJR9Y/2D1QJ/kFFEKBhUxOyYDtOvC/j2T3r2+92zukf93lmPJ6xx4Eix+2RfnPfexrddz/nt5zv+Z0n/vnr/zIE9HDvjkBLIT0gew9DCi2lcNzbw2kpJff60FL8X4CU/w/5toepVoimrpGMjpAtlejM5Gj1fToyPmdPnWT0I79BT2/vrwtS/GqzPAypnn6TQqXCNqVpKZXwJifRQYCLAlqcQM3NUK1W6JUb3lmetOUS8fmzrA8D9l27RkupTDI6RlyaxyYJFoETDqs1Jklo1Ov8ulLll4d0lujE6/TMzbNpbh49NERw9QqVxGC1QigFWgECBDilwBgc7p0BmYyP0XFtnIHRMbIXLtK4fIlGkkA2g9AeYiETXNNYuEop737I5MybDExOsP7CJeI3T1Gu1yGTQfjeUjcvd/sipLjbIU8dZ/vEBMXjJ6ifP4fzPEQ+dwuw6y8dOAsOhBR3MeTJ17l/fBz1s59RGRlBFAoIIZZ4SSzCueuAYgmsuLs96U4dZ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nvno42R8/+0f3SHu/JH6d+wg95W/5zt/+xVaTr2B/fgn2f+ug+QLBcQvcc64cUMPzzyyi6KK+cijD3Ds6AcpLOu8vZ0hrl2bWlXx3PZHgknC0NkztPVuoKWlBf+XmO3F1lLaoVPqV3YoG4hrU28f8h0ygrcVru+0oe99xLTw3Os/XRZaQAwE93JO/g/IepWmVTpwHAAAAABJRU5ErkJggg==";
          }

          public void setMyImage2(String myImage2) {
          this.myImage2 = myImage2;
          }

          public String getMyImage2() {
          return "iVBORw0KGgoAAAANSUhEUgAAADkAAAA5CAYAAACMGIOFAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAADxtJREFUaN7tmnmMXVd9xz9nufets4/HY89iO3a8LxgCwQkxMVlwAnKTIoIAtZBSVS2lVf+gf1RCQm3VqkhVW9Q/qiJR9Y/2D1QJ/kFFEKBhUxOyYDtOvC/j2T3r2+92zukf93lmPJ6xx4Eix+2RfnPfexrddz/nt5zv+Z0n/vnr/zIE9HDvjkBLIT0gew9DCi2lcNzbw2kpJff60FL8X4CU/w/5toepVoimrpGMjpAtlejM5Gj1fToyPmdPnWT0I79BT2/vrwtS/GqzPAypnn6TQqXCNqVpKZXwJifRQYCLAlqcQM3NUK1W6JUb3lmetOUS8fmzrA8D9l27RkupTDI6RlyaxyYJFoETDqs1Jklo1Ov8ulLll4d0lujE6/TMzbNpbh49NERw9QqVxGC1QigFWgECBDilwBgc7p0BmYyP0XFtnIHRMbIXLtK4fIlGkkA2g9AeYiETXNNYuEop737I5MybDExOsP7CJeI3T1Gu1yGTQfjeUjcvd/sipLjbIU8dZ/vEBMXjJ6ifP4fzPEQ+dwuw6y8dOAsOhBR3MeTJ17l/fBz1s59RGRlBFAoIIZZ4SSzCueuAYgmsuLs96U4dZ9vEOOpHP6Y+OYYsFq/X1hsK0Wohuni1CPFr9KRa4xfZocsMTo4hX3qZ+sQYolBcfGh36zB1zb/CpcAOkFKg7iZPumqFrgtnyJ04RXXoMr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knC0NkztPVuoKWlBf+XmO3F1lLaoVPqV3YoG4hrU28f8h0ygrcVru+0oe99xLTw3Os/XRZaQAwE93JO/g/IepWmVTpwHAAAAABJRU5ErkJggg==";
          }
          }


          And this AMX file:

          <?xml version="1.0" encoding="UTF-8" ?>
          <amx:view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:amx="http://xmlns.oracle.com/adf/mf/amx"
          xmlns:dvtm="http://xmlns.oracle.com/adf/mf/amx/dvt">
          <amx:panelPage id="pp1">
          <amx:facet name="header">
          <amx:outputText id="Image"/>
          </amx:facet>
          <amx:image id="image1" source="#{pageFlowScope.MyBean.myImage}"/>
          <amx:image id="image2" source="data:image/png;base64,#{pageFlowScope.MyBean.myImage2}"/>
          </amx:panelPage>
          </amx:view>


          Note: You'll have to define "MyBean" as a managed bean with pageFlow scope in your taskflow pointing to the Java class above.
          • 2. Re: Show base64 encoded image
            Menno_H
            You're right.... When i copy the base64 encoded string from the database into a backing bean, it works fine. But when i read it directly from the bindings, it doesn't.

            My image is about 2kb, so that shouldn't be an issue i presume...


            I played around a bit and found out that the blob in the database contains:

            R0lGODlhZAAyAHAAACH5BAEAAP8ALAAAAABkADIAh////+YZEOYICO9SUvettffWxdbm79at7+ZahOZazuYQzuYQhK1ahK1azq0Qzq0QhPellNbmEJzmENatEJytENata/fe5u+EexBr3hDvWhBrWlqt3lop3lqtWlopWhCt3hAp3hCtWhApWlrvnFprnFrvGVprGRDvnBBrnBDvGRBrGVqtnFopnFqtGVopGRCtnBApnBCtGRApGVrO3lpK3lrOWlpKWhDO3hBK3hDOWhBKWlqM3loI3lqMWloIWhCM3hAI3hCMWhAIWlrOnFpKnFrOGVpKGRDOnBBKnBDOGRBKGVqMnFoInFqMGVoIGRCMnBAInBCMGRAIGeZKKfet5qXWvaWcveZ7peZ7KeZapeZa7+YQ7+YQpa1apa1a760Q760QpaUpUqUpGeZSCOZ7zuYxzuYxhK17hK17zq0xzq0xhOZ7CKUIUqUIGdbmlNbmQ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FGNS6oUBQu5On10DTfDiNoAFwOBYqqLP31BDCkBkDVT8gOFFnkcsWrHmHop6iWDGYb2trkYDTWLf6vC5UgIkKTPmQCMnwBd1UjoGZELeIofz/xMtKaVr4Usqh9U4x9IMuK3Kehrn2xS4gUIQLyD6ARuAThHQieay8RgpgBagpC1CFoQf7DjAnBTCzpJqhEv0oRVJ1MpRw2CUruUZRjWoilNLWC/kxUMVc3SRzvkaUmlBG5/CMClUKeaElYNYBjx4pPPhnG4qXqVJWtq6uNi1dGvmvWsaE2rWtfK1ra69a1w5UhAAAA7

            But when reading this field from the database using a WebserviceDataControl, the value that's returned is:

            UjBsR09EbGhaQUF5QUhBQUFDSDVCQUVBQVA4QUxBQUFBQUJrQURJQWgvLy8vK1laRU9ZSUNPOVNV dmV0dGZmV3hkYm03OWF0NytaYWhPWmF6dVlRenVZUWhLMWFoSzFhenEwUXpxMFFoUGVsbE5ibUVK em1FTmF0RUp5dEVOYXRhL2ZlNXUrRWV4QnIzaER2V2hCcldscXQzbG9wM2xxdFdsb3BXaEN0M2hB cDNoQ3RXaEFwV2xydm5GcHJuRnJ2R1ZwckdSRHZuQkJybkJEdkdSQnJHVnF0bkZvcG5GcXRHVm9w R1JDdG5CQXBuQkN0R1JBcEdWck8zbHBLM2xyT1dscEtXaERPM2hCSzNoRE9XaEJLV2xxTTNsb0kz bHFNV2xvSVdoQ00zaEFJM2hDTVdoQUlXbHJPbkZwS25Gck9HVnBLR1JET25CQktuQkRPR1JCS0dW cU1uRm9JbkZxTUdWb0lHUkNNbkJBSW5CQ01HUkFJR2VaS0tmZXQ1cVhXdmFXY3ZlWjdwZVo3S2Va YXBlWmE3K1lRNytZUXBhMWFwYTFhNzYwUTc2MFFwYVVwVXFVcEdlWlNDT1o3enVZeHp1WXhoSzE3 aEsxN3pxMHh6cTB4aE9aN0NLVUlVcVVJR2RibWxOYm1RcHptUXB4N1Vwem1sTmF0UXB5dFFweDdH Wnl0bE5ibWE1eFNVcHptYTV4U0daeXRhKz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YzNTUnp2a2FVbWxCRzUvQ01DbFVLZWFFbFlOWUJqeDRwUFBobkc0cVhxVkpXdHE2dU5p MWRHdm12V3NhRTJyV3RmSzFyYTY5YTF3NVVoQUFBQTc=

            How is this possible?

            Maybe because the type in the view-object is BlobDomain, but in the SDO file that was created, the type is javax.activation.DataHandler?

            Edited by: Menno_H on 25-jun-2012 1:57

            Edited by: Menno_H on 25-jun-2012 2:03
            • 3. Re: Show base64 encoded image
              Menno_H
              It's working now.

              I saved a logo as base64 in my database and i think the DataHandler does another base64 encode on my encoded string.

              When i read the base64 string from the bindings en decode it, then i have my original base 64 encoded string.