How to get base64 encoded data from html image

You can try following sample http://jsfiddle.net/xKJB8/3/ <img id=”preview” src=”http://www.gravatar.com/avatar/0e39d18b89822d1d9871e0d1bc839d06?s=128&d=identicon&r=PG”> <canvas id=”myCanvas” /> var c = document.getElementById(“myCanvas”); var ctx = c.getContext(“2d”); var img = document.getElementById(“preview”); ctx.drawImage(img, 10, 10); alert(c.toDataURL());

base64 doesnt have -w option in Mac

Yes, the default macOS base64 implementation doesn’t have the -w flag. What does that flag do? -w, –wrap=COLS Wrap encoded lines after COLS character (default 76). Use 0 to disable line wrapping. And here’s the macOS man page for base64: -b count –break=count Insert line breaks every count characters. Default is 0, which generates an … Read more

java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64.encodeBase64String() in Java EE application

That method was introduced in Commons Codec 1.4. This exception indicates that you’ve an older version of Commons Codec somewhere else in the webapp’s runtime classpath which got precedence in classloading. Check all paths covered by the webapp’s runtime classpath. This includes among others the Webapp/WEB-INF/lib, YourAppServer/lib, JRE/lib and JRE/lib/ext. Finally remove or upgrade the … Read more

Pdf file size too big created using jspdf

You need to compress the images in the PDF’s that you are generating. Try using Deflate.js and adler32cs.js and use the compress parameter in both jsPDF and addImage functions that you are using. For eg : var doc = new jsPDF(‘p’, ‘pt’,’a4′,true); make sure you set the last parameter as ‘true’ refer to : https://github.com/MrRio/jsPDF/blob/ddbfc0f0250ca908f8061a72fa057116b7613e78/jspdf.js#L146 … Read more

How to encode and decode Base64 and Base64Url in Flutter / Dart

The dart:convert library contains an encoder and decoder for Base64 and Base64Url. However, they encode and decode Lists of integers, so for strings you also need to encode and decode in UTF-8. Rather than doing these two encodings separately, you can combine them with fuse. You need to have the following import: import ‘dart:convert’; Base64 … Read more

What is the size limit of a Base64 DataURL image?

Citing MDN on this: Length limitations Although Mozilla supports data URIs of essentially unlimited length, browsers are not required to support any particular maximum length of data. For example, the Opera 11 browser limits data URIs to around 65000 characters. And caniuse.com, where you can also look up the support across browsers: Support in Internet … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)