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: 
ajitg_4557
Channel Surfer

how to show base64 encoded image in poster node.

I am facing problem to show base64 image to poster node.
please guys help us on this issue.


sub load_Map(json As Object)

json=parseJSON(json)
remove_n=json.MapFlightResult
print"remove Before========>>>>"remove_n

r = CreateObject("roRegex","\n", "i")
remove_new=r.ReplaceAll(remove_n,"")
print"remove After========>>>>"remove_new


ba=CreateObject("roByteArray")
ba.FromBase64String(remove_new)
img=ba.ToAsciiString()
print"img=======>>>>>"img
m.Map.uri=img
m.Map.visible=true

end sub

thanks in advance to All Roku Team.
0 Kudos
4 REPLIES 4
Tyler_Smith
Binge Watcher

Re: how to show base64 encoded image in poster node.

You're looking for something like this:

uri = "tmp:/images/" + someidentifier
ba = CreateObject("roByteArray")
ba.fromBase64String(yourbase64string)
ba.writeFile(uri)

poster.uri = uri
Tyler Smith
0 Kudos
norcaljohnny
Roku Guru

Re: how to show base64 encoded image in poster node.

What I do for the sake of speed is write an external php script to handle the code as Roku gets bogged down real quick.
0 Kudos
ajitg_4557
Channel Surfer

still not able to decode base 64 encoded strinig as a poster

Hi,Smith
i still hang on this issue,can you please elaborate more on this.
0 Kudos
ajitg_4557
Channel Surfer

let me show the telnet response,to all you guys.

"ajitg_4557" wrote:
nO3Y32vVdRzH8VMU6CiqO/+EuggCV1CC+asg2JUQRoFFoAv0aGVL15iRM6i70EQhEGqbQtBNQyKSoMi0
cmO1jf07fdR5Ou7rOUfOGs+vL57wuPjyfX/PeJ5z3nx3zmk0Nu+X/n98gSLxBYrEFygSX6BIfIEi8QWK
xBcoEl+gSHyBIvEFisQXKBJfoEh8gSLxBYrEFygSX6BIfIEi8QWKxBcoEl+gSHyBIvEFisQXKBJfoEh8
gSLxBYrEFygSX6BIfIEi8QWKxBcoEl+gSHyBIvEFisQXKBJfoEh8gSLxBYrEFygSX6BIfIEi8QWKxBco
El+g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yrpp46Dcq95PGtzfLGl4M+rqmOqmce2LyveGbP8UuXf1v18HJbGj91
8frc/BvHzpw8++1fs/NvjZ1tjfhXTT11GiwsLJZ7Q1EO+rimOrrrxUtLS3//s7DlzZOrHr68vLxr/2dP
vzpe1ujWwe9/zLZG/KumnjoNyhv52NZmucd0uWN1uaY6uuvFDz83XP4Vlo9Zqx5etufBwRu3tPaD1oh/
1dRTp8G5C5d2v/dFUQ76uKY6qp55e/xcWazn905U97K6Ri7WfabToHx3++mXq0X3b4Wrrml9AKqOqmfe
+eSr2bn5cqb8s1v1l12s+x5foEh8gSLxBUr0L7kzp6/i763xAAAAAElFTkSuQmCC
decoded string into image========>>>>>>?PNG
?

sub load_Map(json As Object) 
json=parseJSON(json)
remove_n=json.MapFlightResult

r = CreateObject("roRegex","\n", "i")
remove_new=r.ReplaceAll(remove_n,"")
print"remove After========>>>>"remove_new

ba1=CreateObject("roByteArray")
ba1.FromBase64String(remove_new)
img=ba1.ToAsciiString()
print"decoded string into image========>>>>>>"img
end sub


so guys please let me know if i am doing any mistake..
NOTE:-i have already seen this post on forum,but i did not get any way, how to resolve this issue.
thanks in advance.
0 Kudos