Create an Image from base64 encrypted image digest data

Suppose you have a base64 digest data of an image, how are you going to display it in your website?

For example You an encrypted image data like this : PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9JRVRGLy9EVEQgSFR…

Here is an example in haml, how to display the image from this data ( you can make corresponding HTML from this if you are using a Html file)

%img{:alt => "File Icon", :src => "data:image/gif;base64,PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9JRVRGLy9EVEQgSFR...", :style => "float: left;margin-top:200px;", :id => "my_image_id", :class =>"blahblahblah"}


Author: Abhilash

Hey! My name is Abhilash - A Ruby developer for years, specialised on web programming, working as a freelancer. Mainly working on Ruby On Rails platform since 2010. This blog is about Ruby, Ruby On Rails and other subjects that I work. You can contact me here: Abhilash AK

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s