data-uri

Rapidly updating image with Data URI causes caching, memory leak

↘锁芯ラ 提交于 2019-11-28 17:04:14
I have a webpage that rapidly streams JSON from the server and displays bits of it, about 10 times/second. One part is a base64-encoded PNG image. I've found a few different ways to display the image, but all of them cause unbounded memory usage. It rises from 50mb to 2gb within minutes. Happens with Chrome, Safari, and Firefox. Haven't tried IE. I discovered the memory usage first by looking at Activity Monitor.app -- the Google Chrome Renderer process continuously eats memory. Then, I looked at Chrome's Resource inspector ( View > Developer > Developer Tools , Resources ), and I saw that it

Animated icon in email subject

我们两清 提交于 2019-11-28 13:26:51
问题 I know about Data URI s in which base64 encoded data can be used inline such as images. Today I received an email actually an spam one in which there was an animated (gif) icon in its subject: Here is the icon alone: So the only thing did cross my mind was all about Data URIs and if Gmail allows some sort of emoticons to be inserted in subject. I saw the full detailed version of email and pointed to subject line at the below picture: So GIF comes from =?UTF-8?B?876Urg==?= encoded string which

Merge two dataURIs to create a single image

岁酱吖の 提交于 2019-11-28 12:28:14
I want to generate images consisting of a label and an icon. The label part is going to vary a lot (50-100) while there are about 10 icons. I would like to make the final images in a modular way by splitting the final image in two parts, a label image and an icon image. I will build a service that returns dataURI for the labels while the icon dataURIs will be embedded in the page. Then I would like to combine these two different dataURIs to create a single dataURI representing a combined image. How can I do this on the client side? You can create images using your data uris and then draw a new

Image file size from data URI in JavaScript

痞子三分冷 提交于 2019-11-28 09:23:08
问题 I am not sure it's even possible but - can I get the image file size from data URI? For example, let's say there is an IMG element where src goes: src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD... Based on the src , can I get the image file size by using plain JavaScript? (without server request) 回答1: If you want file size, simply decode your base64 string and check the length. var src ="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP/// yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"; var base64str =

How to create an ArrayBuffer and data URI from Blob and File objects without FileReader?

◇◆丶佛笑我妖孽 提交于 2019-11-28 01:51:18
This Question is related to and inspired by How to updoad in old browsers (ex Safari 5.1.4) Given an <input type="file"> element having a files property containing File objects which inherit from Blob , is it possible to create a ArrayBuffer and convert the ArrayBuffer to a data URI from a Blob or File object without using FileReader ? Approaches have tried so far have been create a mock WebSocket with .binaryType set to "arraybuffer" , create a MessageEvent with event.data set to File object; result is File object at onmessage handler set prototype of File to ArrayBuffer , Uint8Array ; result

Can you send images in data:uri format to GMail?

五迷三道 提交于 2019-11-27 14:34:30
问题 I'm making a web app in Django that sends user an image to their email. The way that seems most attractive to me for sending the image is in the data:uri format. However, I tested sending this email with a data:uri image in it to my GMail account, and the email shows, but without the image! I know that Chrome and Firefox can both open data:uri images. So it's not a browser problem. But I don't see the data:uri image in GMail at all. Does GMail not support data:uri images? Or possibly I'm

Rapidly updating image with Data URI causes caching, memory leak

China☆狼群 提交于 2019-11-27 10:10:04
问题 I have a webpage that rapidly streams JSON from the server and displays bits of it, about 10 times/second. One part is a base64-encoded PNG image. I've found a few different ways to display the image, but all of them cause unbounded memory usage. It rises from 50mb to 2gb within minutes. Happens with Chrome, Safari, and Firefox. Haven't tried IE. I discovered the memory usage first by looking at Activity Monitor.app -- the Google Chrome Renderer process continuously eats memory. Then, I

“Aw, Snap” when data uri is too large

为君一笑 提交于 2019-11-27 07:45:55
I'm writing a chrome extension which does the following: Downloads a file from a website to memory using XMLHttpRequest Adds additional data to the file and then base64 encodes the result to the variable total_encoded_data Offers the data to the user using <a href=data:application/octet-stream;charset=utf-8;base64,' + total_encoded_data+' download='file.bin'>Click to Download</a> . Where total_encoded_data is added to href using jQuery. I have found, through a manual binary search, that if the size of total_encoded_data is greater than 2097100 characters, then I will get an Aw, Snap message

How can I make a link in IE using base64 encoding method?

主宰稳场 提交于 2019-11-27 07:13:26
问题 I am generating a base64 gif on the fly and am trying to make a link to a new page to open a full size version of the gif. This works in chrome, but in IE, only the img thumbnail shows. When someone clicks on the link in IE, a blank page opens. Any thoughts? Thanks Matt echo '<a href="data:image/gif;base64,'. $data. '" target=_blank>'; echo '<img src="data:image/gif;base64,'. $data . '" width="200"/></a>'; 回答1: According to this you cannot use data uri for navigation in IE. Internet Explorer

Cross-browser Save As .txt

别来无恙 提交于 2019-11-27 05:21:21
Is there a JavaScript library that allows to save strings as txt files, and works cross-browser? In the past, I have been using Downloadify, but I am looking at another option for a couple reasons: I hope to find a pure JavaScript solution, without the need for Flash it seems that Downloadify is not updated anymore (no update in the past 18 months) I am experiencing an issue with Downloadify in IE 9, where strings are cut off As far as I know, the only way is to use data: URLs to force a download: var data = "This is a test"; window.location.href = "data:application/x-download;charset=utf-8,"