Python Forum
Binary data to Image convert
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Binary data to Image convert
#1
In my case I stored binary data inside user collection as user_pic using mongoengine. It looks like this
"user_pic": {
        "$binary": {
            "base64": "/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDABQODxI........
...........AooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAP/2Q==",
            "subType": "00"
        }
    }
[When I convert this binary code to image using some online converters, It gives expected image]. So now I want to convert this binary code to image and show that images to users through user interface. Is there any way to do this?
Reply
#2
This is Base64 encoding, often used in email and Usenet from the old days.

https://www.base64decoder.io/python/

Should be of help here...
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Convert file of hex strings to binary file medatib531 4 429 Oct-09-2020, 05:42 PM
Last Post: DeaD_EyE
  python3 convert hex to binary 32 bit Mkt 3 566 Aug-28-2020, 02:34 PM
Last Post: Mkt
  Convert xml to dict and group data and sum totals kashcode 5 432 Aug-16-2020, 01:04 AM
Last Post: scidam
  How to convert a python code to binary? rsurathu 0 268 Aug-02-2020, 08:09 AM
Last Post: rsurathu
  Convert numpy array to image without loading it into RAM. DreamingInsanity 5 581 Jun-06-2020, 01:34 PM
Last Post: DreamingInsanity
  hex file to binary or pcap to binary baran01 1 1,385 Dec-11-2019, 10:19 PM
Last Post: Larz60+
  How to Read Binary Data pyth0nus3r 1 752 Jun-09-2019, 08:58 PM
Last Post: DeaD_EyE
  Parse Binary Data File and convert Epoch Time drdevereaux 1 947 May-16-2019, 01:56 AM
Last Post: Larz60+
  Pack binary data to list of integers bearer 0 750 Mar-29-2019, 12:17 PM
Last Post: bearer
  Convert row data to columns based on keyword mjack24 1 674 Feb-18-2019, 06:39 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020