Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3612100
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:57:27+00:00 2026-05-18T21:57:27+00:00

Recently i learned that i can display images in a web page without referencing

  • 0

Recently i learned that i can display images in a web page without referencing an image URL as follows :

<img class="disclosure" img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9oIGRQbOY8MjgMAAABVSURBVBjTfc6xDcAwCETRM0rt5nbA+49j70DDAqSLsGXyJQqkVxxwNOeMiEA+waW1VuT/inrvG7wikht8UETy2ygVMjO4O8YYTf6AqrZyUwYlygAAXo+QLmeF4c4uAAAAAElFTkSuQmCC">

I had another small bmp image that i wanted to display, so i opened it in vim and the img source looke like:

alt text

When i paste this code where it needs to be pasted i only get “BMڀ”

  • How to i convert/paste this code properly to be used as an image source?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T21:57:28+00:00Added an answer on May 18, 2026 at 9:57 pm

    You need to encode it in Base64

    http://www.motobit.com/util/base64-decoder-encoder.asp

    Also you have to change (png) in…

    <img src="data:image/png;base64,
    

    according to image filetype.

    Here is a little PHP function, haven’t tested it.

    function encode64($file){
        $extension = explode(".", $file);
        $extension = end($extension);
    
        $binary = fread(fopen($file, "r"), filesize($file));
    
        return '<img src="data:image/'.$extension.';base64,'.base64_encode($binary).'"/>';
    }
    
    echo encode64("test.bmp");
    

    2.

        function encode64($file){
            $binary = fread(fopen($file, "r"), filesize($file));
            return(base64_encode($binary));
        }
    
    echo '<img src="data:image/bmp;base64,'.encode64("test.bmp").'"/>';
    

    Tested my second function… works great… http://debconf11.com/so.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently learned that I can get hg log to print the history in
Even though I am a long time C programmer, I only recently learned that
I recently learned that sometimes people will lock specific processes or threads to specific
I've recently learned that python doesn't have the switch/case statement. I've been reading about
Today Recently on Stackoverflow i learned that: reintroduce is used to hide ancestor constructors
I have recently learned, that in MATLAB, the ! mark runs the code in
Recently i've switched to PHP 5.3+ and after that migration i learned that the
I recently learned that Unicode is permitted within Java source code not only as
I recently learned about the , operator and the fact that it introduces a
Possible Duplicate: Using A* to solve Travelling Salesman Problem I have recently learned that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.