coremob / camera Goto Github PK
View Code? Open in Web Editor NEWAn open-source camera application built using Web technology.
An open-source camera application built using Web technology.
Depending on whether toBlob is supported, getBlobFromCanvas will either use an asynchronous path (with toBlob) or a synchronous one (with toDataUrl).
The only way getBlobFromCanvas appears to work today is because it is used before windows.prompt which, asking info from a user, is slow enough to (most of the time) ensure that the async path has had time to finish. But that's not a reliable workaround.
What sort of approach are you planning to take in order to resolve this iOS bug?
http://stackoverflow.com/questions/11929099/html5-canvas-drawimage-ratio-bug-ios
please assist where i made mistake in inserting blob to indexed DB
<html>
<head>
<title>canvas to blob</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<div><input id="fileInput" type="file" accept="image/*" capture="user"></div>
<div id ="output"></div>
</body>
</html>
<script src="js/iDB.js"></script>
Javascript
$(document).ready(function(){
$("#fileInput").change(function(){
const File = this.files[0];
const cvs = document.createElement("canvas");
const data = new Object(); const data.fileName = "test."+(File.type).split("/").pop();
const cvsBlob = cvs.toBlob(function(blob){
let fileURL = URL.createObjectURL(File);
let Img = new Image();
Img.src = fileURL;
Img.onload = function(){
cvs.width = Img.naturalWidth;
cvs.height = Img.naturalHeight;
let ctx = cvs.getContext("2d").drawImage(Img,0,0);
URL.revokeObjectURL(fileURL);
$("#output").append(cvs).css('width','120');
data.blob = blob;
let trx = db.transaction(["iDBimgs"],"readwrite").objectStore("iDBimgs").put(data,data.fileName);
}
},File.type,0.5);
})
});
able to view the uploaded image in canvas but unable to save canvas as blob in indexed DB
The photos which appear 1:1 the photos which doesnot appear
Download button for after effect photos
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.