Questions tagged [data-uri]

A data URI is a URL whose scheme part is 'data:' and which directly represents a resource, rather than the location of a resource.

The following is an example of a data URI:

data:text/html;base64,PCFkb2N0eXBlIGh0bWw+CjxodG1sPgogIDxoZWFkPg
ogICAgPG1ldGEgY2hhcnNldD11dGYtOD4KICAgIDx0aXRsZT5UaGVyZSBpcyBuby
BzcG9vbi48L3RpdGxlPgogICAgPHN0eWxlPgogICAgICBodG1sIHsgYmFja2dyb3
VuZDogI2ZhNTsgaGVpZ2h0OiAxMDAlIH0KICAgICAgcCB7IGNvbG9yOiAjNWFmOy
B0ZXh0LWFsaWduOiBjZW50ZXI7IG1hcmdpbjogNmVtOyBmb250LXNpemU6IDJlbS
B9CiAgICA8L3N0eWxlPgogIDwvaGVhZD4KICA8Ym9keT4KICAgIDxwPjxhIGhyZW
Y9aHR0cDovL3N0YWNrb3ZlcmZsb3cuY29tL3RhZ3MvZGF0YS11cmkvaW5mbz5CYW
NrPC9hPjwvcD4KICA8L2JvZHk+CjwvaHRtbD4K

That data URI contains a HTML document. If pasted into the address bar of a compliant browser, the document it contains will be displayed without the need to request any external resources.

Data URIs can be used in the href or src attributes of <a> and <img> elements, etc., eliminating the need for additional HTTP requests.

592 questions
0
votes
1 answer

How to scrape "data:image" URIs; Encountering Errno::ENAMETOOLONG?

I having been trying to write a script that scrapes a page for images the way it has been outlined in "Save all image files from a website". I tested that method with another page and it worked fine, but when inserting my link to scrape data:image…
jmarcs
  • 115
  • 1
  • 7
0
votes
1 answer

Browser perform a request insted of show data uri

My Apache registered a data URI in access log. /data:image/png%3bbase64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAMAAACeL25MAAAABlBMVEUzlME6qNuT3ZmEAAAAE0lEQVQI12NgZGRkYABiMAQzGQEAjAANk73rMwAAAABJRU5ErkJggg== Apparently some browser did not understand the…
0
votes
1 answer

HTML Data URIs Browser Compatibility

I was wondering what the browser support is for Data URIs? More specifically what version of IE does this begin to be supported in? Also is there a difference between using them in a stylesheet as a BG image or in an img tag? Cheers!
Travis
  • 2,185
  • 7
  • 27
  • 42
0
votes
2 answers

How can I get some text from data uri and assign to an array?

my data this1 this2 this3 this4 what I want $keepit[0]='this1'; $keepit[1]='this2'; $keepit[2]='this3'; $keepit[3]='this4'; data uri data:text/plain;charset=utf-8;base64,dGhpczENCnRoaXMyDQp0aGlzMw0KdGhpczQ= Is it possible to do this?
Ds Klur
  • 103
  • 1
  • 8
0
votes
1 answer

How can I fix particular Data-URI's that seem to break in "Android browser"

I am talking to a REST interface that sends me renders in base64, I then use these to display on a webpage accessible to an android device. The problem is, now and then I find particular renders/images seem to work on all desktop browsers, and work…
Josh Mc
  • 9,911
  • 8
  • 53
  • 66
0
votes
1 answer

Copy pasting HTML To MS-Word?

I need to allow pasting HTML from our secure web app to MS Word (2007 and above) - it works fine but MS Word doesn't support Data URI like images . Data URL's work, but because of network/security issues I cant use it . I could use MHTML for…
Nishant
  • 20,354
  • 18
  • 69
  • 101
0
votes
1 answer

Reverse engineer font file from data URI?

I have a data URI file for a font, and I'd like to reverse engineer the font file (any format). Is this possible?
flossfan
  • 10,554
  • 16
  • 42
  • 53
0
votes
1 answer

Creating a Data URI's from SCSS

I am trying to get a SVG to process into a DATA URI, It would make my code a lot easier to maintain, rather than reams of code. $white:rgb(255,255,255); background:$white inline_image("/images/select-arrows.svg") no-repeat 92% center; This is what…
Neil
  • 971
  • 2
  • 12
  • 33
0
votes
1 answer

Generate an image data-uri programmatically in javascript

I am working on a mapping project using Google Maps. We have a variety of different types of data that we are displaying with different geographical boundaries. Some of the data comes from the client and is very restricted in terms of privacy and…
cheepychappy
  • 468
  • 3
  • 12
0
votes
1 answer
0
votes
1 answer

Alternative to data URI or sprites?

I have a bit of a catch 22 situation here. My intention is to save on HTTP requests, which naturally slow the page loading down as the number of requests increases. My first solution was to go for sprites. However, I can't scale a sprite with…
Hiigaran
  • 829
  • 10
  • 28
0
votes
1 answer

PHP - Resize and compress image from Data URI

I'm working on a PHP project, and I record Images DATA URI in a table called "Images", the thing is that that long string takes lot of place for nothing so its heavy to load. My questions : How can I resize a Data URI image using PHP (knowing that…
Youssef
  • 401
  • 1
  • 5
  • 23
0
votes
1 answer

Synchronously Create Image Object from DataURI using JavaScript

does anyone know if it's possible to synchronously create an image object from a data uri using JavaScript? It is possible to create an image object from a data URI asynchronously like this: imageObj = new Image(); …
Eric Rowell
  • 5,191
  • 23
  • 22
0
votes
1 answer

Loading image with data uri as source doesnt work in safari

Loading image with data uri as source doesnt work in safari. I am using the following source value see: http://jsfiddle.net/VnnhS/ everything is working with chrome IE and FF. could it be size limitation?
Ori Price
  • 3,593
  • 2
  • 22
  • 37
0
votes
1 answer

How to generate data URI in Symfony 2.3

Is there a bundle, or a friendly way to generate or convert a file to its data URI representation in Symfony 2.3 or above and include it in a JSON response? How can I do that?
Guillermo Gutiérrez
  • 17,273
  • 17
  • 89
  • 116