Back to Top

Fetch Image Format From base64 Source Using Python

Updated 14 January 2017

This article demonstrate how to fetch image format like (jpeg, jpg, png, gif etc.) from base 64 source using python.

To determine image format from base64 source following code will be helpful.

try:
 import cStringIO as StringIO
except ImportError:
 import StringIO
from PIL import Image 

image_stream = StringIO.StringIO(base64_source.decode('base64'))
image = Image.open(image_stream)
filetype = image.format

Start your headless eCommerce
now.
Find out More
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Back to Top

Message Sent!

If you have more details or questions, you can reply to the received confirmation email.

Back to Home