|
|
|
@ -35,17 +35,9 @@ Tesseract.recognize = function(image, options, callback){
@@ -35,17 +35,9 @@ Tesseract.recognize = function(image, options, callback){
|
|
|
|
|
if(image.getImageData) image = image.getImageData(0, 0, image.canvas.width, image.canvas.height); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var blob = new Blob(["\ |
|
|
|
|
importScripts('https://raw.githubusercontent.com/naptha/tesseract.js/master/lib/Tesseract.js');\ |
|
|
|
|
};"]); |
|
|
|
|
var blob = new Blob(["importScripts('https://cdn.rawgit.com/naptha/tesseract.js/master/worker/worker.js');"]); |
|
|
|
|
|
|
|
|
|
var worker = new Worker(window.URL.createObjectURL(blob)); |
|
|
|
|
|
|
|
|
|
worker.onmessage = function(e){ |
|
|
|
|
alert(e.data == 'object' && 'Woot! your browser supports cross domain importScripts') |
|
|
|
|
} |
|
|
|
|
worker.postMessage(42) |
|
|
|
|
var worker = new Worker('/lib/worker.js') |
|
|
|
|
|
|
|
|
|
var progress = (function(){ |
|
|
|
|
if(typeof options.progress === 'function'){ |
|
|
|
|