squirreltown
11 years agoRoku Guru
BuhByteArray
I am trying to send the contents of a bitmap as as byte array to a server to be re-constituted as a jpeg. The php file creates a jpg from known good data and it's also receiving my bad data fine. so the problem seems to be the data format i'm outputting from the roku.
so we start here:
This is the PHP thats making the jpeg.
so we start here:
thispainting= screen.GetByteArray(0, 0, 5, 5)The code the Roku outputs looks like this:
strx=thispainting.ToBase64String()
? strx
SendPaintingPost(strx)
$data ='q6ur/6urq/+rq6v/q6ur/6urq/+rq6v/q6ur/6urq/+rq6v/q6ur/6urq/+rq6v/q6ur/6urq/+rq6v/q6ur/6urq/+rq6v/q6ur/6urq/+rq6v/q6ur/6urq/+rq6v/q6ur/w==';and the good sample code i have looks like this:
$data = 'iVBORw0KGgoAAAANSUhEUgAAABwAAAASCAMAAAB/2U7WAAAABl' //worksSee how one of these things is not like the other?
. 'BMVEUAAAD///+l2Z/dAAAASUlEQVR4XqWQUQoAIAxC2/0vXZDr'
. 'EX4IJTRkb7lobNUStXsB0jIXIAMSsQnWlsV+wULF4Avk9fLq2r'
. '8a5HSE35Q3eO2XP1A1wQkZSgETvDtKdQAAAABJRU5ErkJggg==';
This is the PHP thats making the jpeg.
$data = base64_decode($data);Any ideas would be appreciated. Thanks
$im = imagecreatefromstring($data);