-
Notifications
You must be signed in to change notification settings - Fork 226
/
nude.min.js
1 lines (1 loc) · 883 Bytes
/
nude.min.js
1
(function(){var a=(function(){var e=null,c=null,g=null,d=function(){e=document.createElement("canvas");e.style.display="none";var i=document.getElementsByTagName("body")[0];i.appendChild(e);c=e.getContext("2d")},b=function(j){var i=document.getElementById(j);e.width=i.width;e.height=i.height;g=null;c.drawImage(i,0,0)},h=function(){var k=c.getImageData(0,0,e.width,e.height),l=k.data;var i=new Worker("worker.nude.js"),j=[l,e.width,e.height];i.postMessage(j);i.onmessage=function(m){f(m.data)}},f=function(i){if(g){g(i)}else{if(i){console.log("the picture contains nudity")}}};return{init:function(){d();if(!!!window.Worker){document.write(unescape("%3Cscript src='noworker.nude.js' type='text/javascript'%3E%3C/script%3E"))}},load:function(i){b(i)},scan:function(i){if(arguments.length>0&&typeof(arguments[0])=="function"){g=i}h()}}})();if(!window.nude){window.nude=a}a.init()})();