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

data uri slowing down page loading

i am using data uri for avatar image on profile page of the site.(i am using asp.net) Profile site is opening quickly but when i click link on profile page, chrome shows uploading message on left bottom corner and it is uploading very slow. i cannot…
verdery
  • 489
  • 1
  • 6
  • 20
0
votes
1 answer

Can Data URL value be passed and stored in Local storage for later use?

I am developing an application that requires editing an image by converting it into a canvas an the save the changes as an Image. So my doubt is that, can this Data URL be passed along the application and save to local storage of the browser to be…
Hemantsom
  • 543
  • 2
  • 9
  • 24
0
votes
1 answer

canvas.toDataURL() generate wrong DataURL

What's the problem with toDataURL() function in my code!? My problem is, the p0 canvas will remain empty! After uploading my image in dataurl.net, i found out, it DataUrl code and my DataUrl code that was saved in LocalStorage are different!! and…
MeTe-30
  • 2,512
  • 2
  • 21
  • 30
0
votes
1 answer

three.js how can speed up renderer.domelement.todataurl?

I use three.js renderer.domelement.todataurl to get the image of current view. It works fine. The problem is my project need capture the image in high frequent, every 0.1 second. under this frequent , browse almost freeze, user can not do anything.…
max
  • 146
  • 1
  • 8
0
votes
1 answer

Whats the right way to encode an umlaut in a dataURI

I have a small script that let the user save a CSV file using dataURI. Unfortunately there are some problems with german umlauts, so Käufe will become Käufe. The href with the dataURI is created like this: 'data:application/csv;charset=utf-8,' +…
Andreas Köberle
  • 106,652
  • 57
  • 273
  • 297
0
votes
1 answer

Build and Rebuild CSS data uris with php

This whole data URI nonsense is going to be grow old really quick, but until then, I'm gonna jump on the bandwagaon for at least one lap. So I have CSS files that I want to update to use data URIs instead of remote location. I was thinking I could…
Anthony
  • 36,459
  • 25
  • 97
  • 163
0
votes
2 answers

javascript image upload via datauri and php base64 decode

I am trying to make an image upload where the JavaScript posts DataURI of an image via AJAX and the PHP receives it to decode it into an image. The problem is, everything is working fine except that the end product is not an image file. Please have…
Henry Cho
  • 770
  • 2
  • 15
  • 33
0
votes
2 answers

Is there a way to use the same base64 data URI with two @font-face declarations?

I have a CSS file with @font-face declarations. The corresponding fonts are stored as base64-encoded WOFFs within the declarations. For reasons that you'll have to trust are good ones, I'd like to create multiple @font-face declarations that point…
Matthew Butterick
  • 1,064
  • 3
  • 12
  • 22
0
votes
1 answer

What's a way for sleeping without spinning in javascript running from a data URI?

I need a way to sleep in javascript. Yes, I know about setTimeout and so on, but those won't do for me. I need a real sleep. One that freezes the tab or the browser. But preferably without spinning the CPU. Yes, I really, really need that. I'm sure,…
thejh
  • 44,854
  • 16
  • 96
  • 107
0
votes
1 answer

Determine Image URL From Data URI

Is it possible to find the absolute url of an image embedded in a page with a data URI tag? Inspecting the html element in Chrome renders the image (pictured below), but 'Opening the image in a new Tab' renders the following html:
cooncesean
  • 1,294
  • 2
  • 18
  • 26
0
votes
0 answers

Can I use data uri's in Chrome for iOS?

I have a web application that uses data uri's to display images. The images display in Google Chrome version 27.0.1453.116 m on a laptop. However, the images do not display on Google Chrome for iOS on an iPad. Are data uri's supported in Google…
user42
  • 347
  • 1
  • 3
  • 6
0
votes
1 answer

How to convert html into data image uri

Well my question seems weird but here what i want to achieve . Similar to the below link http://www.wovenlabelsuk.com/craft-hobby-labels/wl-02.html I want a text to embed with image and i get data image url back using ajax. I know how to create…
0
votes
2 answers

Background Cover for image stored in mysql

I have an image stored in a database that I'm trying to stretch to width and height of div, I can get the width to 100% but can't get the height to do the same. I'd like to use background cover but that wont work as I'm not getting my image via…
Mark Berry
  • 91
  • 9
0
votes
1 answer

Turn a human readable string into an image to be displayed with data-uris

Is there any conventional way to turn an arbitrary string into an image? In my use case, lets say I want to have an image for each user that maps directly to that user's name. The concept is similar to QR codes, except the output image is not…
Hayk Saakian
  • 2,036
  • 2
  • 18
  • 31
0
votes
1 answer

How to save file from textarea in Javascript with a name?

Possible Duplicate: Using HTML5/Javascript to generate and save a file I want a client side HTML/JS solution to solve this problem - I have a user-edittable textarea A, a textfield B and a button C. When user clicks on C, she gets a file download…
pathikrit
  • 32,469
  • 37
  • 142
  • 221