Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
tim_beynart
Channel Surfer

Re: issue with base64 encoded image

I found my old SDK1 code for this. You can use `filename`  as a URI with a poster and you should see the image.
filename = "tmp:/test_file.jpg"
b64 = <b64 String for a JPEG>
ba = CreateObject("roByteArray")
ba.FromBase64String(b64)
ba.AppendFile(filename) 

canvasItems.push({url:filename,TargetRect:{x:10,y:10,w:107,h:60}})
m.canvas.SetLayer(1, canvasItems)
m.canvas.Show()
   
0 Kudos
ajitg_4557
Channel Surfer

Re: issue with base64 encoded image

Thanks, tim_beynart to recall your code.
thanks a lot again.
0 Kudos

Re: issue with base64 encoded image

I have find this similar solution in Python language.

Base64 encoding enables us to convert bytes containing binary or text data to ASCII characters. By encoding the data, we improve the chances of it being processed correctly by various systems. Some systems don’t understand the data in bytes format, so we have to convert the data.

To convert the Image to Base64 String in Python we have to use the Python base64 module that provides b64encode() method. 

The purpose of the base64.b64encode() method in Python is to convert the binary data into ASCII-safe “text”. But Python strongly disagrees with that. Python is now very strict about this that bytes.encode() method doesn’t even exist, and so ‘xyz’.encode(‘base64’) would raise an AttributeError.

0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.