elephant.io icon indicating copy to clipboard operation
elephant.io copied to clipboard

Emitting a HD image in base64 format

Open hugo-caires opened this issue 11 years ago • 2 comments

I'm trying to emit a base64 string of an HD (1920x1080) png image. It just gives me a blank page with nothing being emitted. I tried with smaller images, and even multiple smaller images and it goes well. Any idea why that happens?

hugo-caires avatar Dec 04 '14 00:12 hugo-caires

Hi @hugo-caires . The elephant.io has been to communicate data between socket.io and this via Websocket Protocol of HTML5.

The length of short data to WebSocket Protocol is expressed 2bytes. and length of long data(0xFFFF more size) to Websocket protocol is expressed 8bytes.

But, The pack() function of php about 64bit data isn't supported below version of 5.6.3. so I think that this issue seems to be bug of elephant.io.

I think that i related to line 56 of https://github.com/Wisembly/elephant.io/blob/master/src/Payload/Encoder.php to this issue.

kbu1564 avatar Dec 04 '14 09:12 kbu1564

It seems we are indeed not making the difference between 32bits and 64bits data when encoding them into the Encoder. As @kbu1564 mentionned it, only php 5.6.3 supports 64bits data in the pack function, otherwise we may need to do a dirty fix just like we did in the the Decoder... Which is actually not perfect (let's even say not working in fact ?).

But I'm not sure this use case is really adapter to websockets though...

Taluu avatar Dec 04 '14 14:12 Taluu