SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    Montgomery, TX
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    binary images in HTML

    Can anyone tell me how to use binary image data in the img tag?

    Thanks.

  2. #2
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what exacty do you mean by binary image data ... do you mean hex or octal code? If so you have a problem cause its not going to work...

    remember you have to rely on the browser to be able to interpret the data and render it properly .... to my knowledge there are none that will do that.

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    Montgomery, TX
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what i need is to embed the image so that the image file doesn't have to be included.

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use the data: scheme, but it's not exactly well supported.
    HTML Code:
    <img alt="..." src="data:XXYYXX">
    IIRC, the data should be encoded in base64 or something, but don't quote me on that.
    Birnam wood is come to Dunsinane

  5. #5
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    Montgomery, TX
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks AC, I'll give that a try. I appreciate the help.

  6. #6
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Id be really curious to see the browser support on that! An interesting concept

  7. #7
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It seems I got the syntax slightly wrong, according to this man page.

    It's specified in RFC 2397. It seems to be supported by Opera 7.20 and up (max 4,100 bytes), but I couldn't quite figure out from mozilla.org whether or not Mozilla and Firefox support it. Needless to say, IE does not support it, and neither does Safari.

    Hixie even has a form that helps you create the data: string.
    Birnam wood is come to Dunsinane

  8. #8
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mozilla (and Firefox) supports it. Type this into the location bar:
    Code:
    data:,PASS
    (The MIME type defaults to text/plain, and the charset to US-ASCII.)
    Simon Pieters

  9. #9
    SitePoint Wizard silver trophy
    beley's Avatar
    Join Date
    May 2001
    Location
    LaGrange, Georgia
    Posts
    6,117
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    one question, why?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •