data-uri

How to create a base64 file from nothing?

戏子无情 提交于 2019-12-12 02:38:48
问题 I want to be able to create base64 files (images, sounds, video) without any previous models. For example, if I want to create a base64 64px*64px red image, how can I do this without creating first a canvas? I would also like to create a sound (note) with no model. I've searched on Google for some documentation on base64 encoding but I did not seem to find specific things for my need. I am going to use Javascript, but I guess this should be the same for every language. 回答1: Try function

How to download CSV using a href with a # (number sign) in Chrome?

心已入冬 提交于 2019-12-11 18:44:23
问题 Chrome 72+ is now truncating our data at the first sign of a # character. https://bugs.chromium.org/p/chromium/issues/detail?id=123004#c107 We have been using a temp anchor tag along with the download attribute and href attribute with a csv string to download a csv of data on the page to the user's machines. This is now broken in a recent Chrome update because all data after the first # sign is stripped from the downloaded csv. We can work around it by replacing the # with " num " or other

Saving an image from a canvas using toDataUrl() - tainted canvas error workaround? [duplicate]

梦想与她 提交于 2019-12-11 16:59:27
问题 This question already has answers here : What do I set CORS settings to and where so that my canvas doesn't get tainted? (1 answer) Canvas image crossplatform insecure error (1 answer) Closed 2 years ago . I'm currently building a feature where a user can upload a video, then select a thumbnail. It's based off this fiddle: http://jsfiddle.net/e98tffu6/556/ The code to save the canvas data - starting with toDataUrl() - works under normal circumstances. Already tested it. I can get image data

Convert dataUrl to blob and submit through ajax

这一生的挚爱 提交于 2019-12-11 13:38:34
问题 I'm using the imgly image cropper plugin, slightly modified for my app. It currently converts an image to a dataUrl and spits out the image as a base64 image that I can save as a jpeg. I'm working on adapting the dataURItoBlob function found here, to my app, so I can get the image posted to an API endpoint. I have the following so far, but I'm not sure how to append the final image to the xhr.open('POST', '/', true); renderButton.click(function (event) { var dataUrl = imgly.renderToDataURL(

Image from bytearray not complete in IE8

给你一囗甜甜゛ 提交于 2019-12-11 12:26:48
问题 Java6, Struts2.2.3.1 - I'm converting a byte array to an image(jpg). Please see the link below, if you open this in IE the image is not complete, whereas it opens fine in Firefox or Chrome http://jsbin.com/aheliy/2 Java I encode the bytearray and convert to String using MiGBase64 - where this.bean.imageByteArrayString refers to the form bean this.bean.setImageByteArrayString(new Base64().encodeToString(imageInByteArr, false)); JSP <img src="data:image/jpg;base64,<c:out value='${bean

Are angle brackets valid in data URIs?

我们两清 提交于 2019-12-11 08:37:57
问题 I've been reading about Data URIs which has the following example of a valid data URI: data:text/html,<script>alert('hi');</script> However reading through RFC 2397 I have found the following: dataurl := "data:" [ mediatype ] [ ";base64" ] "," data mediatype := [ type "/" subtype ] *( ";" parameter ) data := *urlchar parameter := attribute "=" value where "urlchar" is imported from RFC2396 From what I understood is that urlchar should be what is in Section 2.4.3 of RFC2396, where it notes the

Unable to display BLOB image with Data URI

非 Y 不嫁゛ 提交于 2019-12-11 00:54:44
问题 I have a jpg image stored in MySql Database table in the column with the data type as BLOB that part of the php code works fine. I am trying to display that image using the below php code but it would not work. I see a small icon on the screen which is definitely not the image ? what's wrong any help? 1) Read the image php file <?php header("Content-Type: image/jpg"); $db=mysqli_connect("localhost","root","root123","deal_bank","3306"); if (mysqli_connect_errno()) { echo "Failed to connect to

How to Generate a Data URI

馋奶兔 提交于 2019-12-10 21:33:55
问题 I recently came across Data URI scheme and was reading about it on Wikipedia. Example code looks something like this: <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO 9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot"> My question is this: How do you generate the code (IE: iVBORw0KGgoAAAA... ) for using on a website? Note: I am specifically looking for how this is done with no server side scripts. But you can still post server

Why do markers, patterns, and unicode characters display incorrectly in a svg data uri in google chrome?

♀尐吖头ヾ 提交于 2019-12-10 10:53:52
问题 I am using google chrome version 24.0.1312.57 on Mac OS X 10.6.8. In Safari 5.1.7 the svg image looks like this: In Chrome it looks like this: Notice the markers are gone from the paths and the path that has a pattern now has a fill of black and the unicode character has an A behind it. This only happens if the image is a data uri in the address bar in google chrome. If I open the svg image up as a file in chrome it displays correctly. I've tried taking the line endings away and putting it in

SVG as data URI not rendering

佐手、 提交于 2019-12-09 21:18:31
问题 It's probably just a syntax error but I can't find any thorough references on this kind of usage. Chrome is overstriking my background property, so I've obviously offended something. http://jsfiddle.net/YbA39/2/ I want what's in the red box (an svg css background) to render just like the inline svg in the html. Simple, right? Don't say it can't be done! My inspiration is this: http://jsfiddle.net/estelle/SJjJb/ 回答1: You haven't escaped the '#' characters in the url() syntax. And it's 'viewBox