MQTT-Explorer icon indicating copy to clipboard operation
MQTT-Explorer copied to clipboard

Support preview of jpeg and png topics

Open thomasnordquist opened this issue 6 years ago • 7 comments

Could be nice.

Topics can be identified by magic numbers: http://www.ntfs.com/jpeg-signature-format.htm https://en.wikipedia.org/wiki/List_of_file_signatures

JPEG

Magic number: FF D8 FF Trailer: FF D9

PNG

Magic number: 89 50 4E 47 0D 0A 1A 0A

GIF

Magic number: 47 49 46 38 37 61 Magic number: 47 49 46 38 39 61

thomasnordquist avatar Apr 02 '19 17:04 thomasnordquist

While this would be very cool, there are 3 issues with this.

Using Buffers seems not to be a viable option

  • Nodejs uses Buffers, browser ArrayBuffers it is uncertain how the IPC / SocketIO converts them
  • Working with ArrayBuffers in Browsers sucks
  • Reliability for different browsers and encoding issues are in question.

Using Base64 solves most issues but

  • mqttjs in browsers may still use some sort of Buffer, ~it may require different handling~. Seem to be nodejs buffers supporting base64 encoding

thomasnordquist avatar Apr 02 '19 21:04 thomasnordquist

The first step is complete, messages are stored as Base64 and can be Data-URI encoded with methods from Base64Message.

However, buffers are currently truncated to a size of 10k in the MQTT data source.

thomasnordquist avatar Apr 03 '19 16:04 thomasnordquist

Still rooting for this. 🙂

Andoramb avatar Nov 17 '20 12:11 Andoramb

Hi team,

Bringing this back to the top 🤘

My use case would be to be able to peek into Frigate snapshot topics like frigate/cam01/person/snapshot which contains the raw JPEG data of the snapshot in the message.

I hope it gets implemented one day :)

Twanislas avatar Feb 09 '24 09:02 Twanislas

The author (@thomasnordquist ) is absent from this project since very long, just telling you @Twanislas in case you had hope for a reply

ilgrank avatar Feb 09 '24 18:02 ilgrank

Oh...

Thanks for flagging ! Well at least this FR is there, maybe one day xD

Twanislas avatar Feb 09 '24 18:02 Twanislas

it's already done in a parallel universe 😁

Andoramb avatar Feb 11 '24 21:02 Andoramb