accurafaceplugin 1.0.20 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ding.mp3 ADDED
Binary file
@@ -0,0 +1 @@
1
+ !function(){"use strict";var e={};function t(e){return m(">"+y("B",e.length),e)}function a(e){return m(">"+y("H",e.length),e)}function n(e){return m(">"+y("L",e.length),e)}function i(e,i,r){var o,l,s,p,S="",f="";if("Byte"==i)(o=e.length)<=4?f=t(e)+y("\0",4-o):(f=m(">L",[r]),S=t(e));else if("Short"==i)(o=e.length)<=2?f=a(e)+y("\0\0",2-o):(f=m(">L",[r]),S=a(e));else if("Long"==i)(o=e.length)<=1?f=n(e):(f=m(">L",[r]),S=n(e));else if("Ascii"==i)(o=(l=e+"\0").length)>4?(f=m(">L",[r]),S=l):f=l+y("\0",4-o);else if("Rational"==i){if("number"==typeof e[0])o=1,s=e[0],p=e[1],l=m(">L",[s])+m(">L",[p]);else{o=e.length,l="";for(var c=0;c<o;c++)s=e[c][0],p=e[c][1],l+=m(">L",[s])+m(">L",[p])}f=m(">L",[r]),S=l}else if("SRational"==i){if("number"==typeof e[0])o=1,s=e[0],p=e[1],l=m(">l",[s])+m(">l",[p]);else{o=e.length,l="";for(c=0;c<o;c++)s=e[c][0],p=e[c][1],l+=m(">l",[s])+m(">l",[p])}f=m(">L",[r]),S=l}else"Undefined"==i&&((o=e.length)>4?(f=m(">L",[r]),S=e):f=e+y("\0",4-o));return[m(">L",[o]),f,S]}function r(e,t,a){var n,r=Object.keys(e).length,o=m(">H",[r]);n=["0th","1st"].indexOf(t)>-1?2+12*r+4:2+12*r;var l="",s="";for(var p in e)if("string"==typeof p&&(p=parseInt(p)),!("0th"==t&&[34665,34853].indexOf(p)>-1||"Exif"==t&&40965==p||"1st"==t&&[513,514].indexOf(p)>-1)){var y=e[p],S=m(">H",[p]),h=c[t][p].type,d=m(">H",[f[h]]);"number"==typeof y&&(y=[y]);var g=i(y,h,8+n+a+s.length);l+=S+d+g[0]+g[1],s+=g[2]}return[o+l,s]}function o(e){var t;if("ÿØ"==e.slice(0,2))t=function(e){for(var t,a=0;a<e.length;a++)if("ÿá"==(t=e[a]).slice(0,2)&&"Exif\0\0"==t.slice(4,10))return t;return null}(S(e)),this.tiftag=t?t.slice(10):null;else if(["II","MM"].indexOf(e.slice(0,2))>-1)this.tiftag=e;else{if("Exif"!=e.slice(0,4))throw new Error("Given file is neither JPEG nor TIFF.");this.tiftag=e.slice(6)}}if(e.version="1.0.4",e.remove=function(e){var t=!1;if("ÿØ"==e.slice(0,2));else{if("data:image/jpeg;base64,"!=e.slice(0,23)&&"data:image/jpg;base64,"!=e.slice(0,22))throw new Error("Given data is not jpeg.");e=s(e.split(",")[1]),t=!0}var a=S(e).filter((function(e){return!("ÿá"==e.slice(0,2)&&"Exif\0\0"==e.slice(4,10))})).join("");return t&&(a="data:image/jpeg;base64,"+l(a)),a},e.insert=function(e,t){var a=!1;if("Exif\0\0"!=e.slice(0,6))throw new Error("Given data is not exif.");if("ÿØ"==t.slice(0,2));else{if("data:image/jpeg;base64,"!=t.slice(0,23)&&"data:image/jpg;base64,"!=t.slice(0,22))throw new Error("Given data is not jpeg.");t=s(t.split(",")[1]),a=!0}var n="ÿá"+m(">H",[e.length+2])+e,i=function(e,t){var a=!1,n=[];e.forEach((function(i,r){"ÿá"==i.slice(0,2)&&"Exif\0\0"==i.slice(4,10)&&(a?n.unshift(r):(e[r]=t,a=!0))})),n.forEach((function(t){e.splice(t,1)})),!a&&t&&(e=[e[0],t].concat(e.slice(1)));return e.join("")}(S(t),n);return a&&(i="data:image/jpeg;base64,"+l(i)),i},e.load=function(e){var t;if("string"!=typeof e)throw new Error("'load' gots invalid type argument.");if("ÿØ"==e.slice(0,2))t=e;else if("data:image/jpeg;base64,"==e.slice(0,23)||"data:image/jpg;base64,"==e.slice(0,22))t=s(e.split(",")[1]);else{if("Exif"!=e.slice(0,4))throw new Error("'load' gots invalid file data.");t=e.slice(6)}var a={"0th":{},Exif:{},GPS:{},Interop:{},"1st":{},thumbnail:null},n=new o(t);if(null===n.tiftag)return a;"II"==n.tiftag.slice(0,2)?n.endian_mark="<":n.endian_mark=">";var i=p(n.endian_mark+"L",n.tiftag.slice(4,8))[0];a["0th"]=n.get_ifd(i,"0th");var r=a["0th"].first_ifd_pointer;if(delete a["0th"].first_ifd_pointer,34665 in a["0th"]&&(i=a["0th"][34665],a.Exif=n.get_ifd(i,"Exif")),34853 in a["0th"]&&(i=a["0th"][34853],a.GPS=n.get_ifd(i,"GPS")),40965 in a.Exif&&(i=a.Exif[40965],a.Interop=n.get_ifd(i,"Interop")),"\0\0\0\0"!=r&&(i=p(n.endian_mark+"L",r)[0],a["1st"]=n.get_ifd(i,"1st"),513 in a["1st"]&&514 in a["1st"])){var l=a["1st"][513]+a["1st"][514],m=n.tiftag.slice(a["1st"][513],l);a.thumbnail=m}return a},e.dump=function(t){var a,n,i,o,l,s,p=(a=t,JSON.parse(JSON.stringify(a))),y=!1,c=!1,h=!1,d=!1;n="0th"in p?p["0th"]:{},"Exif"in p&&Object.keys(p.Exif).length||"Interop"in p&&Object.keys(p.Interop).length?(n[34665]=1,y=!0,i=p.Exif,"Interop"in p&&Object.keys(p.Interop).length?(i[40965]=1,h=!0,o=p.Interop):Object.keys(i).indexOf(e.ExifIFD.InteroperabilityTag.toString())>-1&&delete i[40965]):Object.keys(n).indexOf(e.ImageIFD.ExifTag.toString())>-1&&delete n[34665],"GPS"in p&&Object.keys(p.GPS).length?(n[e.ImageIFD.GPSTag]=1,c=!0,l=p.GPS):Object.keys(n).indexOf(e.ImageIFD.GPSTag.toString())>-1&&delete n[e.ImageIFD.GPSTag],"1st"in p&&"thumbnail"in p&&null!=p.thumbnail&&(d=!0,p["1st"][513]=1,p["1st"][514]=1,s=p["1st"]);var g,u,P,C=r(n,"0th",0),R=C[0].length+12*y+12*c+4+C[1].length,L="",I=0,D="",G=0,A="",b=0,v="";(y&&(I=(g=r(i,"Exif",R))[0].length+12*h+g[1].length),c&&(G=(D=r(l,"GPS",R+I).join("")).length),h)&&(b=(A=r(o,"Interop",R+I+G).join("")).length);if(d&&(u=r(s,"1st",R+I+G+b),(P=function(e){var t=S(e);for(;"ÿà"<=t[1].slice(0,2)&&t[1].slice(0,2)<="ÿï";)t=[t[0]].concat(t.slice(2));return t.join("")}(p.thumbnail)).length>64e3))throw new Error("Given thumbnail is too large. max 64kB");var w="",x="",E="",T="\0\0\0\0";if(y){var k=m(">L",[F=8+R]);w=m(">H",[34665])+m(">H",[f.Long])+m(">L",[1])+k}if(c){k=m(">L",[F=8+R+I]);x=m(">H",[34853])+m(">H",[f.Long])+m(">L",[1])+k}if(h){k=m(">L",[F=8+R+I+G]);E=m(">H",[40965])+m(">H",[f.Long])+m(">L",[1])+k}if(d){var F;T=m(">L",[F=8+R+I+G+b]);var B="\0\0\0\0"+m(">L",[F+u[0].length+24+4+u[1].length]),M="\0\0\0\0"+m(">L",[P.length]);v=u[0]+B+M+"\0\0\0\0"+u[1]+P}var O=C[0]+w+x+T+C[1];return y&&(L=g[0]+E+g[1]),"Exif\0\0MM\0*\0\0\0\b"+O+L+D+A+v},o.prototype={get_ifd:function(e,t){var a,n={},i=p(this.endian_mark+"H",this.tiftag.slice(e,e+2))[0],r=e+2;a=["0th","1st"].indexOf(t)>-1?"Image":t;for(var o=0;o<i;o++){e=r+12*o;var l=p(this.endian_mark+"H",this.tiftag.slice(e,e+2))[0],s=[p(this.endian_mark+"H",this.tiftag.slice(e+2,e+4))[0],p(this.endian_mark+"L",this.tiftag.slice(e+4,e+8))[0],this.tiftag.slice(e+8,e+12)];l in c[a]&&(n[l]=this.convert_value(s))}return"0th"==t&&(e=r+12*i,n.first_ifd_pointer=this.tiftag.slice(e,e+4)),n},convert_value:function(e){var t,a=null,n=e[0],i=e[1],r=e[2];if(1==n)i>4?(t=p(this.endian_mark+"L",r)[0],a=p(this.endian_mark+y("B",i),this.tiftag.slice(t,t+i))):a=p(this.endian_mark+y("B",i),r.slice(0,i));else if(2==n)i>4?(t=p(this.endian_mark+"L",r)[0],a=this.tiftag.slice(t,t+i-1)):a=r.slice(0,i-1);else if(3==n)i>2?(t=p(this.endian_mark+"L",r)[0],a=p(this.endian_mark+y("H",i),this.tiftag.slice(t,t+2*i))):a=p(this.endian_mark+y("H",i),r.slice(0,2*i));else if(4==n)i>1?(t=p(this.endian_mark+"L",r)[0],a=p(this.endian_mark+y("L",i),this.tiftag.slice(t,t+4*i))):a=p(this.endian_mark+y("L",i),r);else if(5==n)if(t=p(this.endian_mark+"L",r)[0],i>1){a=[];for(var o=0;o<i;o++)a.push([p(this.endian_mark+"L",this.tiftag.slice(t+8*o,t+4+8*o))[0],p(this.endian_mark+"L",this.tiftag.slice(t+4+8*o,t+8+8*o))[0]])}else a=[p(this.endian_mark+"L",this.tiftag.slice(t,t+4))[0],p(this.endian_mark+"L",this.tiftag.slice(t+4,t+8))[0]];else if(7==n)i>4?(t=p(this.endian_mark+"L",r)[0],a=this.tiftag.slice(t,t+i)):a=r.slice(0,i);else if(9==n)i>1?(t=p(this.endian_mark+"L",r)[0],a=p(this.endian_mark+y("l",i),this.tiftag.slice(t,t+4*i))):a=p(this.endian_mark+y("l",i),r);else{if(10!=n)throw new Error("Exif might be wrong. Got incorrect value type to decode. type:"+n);if(t=p(this.endian_mark+"L",r)[0],i>1){a=[];for(o=0;o<i;o++)a.push([p(this.endian_mark+"l",this.tiftag.slice(t+8*o,t+4+8*o))[0],p(this.endian_mark+"l",this.tiftag.slice(t+4+8*o,t+8+8*o))[0]])}else a=[p(this.endian_mark+"l",this.tiftag.slice(t,t+4))[0],p(this.endian_mark+"l",this.tiftag.slice(t+4,t+8))[0]]}return a instanceof Array&&1==a.length?a[0]:a}},"undefined"!=typeof window&&"function"==typeof window.btoa)var l=window.btoa;if(void 0===l)l=function(e){for(var t,a,n,i,r,o,l,s="",m=0,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";m<e.length;)i=(t=e.charCodeAt(m++))>>2,r=(3&t)<<4|(a=e.charCodeAt(m++))>>4,o=(15&a)<<2|(n=e.charCodeAt(m++))>>6,l=63&n,isNaN(a)?o=l=64:isNaN(n)&&(l=64),s=s+p.charAt(i)+p.charAt(r)+p.charAt(o)+p.charAt(l);return s};if("undefined"!=typeof window&&"function"==typeof window.atob)var s=window.atob;if(void 0===s)s=function(e){var t,a,n,i,r,o,l="",s=0,m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");s<e.length;)t=m.indexOf(e.charAt(s++))<<2|(i=m.indexOf(e.charAt(s++)))>>4,a=(15&i)<<4|(r=m.indexOf(e.charAt(s++)))>>2,n=(3&r)<<6|(o=m.indexOf(e.charAt(s++))),l+=String.fromCharCode(t),64!=r&&(l+=String.fromCharCode(a)),64!=o&&(l+=String.fromCharCode(n));return l};function m(e,t){if(!(t instanceof Array))throw new Error("'pack' error. Got invalid type argument.");if(e.length-1!=t.length)throw new Error("'pack' error. "+(e.length-1)+" marks, "+t.length+" elements.");var a;if("<"==e[0])a=!0;else{if(">"!=e[0])throw new Error("");a=!1}for(var n="",i=1,r=null,o=null,l=null;o=e[i];){if("b"==o.toLowerCase()){if(r=t[i-1],"b"==o&&r<0&&(r+=256),r>255||r<0)throw new Error("'pack' error.");l=String.fromCharCode(r)}else if("H"==o){if((r=t[i-1])>65535||r<0)throw new Error("'pack' error.");l=String.fromCharCode(Math.floor(r%65536/256))+String.fromCharCode(r%256),a&&(l=l.split("").reverse().join(""))}else{if("l"!=o.toLowerCase())throw new Error("'pack' error.");if(r=t[i-1],"l"==o&&r<0&&(r+=4294967296),r>4294967295||r<0)throw new Error("'pack' error.");l=String.fromCharCode(Math.floor(r/16777216))+String.fromCharCode(Math.floor(r%16777216/65536))+String.fromCharCode(Math.floor(r%65536/256))+String.fromCharCode(r%256),a&&(l=l.split("").reverse().join(""))}n+=l,i+=1}return n}function p(e,t){if("string"!=typeof t)throw new Error("'unpack' error. Got invalid type argument.");for(var a,n=0,i=1;i<e.length;i++)if("b"==e[i].toLowerCase())n+=1;else if("h"==e[i].toLowerCase())n+=2;else{if("l"!=e[i].toLowerCase())throw new Error("'unpack' error. Got invalid mark.");n+=4}if(n!=t.length)throw new Error("'unpack' error. Mismatch between symbol and string length. "+n+":"+t.length);if("<"==e[0])a=!0;else{if(">"!=e[0])throw new Error("'unpack' error.");a=!1}for(var r=[],o=0,l=1,s=null,m=null,p=null,y="";m=e[l];){if("b"==m.toLowerCase())p=1,s=(y=t.slice(o,o+p)).charCodeAt(0),"b"==m&&s>=128&&(s-=256);else if("H"==m)p=2,y=t.slice(o,o+p),a&&(y=y.split("").reverse().join("")),s=256*y.charCodeAt(0)+y.charCodeAt(1);else{if("l"!=m.toLowerCase())throw new Error("'unpack' error. "+m);p=4,y=t.slice(o,o+p),a&&(y=y.split("").reverse().join("")),s=16777216*y.charCodeAt(0)+65536*y.charCodeAt(1)+256*y.charCodeAt(2)+y.charCodeAt(3),"l"==m&&s>=2147483648&&(s-=4294967296)}r.push(s),o+=p,l+=1}return r}function y(e,t){for(var a="",n=0;n<t;n++)a+=e;return a}function S(e){if("ÿØ"!=e.slice(0,2))throw new Error("Given data isn't JPEG.");for(var t=2,a=["ÿØ"];;){if("ÿÚ"==e.slice(t,t+2)){a.push(e.slice(t));break}var n=t+p(">H",e.slice(t+2,t+4))[0]+2;if(a.push(e.slice(t,n)),(t=n)>=e.length)throw new Error("Wrong JPEG data.")}return a}var f={Byte:1,Ascii:2,Short:3,Long:4,Rational:5,Undefined:7,SLong:9,SRational:10},c={Image:{11:{name:"ProcessingSoftware",type:"Ascii"},254:{name:"NewSubfileType",type:"Long"},255:{name:"SubfileType",type:"Short"},256:{name:"ImageWidth",type:"Long"},257:{name:"ImageLength",type:"Long"},258:{name:"BitsPerSample",type:"Short"},259:{name:"Compression",type:"Short"},262:{name:"PhotometricInterpretation",type:"Short"},263:{name:"Threshholding",type:"Short"},264:{name:"CellWidth",type:"Short"},265:{name:"CellLength",type:"Short"},266:{name:"FillOrder",type:"Short"},269:{name:"DocumentName",type:"Ascii"},270:{name:"ImageDescription",type:"Ascii"},271:{name:"Make",type:"Ascii"},272:{name:"Model",type:"Ascii"},273:{name:"StripOffsets",type:"Long"},274:{name:"Orientation",type:"Short"},277:{name:"SamplesPerPixel",type:"Short"},278:{name:"RowsPerStrip",type:"Long"},279:{name:"StripByteCounts",type:"Long"},282:{name:"XResolution",type:"Rational"},283:{name:"YResolution",type:"Rational"},284:{name:"PlanarConfiguration",type:"Short"},290:{name:"GrayResponseUnit",type:"Short"},291:{name:"GrayResponseCurve",type:"Short"},292:{name:"T4Options",type:"Long"},293:{name:"T6Options",type:"Long"},296:{name:"ResolutionUnit",type:"Short"},301:{name:"TransferFunction",type:"Short"},305:{name:"Software",type:"Ascii"},306:{name:"DateTime",type:"Ascii"},315:{name:"Artist",type:"Ascii"},316:{name:"HostComputer",type:"Ascii"},317:{name:"Predictor",type:"Short"},318:{name:"WhitePoint",type:"Rational"},319:{name:"PrimaryChromaticities",type:"Rational"},320:{name:"ColorMap",type:"Short"},321:{name:"HalftoneHints",type:"Short"},322:{name:"TileWidth",type:"Short"},323:{name:"TileLength",type:"Short"},324:{name:"TileOffsets",type:"Short"},325:{name:"TileByteCounts",type:"Short"},330:{name:"SubIFDs",type:"Long"},332:{name:"InkSet",type:"Short"},333:{name:"InkNames",type:"Ascii"},334:{name:"NumberOfInks",type:"Short"},336:{name:"DotRange",type:"Byte"},337:{name:"TargetPrinter",type:"Ascii"},338:{name:"ExtraSamples",type:"Short"},339:{name:"SampleFormat",type:"Short"},340:{name:"SMinSampleValue",type:"Short"},341:{name:"SMaxSampleValue",type:"Short"},342:{name:"TransferRange",type:"Short"},343:{name:"ClipPath",type:"Byte"},344:{name:"XClipPathUnits",type:"Long"},345:{name:"YClipPathUnits",type:"Long"},346:{name:"Indexed",type:"Short"},347:{name:"JPEGTables",type:"Undefined"},351:{name:"OPIProxy",type:"Short"},512:{name:"JPEGProc",type:"Long"},513:{name:"JPEGInterchangeFormat",type:"Long"},514:{name:"JPEGInterchangeFormatLength",type:"Long"},515:{name:"JPEGRestartInterval",type:"Short"},517:{name:"JPEGLosslessPredictors",type:"Short"},518:{name:"JPEGPointTransforms",type:"Short"},519:{name:"JPEGQTables",type:"Long"},520:{name:"JPEGDCTables",type:"Long"},521:{name:"JPEGACTables",type:"Long"},529:{name:"YCbCrCoefficients",type:"Rational"},530:{name:"YCbCrSubSampling",type:"Short"},531:{name:"YCbCrPositioning",type:"Short"},532:{name:"ReferenceBlackWhite",type:"Rational"},700:{name:"XMLPacket",type:"Byte"},18246:{name:"Rating",type:"Short"},18249:{name:"RatingPercent",type:"Short"},32781:{name:"ImageID",type:"Ascii"},33421:{name:"CFARepeatPatternDim",type:"Short"},33422:{name:"CFAPattern",type:"Byte"},33423:{name:"BatteryLevel",type:"Rational"},33432:{name:"Copyright",type:"Ascii"},33434:{name:"ExposureTime",type:"Rational"},34377:{name:"ImageResources",type:"Byte"},34665:{name:"ExifTag",type:"Long"},34675:{name:"InterColorProfile",type:"Undefined"},34853:{name:"GPSTag",type:"Long"},34857:{name:"Interlace",type:"Short"},34858:{name:"TimeZoneOffset",type:"Long"},34859:{name:"SelfTimerMode",type:"Short"},37387:{name:"FlashEnergy",type:"Rational"},37388:{name:"SpatialFrequencyResponse",type:"Undefined"},37389:{name:"Noise",type:"Undefined"},37390:{name:"FocalPlaneXResolution",type:"Rational"},37391:{name:"FocalPlaneYResolution",type:"Rational"},37392:{name:"FocalPlaneResolutionUnit",type:"Short"},37393:{name:"ImageNumber",type:"Long"},37394:{name:"SecurityClassification",type:"Ascii"},37395:{name:"ImageHistory",type:"Ascii"},37397:{name:"ExposureIndex",type:"Rational"},37398:{name:"TIFFEPStandardID",type:"Byte"},37399:{name:"SensingMethod",type:"Short"},40091:{name:"XPTitle",type:"Byte"},40092:{name:"XPComment",type:"Byte"},40093:{name:"XPAuthor",type:"Byte"},40094:{name:"XPKeywords",type:"Byte"},40095:{name:"XPSubject",type:"Byte"},50341:{name:"PrintImageMatching",type:"Undefined"},50706:{name:"DNGVersion",type:"Byte"},50707:{name:"DNGBackwardVersion",type:"Byte"},50708:{name:"UniqueCameraModel",type:"Ascii"},50709:{name:"LocalizedCameraModel",type:"Byte"},50710:{name:"CFAPlaneColor",type:"Byte"},50711:{name:"CFALayout",type:"Short"},50712:{name:"LinearizationTable",type:"Short"},50713:{name:"BlackLevelRepeatDim",type:"Short"},50714:{name:"BlackLevel",type:"Rational"},50715:{name:"BlackLevelDeltaH",type:"SRational"},50716:{name:"BlackLevelDeltaV",type:"SRational"},50717:{name:"WhiteLevel",type:"Short"},50718:{name:"DefaultScale",type:"Rational"},50719:{name:"DefaultCropOrigin",type:"Short"},50720:{name:"DefaultCropSize",type:"Short"},50721:{name:"ColorMatrix1",type:"SRational"},50722:{name:"ColorMatrix2",type:"SRational"},50723:{name:"CameraCalibration1",type:"SRational"},50724:{name:"CameraCalibration2",type:"SRational"},50725:{name:"ReductionMatrix1",type:"SRational"},50726:{name:"ReductionMatrix2",type:"SRational"},50727:{name:"AnalogBalance",type:"Rational"},50728:{name:"AsShotNeutral",type:"Short"},50729:{name:"AsShotWhiteXY",type:"Rational"},50730:{name:"BaselineExposure",type:"SRational"},50731:{name:"BaselineNoise",type:"Rational"},50732:{name:"BaselineSharpness",type:"Rational"},50733:{name:"BayerGreenSplit",type:"Long"},50734:{name:"LinearResponseLimit",type:"Rational"},50735:{name:"CameraSerialNumber",type:"Ascii"},50736:{name:"LensInfo",type:"Rational"},50737:{name:"ChromaBlurRadius",type:"Rational"},50738:{name:"AntiAliasStrength",type:"Rational"},50739:{name:"ShadowScale",type:"SRational"},50740:{name:"DNGPrivateData",type:"Byte"},50741:{name:"MakerNoteSafety",type:"Short"},50778:{name:"CalibrationIlluminant1",type:"Short"},50779:{name:"CalibrationIlluminant2",type:"Short"},50780:{name:"BestQualityScale",type:"Rational"},50781:{name:"RawDataUniqueID",type:"Byte"},50827:{name:"OriginalRawFileName",type:"Byte"},50828:{name:"OriginalRawFileData",type:"Undefined"},50829:{name:"ActiveArea",type:"Short"},50830:{name:"MaskedAreas",type:"Short"},50831:{name:"AsShotICCProfile",type:"Undefined"},50832:{name:"AsShotPreProfileMatrix",type:"SRational"},50833:{name:"CurrentICCProfile",type:"Undefined"},50834:{name:"CurrentPreProfileMatrix",type:"SRational"},50879:{name:"ColorimetricReference",type:"Short"},50931:{name:"CameraCalibrationSignature",type:"Byte"},50932:{name:"ProfileCalibrationSignature",type:"Byte"},50934:{name:"AsShotProfileName",type:"Byte"},50935:{name:"NoiseReductionApplied",type:"Rational"},50936:{name:"ProfileName",type:"Byte"},50937:{name:"ProfileHueSatMapDims",type:"Long"},50938:{name:"ProfileHueSatMapData1",type:"Float"},50939:{name:"ProfileHueSatMapData2",type:"Float"},50940:{name:"ProfileToneCurve",type:"Float"},50941:{name:"ProfileEmbedPolicy",type:"Long"},50942:{name:"ProfileCopyright",type:"Byte"},50964:{name:"ForwardMatrix1",type:"SRational"},50965:{name:"ForwardMatrix2",type:"SRational"},50966:{name:"PreviewApplicationName",type:"Byte"},50967:{name:"PreviewApplicationVersion",type:"Byte"},50968:{name:"PreviewSettingsName",type:"Byte"},50969:{name:"PreviewSettingsDigest",type:"Byte"},50970:{name:"PreviewColorSpace",type:"Long"},50971:{name:"PreviewDateTime",type:"Ascii"},50972:{name:"RawImageDigest",type:"Undefined"},50973:{name:"OriginalRawFileDigest",type:"Undefined"},50974:{name:"SubTileBlockSize",type:"Long"},50975:{name:"RowInterleaveFactor",type:"Long"},50981:{name:"ProfileLookTableDims",type:"Long"},50982:{name:"ProfileLookTableData",type:"Float"},51008:{name:"OpcodeList1",type:"Undefined"},51009:{name:"OpcodeList2",type:"Undefined"},51022:{name:"OpcodeList3",type:"Undefined"}},Exif:{33434:{name:"ExposureTime",type:"Rational"},33437:{name:"FNumber",type:"Rational"},34850:{name:"ExposureProgram",type:"Short"},34852:{name:"SpectralSensitivity",type:"Ascii"},34855:{name:"ISOSpeedRatings",type:"Short"},34856:{name:"OECF",type:"Undefined"},34864:{name:"SensitivityType",type:"Short"},34865:{name:"StandardOutputSensitivity",type:"Long"},34866:{name:"RecommendedExposureIndex",type:"Long"},34867:{name:"ISOSpeed",type:"Long"},34868:{name:"ISOSpeedLatitudeyyy",type:"Long"},34869:{name:"ISOSpeedLatitudezzz",type:"Long"},36864:{name:"ExifVersion",type:"Undefined"},36867:{name:"DateTimeOriginal",type:"Ascii"},36868:{name:"DateTimeDigitized",type:"Ascii"},37121:{name:"ComponentsConfiguration",type:"Undefined"},37122:{name:"CompressedBitsPerPixel",type:"Rational"},37377:{name:"ShutterSpeedValue",type:"SRational"},37378:{name:"ApertureValue",type:"Rational"},37379:{name:"BrightnessValue",type:"SRational"},37380:{name:"ExposureBiasValue",type:"SRational"},37381:{name:"MaxApertureValue",type:"Rational"},37382:{name:"SubjectDistance",type:"Rational"},37383:{name:"MeteringMode",type:"Short"},37384:{name:"LightSource",type:"Short"},37385:{name:"Flash",type:"Short"},37386:{name:"FocalLength",type:"Rational"},37396:{name:"SubjectArea",type:"Short"},37500:{name:"MakerNote",type:"Undefined"},37510:{name:"UserComment",type:"Ascii"},37520:{name:"SubSecTime",type:"Ascii"},37521:{name:"SubSecTimeOriginal",type:"Ascii"},37522:{name:"SubSecTimeDigitized",type:"Ascii"},40960:{name:"FlashpixVersion",type:"Undefined"},40961:{name:"ColorSpace",type:"Short"},40962:{name:"PixelXDimension",type:"Long"},40963:{name:"PixelYDimension",type:"Long"},40964:{name:"RelatedSoundFile",type:"Ascii"},40965:{name:"InteroperabilityTag",type:"Long"},41483:{name:"FlashEnergy",type:"Rational"},41484:{name:"SpatialFrequencyResponse",type:"Undefined"},41486:{name:"FocalPlaneXResolution",type:"Rational"},41487:{name:"FocalPlaneYResolution",type:"Rational"},41488:{name:"FocalPlaneResolutionUnit",type:"Short"},41492:{name:"SubjectLocation",type:"Short"},41493:{name:"ExposureIndex",type:"Rational"},41495:{name:"SensingMethod",type:"Short"},41728:{name:"FileSource",type:"Undefined"},41729:{name:"SceneType",type:"Undefined"},41730:{name:"CFAPattern",type:"Undefined"},41985:{name:"CustomRendered",type:"Short"},41986:{name:"ExposureMode",type:"Short"},41987:{name:"WhiteBalance",type:"Short"},41988:{name:"DigitalZoomRatio",type:"Rational"},41989:{name:"FocalLengthIn35mmFilm",type:"Short"},41990:{name:"SceneCaptureType",type:"Short"},41991:{name:"GainControl",type:"Short"},41992:{name:"Contrast",type:"Short"},41993:{name:"Saturation",type:"Short"},41994:{name:"Sharpness",type:"Short"},41995:{name:"DeviceSettingDescription",type:"Undefined"},41996:{name:"SubjectDistanceRange",type:"Short"},42016:{name:"ImageUniqueID",type:"Ascii"},42032:{name:"CameraOwnerName",type:"Ascii"},42033:{name:"BodySerialNumber",type:"Ascii"},42034:{name:"LensSpecification",type:"Rational"},42035:{name:"LensMake",type:"Ascii"},42036:{name:"LensModel",type:"Ascii"},42037:{name:"LensSerialNumber",type:"Ascii"},42240:{name:"Gamma",type:"Rational"}},GPS:{0:{name:"GPSVersionID",type:"Byte"},1:{name:"GPSLatitudeRef",type:"Ascii"},2:{name:"GPSLatitude",type:"Rational"},3:{name:"GPSLongitudeRef",type:"Ascii"},4:{name:"GPSLongitude",type:"Rational"},5:{name:"GPSAltitudeRef",type:"Byte"},6:{name:"GPSAltitude",type:"Rational"},7:{name:"GPSTimeStamp",type:"Rational"},8:{name:"GPSSatellites",type:"Ascii"},9:{name:"GPSStatus",type:"Ascii"},10:{name:"GPSMeasureMode",type:"Ascii"},11:{name:"GPSDOP",type:"Rational"},12:{name:"GPSSpeedRef",type:"Ascii"},13:{name:"GPSSpeed",type:"Rational"},14:{name:"GPSTrackRef",type:"Ascii"},15:{name:"GPSTrack",type:"Rational"},16:{name:"GPSImgDirectionRef",type:"Ascii"},17:{name:"GPSImgDirection",type:"Rational"},18:{name:"GPSMapDatum",type:"Ascii"},19:{name:"GPSDestLatitudeRef",type:"Ascii"},20:{name:"GPSDestLatitude",type:"Rational"},21:{name:"GPSDestLongitudeRef",type:"Ascii"},22:{name:"GPSDestLongitude",type:"Rational"},23:{name:"GPSDestBearingRef",type:"Ascii"},24:{name:"GPSDestBearing",type:"Rational"},25:{name:"GPSDestDistanceRef",type:"Ascii"},26:{name:"GPSDestDistance",type:"Rational"},27:{name:"GPSProcessingMethod",type:"Undefined"},28:{name:"GPSAreaInformation",type:"Undefined"},29:{name:"GPSDateStamp",type:"Ascii"},30:{name:"GPSDifferential",type:"Short"},31:{name:"GPSHPositioningError",type:"Rational"}},Interop:{1:{name:"InteroperabilityIndex",type:"Ascii"}}};c["0th"]=c.Image,c["1st"]=c.Image,e.TAGS=c,e.ImageIFD={ProcessingSoftware:11,NewSubfileType:254,SubfileType:255,ImageWidth:256,ImageLength:257,BitsPerSample:258,Compression:259,PhotometricInterpretation:262,Threshholding:263,CellWidth:264,CellLength:265,FillOrder:266,DocumentName:269,ImageDescription:270,Make:271,Model:272,StripOffsets:273,Orientation:274,SamplesPerPixel:277,RowsPerStrip:278,StripByteCounts:279,XResolution:282,YResolution:283,PlanarConfiguration:284,GrayResponseUnit:290,GrayResponseCurve:291,T4Options:292,T6Options:293,ResolutionUnit:296,TransferFunction:301,Software:305,DateTime:306,Artist:315,HostComputer:316,Predictor:317,WhitePoint:318,PrimaryChromaticities:319,ColorMap:320,HalftoneHints:321,TileWidth:322,TileLength:323,TileOffsets:324,TileByteCounts:325,SubIFDs:330,InkSet:332,InkNames:333,NumberOfInks:334,DotRange:336,TargetPrinter:337,ExtraSamples:338,SampleFormat:339,SMinSampleValue:340,SMaxSampleValue:341,TransferRange:342,ClipPath:343,XClipPathUnits:344,YClipPathUnits:345,Indexed:346,JPEGTables:347,OPIProxy:351,JPEGProc:512,JPEGInterchangeFormat:513,JPEGInterchangeFormatLength:514,JPEGRestartInterval:515,JPEGLosslessPredictors:517,JPEGPointTransforms:518,JPEGQTables:519,JPEGDCTables:520,JPEGACTables:521,YCbCrCoefficients:529,YCbCrSubSampling:530,YCbCrPositioning:531,ReferenceBlackWhite:532,XMLPacket:700,Rating:18246,RatingPercent:18249,ImageID:32781,CFARepeatPatternDim:33421,CFAPattern:33422,BatteryLevel:33423,Copyright:33432,ExposureTime:33434,ImageResources:34377,ExifTag:34665,InterColorProfile:34675,GPSTag:34853,Interlace:34857,TimeZoneOffset:34858,SelfTimerMode:34859,FlashEnergy:37387,SpatialFrequencyResponse:37388,Noise:37389,FocalPlaneXResolution:37390,FocalPlaneYResolution:37391,FocalPlaneResolutionUnit:37392,ImageNumber:37393,SecurityClassification:37394,ImageHistory:37395,ExposureIndex:37397,TIFFEPStandardID:37398,SensingMethod:37399,XPTitle:40091,XPComment:40092,XPAuthor:40093,XPKeywords:40094,XPSubject:40095,PrintImageMatching:50341,DNGVersion:50706,DNGBackwardVersion:50707,UniqueCameraModel:50708,LocalizedCameraModel:50709,CFAPlaneColor:50710,CFALayout:50711,LinearizationTable:50712,BlackLevelRepeatDim:50713,BlackLevel:50714,BlackLevelDeltaH:50715,BlackLevelDeltaV:50716,WhiteLevel:50717,DefaultScale:50718,DefaultCropOrigin:50719,DefaultCropSize:50720,ColorMatrix1:50721,ColorMatrix2:50722,CameraCalibration1:50723,CameraCalibration2:50724,ReductionMatrix1:50725,ReductionMatrix2:50726,AnalogBalance:50727,AsShotNeutral:50728,AsShotWhiteXY:50729,BaselineExposure:50730,BaselineNoise:50731,BaselineSharpness:50732,BayerGreenSplit:50733,LinearResponseLimit:50734,CameraSerialNumber:50735,LensInfo:50736,ChromaBlurRadius:50737,AntiAliasStrength:50738,ShadowScale:50739,DNGPrivateData:50740,MakerNoteSafety:50741,CalibrationIlluminant1:50778,CalibrationIlluminant2:50779,BestQualityScale:50780,RawDataUniqueID:50781,OriginalRawFileName:50827,OriginalRawFileData:50828,ActiveArea:50829,MaskedAreas:50830,AsShotICCProfile:50831,AsShotPreProfileMatrix:50832,CurrentICCProfile:50833,CurrentPreProfileMatrix:50834,ColorimetricReference:50879,CameraCalibrationSignature:50931,ProfileCalibrationSignature:50932,AsShotProfileName:50934,NoiseReductionApplied:50935,ProfileName:50936,ProfileHueSatMapDims:50937,ProfileHueSatMapData1:50938,ProfileHueSatMapData2:50939,ProfileToneCurve:50940,ProfileEmbedPolicy:50941,ProfileCopyright:50942,ForwardMatrix1:50964,ForwardMatrix2:50965,PreviewApplicationName:50966,PreviewApplicationVersion:50967,PreviewSettingsName:50968,PreviewSettingsDigest:50969,PreviewColorSpace:50970,PreviewDateTime:50971,RawImageDigest:50972,OriginalRawFileDigest:50973,SubTileBlockSize:50974,RowInterleaveFactor:50975,ProfileLookTableDims:50981,ProfileLookTableData:50982,OpcodeList1:51008,OpcodeList2:51009,OpcodeList3:51022,NoiseProfile:51041},e.ExifIFD={ExposureTime:33434,FNumber:33437,ExposureProgram:34850,SpectralSensitivity:34852,ISOSpeedRatings:34855,OECF:34856,SensitivityType:34864,StandardOutputSensitivity:34865,RecommendedExposureIndex:34866,ISOSpeed:34867,ISOSpeedLatitudeyyy:34868,ISOSpeedLatitudezzz:34869,ExifVersion:36864,DateTimeOriginal:36867,DateTimeDigitized:36868,ComponentsConfiguration:37121,CompressedBitsPerPixel:37122,ShutterSpeedValue:37377,ApertureValue:37378,BrightnessValue:37379,ExposureBiasValue:37380,MaxApertureValue:37381,SubjectDistance:37382,MeteringMode:37383,LightSource:37384,Flash:37385,FocalLength:37386,SubjectArea:37396,MakerNote:37500,UserComment:37510,SubSecTime:37520,SubSecTimeOriginal:37521,SubSecTimeDigitized:37522,FlashpixVersion:40960,ColorSpace:40961,PixelXDimension:40962,PixelYDimension:40963,RelatedSoundFile:40964,InteroperabilityTag:40965,FlashEnergy:41483,SpatialFrequencyResponse:41484,FocalPlaneXResolution:41486,FocalPlaneYResolution:41487,FocalPlaneResolutionUnit:41488,SubjectLocation:41492,ExposureIndex:41493,SensingMethod:41495,FileSource:41728,SceneType:41729,CFAPattern:41730,CustomRendered:41985,ExposureMode:41986,WhiteBalance:41987,DigitalZoomRatio:41988,FocalLengthIn35mmFilm:41989,SceneCaptureType:41990,GainControl:41991,Contrast:41992,Saturation:41993,Sharpness:41994,DeviceSettingDescription:41995,SubjectDistanceRange:41996,ImageUniqueID:42016,CameraOwnerName:42032,BodySerialNumber:42033,LensSpecification:42034,LensMake:42035,LensModel:42036,LensSerialNumber:42037,Gamma:42240},e.GPSIFD={GPSVersionID:0,GPSLatitudeRef:1,GPSLatitude:2,GPSLongitudeRef:3,GPSLongitude:4,GPSAltitudeRef:5,GPSAltitude:6,GPSTimeStamp:7,GPSSatellites:8,GPSStatus:9,GPSMeasureMode:10,GPSDOP:11,GPSSpeedRef:12,GPSSpeed:13,GPSTrackRef:14,GPSTrack:15,GPSImgDirectionRef:16,GPSImgDirection:17,GPSMapDatum:18,GPSDestLatitudeRef:19,GPSDestLatitude:20,GPSDestLongitudeRef:21,GPSDestLongitude:22,GPSDestBearingRef:23,GPSDestBearing:24,GPSDestDistanceRef:25,GPSDestDistance:26,GPSProcessingMethod:27,GPSAreaInformation:28,GPSDateStamp:29,GPSDifferential:30,GPSHPositioningError:31},e.InteropIFD={InteroperabilityIndex:1},e.GPSHelper={degToDmsRational:function(e){var t=Math.abs(e),a=t%1*60,n=a%1*60;return[[Math.floor(t),1],[Math.floor(a),1],[Math.round(100*n),100]]},dmsRationalToDeg:function(e,t){var a="S"===t||"W"===t?-1:1;return(e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600)*a}},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=e),exports.piexif=e):window.piexif=e}();
package/dist/piexif.js ADDED
@@ -0,0 +1 @@
1
+ !function(){"use strict";var e={};function t(e){return m(">"+y("B",e.length),e)}function a(e){return m(">"+y("H",e.length),e)}function n(e){return m(">"+y("L",e.length),e)}function i(e,i,r){var o,l,s,p,S="",f="";if("Byte"==i)(o=e.length)<=4?f=t(e)+y("\0",4-o):(f=m(">L",[r]),S=t(e));else if("Short"==i)(o=e.length)<=2?f=a(e)+y("\0\0",2-o):(f=m(">L",[r]),S=a(e));else if("Long"==i)(o=e.length)<=1?f=n(e):(f=m(">L",[r]),S=n(e));else if("Ascii"==i)(o=(l=e+"\0").length)>4?(f=m(">L",[r]),S=l):f=l+y("\0",4-o);else if("Rational"==i){if("number"==typeof e[0])o=1,s=e[0],p=e[1],l=m(">L",[s])+m(">L",[p]);else{o=e.length,l="";for(var c=0;c<o;c++)s=e[c][0],p=e[c][1],l+=m(">L",[s])+m(">L",[p])}f=m(">L",[r]),S=l}else if("SRational"==i){if("number"==typeof e[0])o=1,s=e[0],p=e[1],l=m(">l",[s])+m(">l",[p]);else{o=e.length,l="";for(c=0;c<o;c++)s=e[c][0],p=e[c][1],l+=m(">l",[s])+m(">l",[p])}f=m(">L",[r]),S=l}else"Undefined"==i&&((o=e.length)>4?(f=m(">L",[r]),S=e):f=e+y("\0",4-o));return[m(">L",[o]),f,S]}function r(e,t,a){var n,r=Object.keys(e).length,o=m(">H",[r]);n=["0th","1st"].indexOf(t)>-1?2+12*r+4:2+12*r;var l="",s="";for(var p in e)if("string"==typeof p&&(p=parseInt(p)),!("0th"==t&&[34665,34853].indexOf(p)>-1||"Exif"==t&&40965==p||"1st"==t&&[513,514].indexOf(p)>-1)){var y=e[p],S=m(">H",[p]),h=c[t][p].type,d=m(">H",[f[h]]);"number"==typeof y&&(y=[y]);var g=i(y,h,8+n+a+s.length);l+=S+d+g[0]+g[1],s+=g[2]}return[o+l,s]}function o(e){var t;if("ÿØ"==e.slice(0,2))t=function(e){for(var t,a=0;a<e.length;a++)if("ÿá"==(t=e[a]).slice(0,2)&&"Exif\0\0"==t.slice(4,10))return t;return null}(S(e)),this.tiftag=t?t.slice(10):null;else if(["II","MM"].indexOf(e.slice(0,2))>-1)this.tiftag=e;else{if("Exif"!=e.slice(0,4))throw new Error("Given file is neither JPEG nor TIFF.");this.tiftag=e.slice(6)}}if(e.version="1.0.4",e.remove=function(e){var t=!1;if("ÿØ"==e.slice(0,2));else{if("data:image/jpeg;base64,"!=e.slice(0,23)&&"data:image/jpg;base64,"!=e.slice(0,22))throw new Error("Given data is not jpeg.");e=s(e.split(",")[1]),t=!0}var a=S(e).filter((function(e){return!("ÿá"==e.slice(0,2)&&"Exif\0\0"==e.slice(4,10))})).join("");return t&&(a="data:image/jpeg;base64,"+l(a)),a},e.insert=function(e,t){var a=!1;if("Exif\0\0"!=e.slice(0,6))throw new Error("Given data is not exif.");if("ÿØ"==t.slice(0,2));else{if("data:image/jpeg;base64,"!=t.slice(0,23)&&"data:image/jpg;base64,"!=t.slice(0,22))throw new Error("Given data is not jpeg.");t=s(t.split(",")[1]),a=!0}var n="ÿá"+m(">H",[e.length+2])+e,i=function(e,t){var a=!1,n=[];e.forEach((function(i,r){"ÿá"==i.slice(0,2)&&"Exif\0\0"==i.slice(4,10)&&(a?n.unshift(r):(e[r]=t,a=!0))})),n.forEach((function(t){e.splice(t,1)})),!a&&t&&(e=[e[0],t].concat(e.slice(1)));return e.join("")}(S(t),n);return a&&(i="data:image/jpeg;base64,"+l(i)),i},e.load=function(e){var t;if("string"!=typeof e)throw new Error("'load' gots invalid type argument.");if("ÿØ"==e.slice(0,2))t=e;else if("data:image/jpeg;base64,"==e.slice(0,23)||"data:image/jpg;base64,"==e.slice(0,22))t=s(e.split(",")[1]);else{if("Exif"!=e.slice(0,4))throw new Error("'load' gots invalid file data.");t=e.slice(6)}var a={"0th":{},Exif:{},GPS:{},Interop:{},"1st":{},thumbnail:null},n=new o(t);if(null===n.tiftag)return a;"II"==n.tiftag.slice(0,2)?n.endian_mark="<":n.endian_mark=">";var i=p(n.endian_mark+"L",n.tiftag.slice(4,8))[0];a["0th"]=n.get_ifd(i,"0th");var r=a["0th"].first_ifd_pointer;if(delete a["0th"].first_ifd_pointer,34665 in a["0th"]&&(i=a["0th"][34665],a.Exif=n.get_ifd(i,"Exif")),34853 in a["0th"]&&(i=a["0th"][34853],a.GPS=n.get_ifd(i,"GPS")),40965 in a.Exif&&(i=a.Exif[40965],a.Interop=n.get_ifd(i,"Interop")),"\0\0\0\0"!=r&&(i=p(n.endian_mark+"L",r)[0],a["1st"]=n.get_ifd(i,"1st"),513 in a["1st"]&&514 in a["1st"])){var l=a["1st"][513]+a["1st"][514],m=n.tiftag.slice(a["1st"][513],l);a.thumbnail=m}return a},e.dump=function(t){var a,n,i,o,l,s,p=(a=t,JSON.parse(JSON.stringify(a))),y=!1,c=!1,h=!1,d=!1;n="0th"in p?p["0th"]:{},"Exif"in p&&Object.keys(p.Exif).length||"Interop"in p&&Object.keys(p.Interop).length?(n[34665]=1,y=!0,i=p.Exif,"Interop"in p&&Object.keys(p.Interop).length?(i[40965]=1,h=!0,o=p.Interop):Object.keys(i).indexOf(e.ExifIFD.InteroperabilityTag.toString())>-1&&delete i[40965]):Object.keys(n).indexOf(e.ImageIFD.ExifTag.toString())>-1&&delete n[34665],"GPS"in p&&Object.keys(p.GPS).length?(n[e.ImageIFD.GPSTag]=1,c=!0,l=p.GPS):Object.keys(n).indexOf(e.ImageIFD.GPSTag.toString())>-1&&delete n[e.ImageIFD.GPSTag],"1st"in p&&"thumbnail"in p&&null!=p.thumbnail&&(d=!0,p["1st"][513]=1,p["1st"][514]=1,s=p["1st"]);var g,u,P,C=r(n,"0th",0),R=C[0].length+12*y+12*c+4+C[1].length,L="",I=0,D="",G=0,A="",b=0,v="";(y&&(I=(g=r(i,"Exif",R))[0].length+12*h+g[1].length),c&&(G=(D=r(l,"GPS",R+I).join("")).length),h)&&(b=(A=r(o,"Interop",R+I+G).join("")).length);if(d&&(u=r(s,"1st",R+I+G+b),(P=function(e){var t=S(e);for(;"ÿà"<=t[1].slice(0,2)&&t[1].slice(0,2)<="ÿï";)t=[t[0]].concat(t.slice(2));return t.join("")}(p.thumbnail)).length>64e3))throw new Error("Given thumbnail is too large. max 64kB");var w="",x="",E="",T="\0\0\0\0";if(y){var k=m(">L",[F=8+R]);w=m(">H",[34665])+m(">H",[f.Long])+m(">L",[1])+k}if(c){k=m(">L",[F=8+R+I]);x=m(">H",[34853])+m(">H",[f.Long])+m(">L",[1])+k}if(h){k=m(">L",[F=8+R+I+G]);E=m(">H",[40965])+m(">H",[f.Long])+m(">L",[1])+k}if(d){var F;T=m(">L",[F=8+R+I+G+b]);var B="\0\0\0\0"+m(">L",[F+u[0].length+24+4+u[1].length]),M="\0\0\0\0"+m(">L",[P.length]);v=u[0]+B+M+"\0\0\0\0"+u[1]+P}var O=C[0]+w+x+T+C[1];return y&&(L=g[0]+E+g[1]),"Exif\0\0MM\0*\0\0\0\b"+O+L+D+A+v},o.prototype={get_ifd:function(e,t){var a,n={},i=p(this.endian_mark+"H",this.tiftag.slice(e,e+2))[0],r=e+2;a=["0th","1st"].indexOf(t)>-1?"Image":t;for(var o=0;o<i;o++){e=r+12*o;var l=p(this.endian_mark+"H",this.tiftag.slice(e,e+2))[0],s=[p(this.endian_mark+"H",this.tiftag.slice(e+2,e+4))[0],p(this.endian_mark+"L",this.tiftag.slice(e+4,e+8))[0],this.tiftag.slice(e+8,e+12)];l in c[a]&&(n[l]=this.convert_value(s))}return"0th"==t&&(e=r+12*i,n.first_ifd_pointer=this.tiftag.slice(e,e+4)),n},convert_value:function(e){var t,a=null,n=e[0],i=e[1],r=e[2];if(1==n)i>4?(t=p(this.endian_mark+"L",r)[0],a=p(this.endian_mark+y("B",i),this.tiftag.slice(t,t+i))):a=p(this.endian_mark+y("B",i),r.slice(0,i));else if(2==n)i>4?(t=p(this.endian_mark+"L",r)[0],a=this.tiftag.slice(t,t+i-1)):a=r.slice(0,i-1);else if(3==n)i>2?(t=p(this.endian_mark+"L",r)[0],a=p(this.endian_mark+y("H",i),this.tiftag.slice(t,t+2*i))):a=p(this.endian_mark+y("H",i),r.slice(0,2*i));else if(4==n)i>1?(t=p(this.endian_mark+"L",r)[0],a=p(this.endian_mark+y("L",i),this.tiftag.slice(t,t+4*i))):a=p(this.endian_mark+y("L",i),r);else if(5==n)if(t=p(this.endian_mark+"L",r)[0],i>1){a=[];for(var o=0;o<i;o++)a.push([p(this.endian_mark+"L",this.tiftag.slice(t+8*o,t+4+8*o))[0],p(this.endian_mark+"L",this.tiftag.slice(t+4+8*o,t+8+8*o))[0]])}else a=[p(this.endian_mark+"L",this.tiftag.slice(t,t+4))[0],p(this.endian_mark+"L",this.tiftag.slice(t+4,t+8))[0]];else if(7==n)i>4?(t=p(this.endian_mark+"L",r)[0],a=this.tiftag.slice(t,t+i)):a=r.slice(0,i);else if(9==n)i>1?(t=p(this.endian_mark+"L",r)[0],a=p(this.endian_mark+y("l",i),this.tiftag.slice(t,t+4*i))):a=p(this.endian_mark+y("l",i),r);else{if(10!=n)throw new Error("Exif might be wrong. Got incorrect value type to decode. type:"+n);if(t=p(this.endian_mark+"L",r)[0],i>1){a=[];for(o=0;o<i;o++)a.push([p(this.endian_mark+"l",this.tiftag.slice(t+8*o,t+4+8*o))[0],p(this.endian_mark+"l",this.tiftag.slice(t+4+8*o,t+8+8*o))[0]])}else a=[p(this.endian_mark+"l",this.tiftag.slice(t,t+4))[0],p(this.endian_mark+"l",this.tiftag.slice(t+4,t+8))[0]]}return a instanceof Array&&1==a.length?a[0]:a}},"undefined"!=typeof window&&"function"==typeof window.btoa)var l=window.btoa;if(void 0===l)l=function(e){for(var t,a,n,i,r,o,l,s="",m=0,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";m<e.length;)i=(t=e.charCodeAt(m++))>>2,r=(3&t)<<4|(a=e.charCodeAt(m++))>>4,o=(15&a)<<2|(n=e.charCodeAt(m++))>>6,l=63&n,isNaN(a)?o=l=64:isNaN(n)&&(l=64),s=s+p.charAt(i)+p.charAt(r)+p.charAt(o)+p.charAt(l);return s};if("undefined"!=typeof window&&"function"==typeof window.atob)var s=window.atob;if(void 0===s)s=function(e){var t,a,n,i,r,o,l="",s=0,m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");s<e.length;)t=m.indexOf(e.charAt(s++))<<2|(i=m.indexOf(e.charAt(s++)))>>4,a=(15&i)<<4|(r=m.indexOf(e.charAt(s++)))>>2,n=(3&r)<<6|(o=m.indexOf(e.charAt(s++))),l+=String.fromCharCode(t),64!=r&&(l+=String.fromCharCode(a)),64!=o&&(l+=String.fromCharCode(n));return l};function m(e,t){if(!(t instanceof Array))throw new Error("'pack' error. Got invalid type argument.");if(e.length-1!=t.length)throw new Error("'pack' error. "+(e.length-1)+" marks, "+t.length+" elements.");var a;if("<"==e[0])a=!0;else{if(">"!=e[0])throw new Error("");a=!1}for(var n="",i=1,r=null,o=null,l=null;o=e[i];){if("b"==o.toLowerCase()){if(r=t[i-1],"b"==o&&r<0&&(r+=256),r>255||r<0)throw new Error("'pack' error.");l=String.fromCharCode(r)}else if("H"==o){if((r=t[i-1])>65535||r<0)throw new Error("'pack' error.");l=String.fromCharCode(Math.floor(r%65536/256))+String.fromCharCode(r%256),a&&(l=l.split("").reverse().join(""))}else{if("l"!=o.toLowerCase())throw new Error("'pack' error.");if(r=t[i-1],"l"==o&&r<0&&(r+=4294967296),r>4294967295||r<0)throw new Error("'pack' error.");l=String.fromCharCode(Math.floor(r/16777216))+String.fromCharCode(Math.floor(r%16777216/65536))+String.fromCharCode(Math.floor(r%65536/256))+String.fromCharCode(r%256),a&&(l=l.split("").reverse().join(""))}n+=l,i+=1}return n}function p(e,t){if("string"!=typeof t)throw new Error("'unpack' error. Got invalid type argument.");for(var a,n=0,i=1;i<e.length;i++)if("b"==e[i].toLowerCase())n+=1;else if("h"==e[i].toLowerCase())n+=2;else{if("l"!=e[i].toLowerCase())throw new Error("'unpack' error. Got invalid mark.");n+=4}if(n!=t.length)throw new Error("'unpack' error. Mismatch between symbol and string length. "+n+":"+t.length);if("<"==e[0])a=!0;else{if(">"!=e[0])throw new Error("'unpack' error.");a=!1}for(var r=[],o=0,l=1,s=null,m=null,p=null,y="";m=e[l];){if("b"==m.toLowerCase())p=1,s=(y=t.slice(o,o+p)).charCodeAt(0),"b"==m&&s>=128&&(s-=256);else if("H"==m)p=2,y=t.slice(o,o+p),a&&(y=y.split("").reverse().join("")),s=256*y.charCodeAt(0)+y.charCodeAt(1);else{if("l"!=m.toLowerCase())throw new Error("'unpack' error. "+m);p=4,y=t.slice(o,o+p),a&&(y=y.split("").reverse().join("")),s=16777216*y.charCodeAt(0)+65536*y.charCodeAt(1)+256*y.charCodeAt(2)+y.charCodeAt(3),"l"==m&&s>=2147483648&&(s-=4294967296)}r.push(s),o+=p,l+=1}return r}function y(e,t){for(var a="",n=0;n<t;n++)a+=e;return a}function S(e){if("ÿØ"!=e.slice(0,2))throw new Error("Given data isn't JPEG.");for(var t=2,a=["ÿØ"];;){if("ÿÚ"==e.slice(t,t+2)){a.push(e.slice(t));break}var n=t+p(">H",e.slice(t+2,t+4))[0]+2;if(a.push(e.slice(t,n)),(t=n)>=e.length)throw new Error("Wrong JPEG data.")}return a}var f={Byte:1,Ascii:2,Short:3,Long:4,Rational:5,Undefined:7,SLong:9,SRational:10},c={Image:{11:{name:"ProcessingSoftware",type:"Ascii"},254:{name:"NewSubfileType",type:"Long"},255:{name:"SubfileType",type:"Short"},256:{name:"ImageWidth",type:"Long"},257:{name:"ImageLength",type:"Long"},258:{name:"BitsPerSample",type:"Short"},259:{name:"Compression",type:"Short"},262:{name:"PhotometricInterpretation",type:"Short"},263:{name:"Threshholding",type:"Short"},264:{name:"CellWidth",type:"Short"},265:{name:"CellLength",type:"Short"},266:{name:"FillOrder",type:"Short"},269:{name:"DocumentName",type:"Ascii"},270:{name:"ImageDescription",type:"Ascii"},271:{name:"Make",type:"Ascii"},272:{name:"Model",type:"Ascii"},273:{name:"StripOffsets",type:"Long"},274:{name:"Orientation",type:"Short"},277:{name:"SamplesPerPixel",type:"Short"},278:{name:"RowsPerStrip",type:"Long"},279:{name:"StripByteCounts",type:"Long"},282:{name:"XResolution",type:"Rational"},283:{name:"YResolution",type:"Rational"},284:{name:"PlanarConfiguration",type:"Short"},290:{name:"GrayResponseUnit",type:"Short"},291:{name:"GrayResponseCurve",type:"Short"},292:{name:"T4Options",type:"Long"},293:{name:"T6Options",type:"Long"},296:{name:"ResolutionUnit",type:"Short"},301:{name:"TransferFunction",type:"Short"},305:{name:"Software",type:"Ascii"},306:{name:"DateTime",type:"Ascii"},315:{name:"Artist",type:"Ascii"},316:{name:"HostComputer",type:"Ascii"},317:{name:"Predictor",type:"Short"},318:{name:"WhitePoint",type:"Rational"},319:{name:"PrimaryChromaticities",type:"Rational"},320:{name:"ColorMap",type:"Short"},321:{name:"HalftoneHints",type:"Short"},322:{name:"TileWidth",type:"Short"},323:{name:"TileLength",type:"Short"},324:{name:"TileOffsets",type:"Short"},325:{name:"TileByteCounts",type:"Short"},330:{name:"SubIFDs",type:"Long"},332:{name:"InkSet",type:"Short"},333:{name:"InkNames",type:"Ascii"},334:{name:"NumberOfInks",type:"Short"},336:{name:"DotRange",type:"Byte"},337:{name:"TargetPrinter",type:"Ascii"},338:{name:"ExtraSamples",type:"Short"},339:{name:"SampleFormat",type:"Short"},340:{name:"SMinSampleValue",type:"Short"},341:{name:"SMaxSampleValue",type:"Short"},342:{name:"TransferRange",type:"Short"},343:{name:"ClipPath",type:"Byte"},344:{name:"XClipPathUnits",type:"Long"},345:{name:"YClipPathUnits",type:"Long"},346:{name:"Indexed",type:"Short"},347:{name:"JPEGTables",type:"Undefined"},351:{name:"OPIProxy",type:"Short"},512:{name:"JPEGProc",type:"Long"},513:{name:"JPEGInterchangeFormat",type:"Long"},514:{name:"JPEGInterchangeFormatLength",type:"Long"},515:{name:"JPEGRestartInterval",type:"Short"},517:{name:"JPEGLosslessPredictors",type:"Short"},518:{name:"JPEGPointTransforms",type:"Short"},519:{name:"JPEGQTables",type:"Long"},520:{name:"JPEGDCTables",type:"Long"},521:{name:"JPEGACTables",type:"Long"},529:{name:"YCbCrCoefficients",type:"Rational"},530:{name:"YCbCrSubSampling",type:"Short"},531:{name:"YCbCrPositioning",type:"Short"},532:{name:"ReferenceBlackWhite",type:"Rational"},700:{name:"XMLPacket",type:"Byte"},18246:{name:"Rating",type:"Short"},18249:{name:"RatingPercent",type:"Short"},32781:{name:"ImageID",type:"Ascii"},33421:{name:"CFARepeatPatternDim",type:"Short"},33422:{name:"CFAPattern",type:"Byte"},33423:{name:"BatteryLevel",type:"Rational"},33432:{name:"Copyright",type:"Ascii"},33434:{name:"ExposureTime",type:"Rational"},34377:{name:"ImageResources",type:"Byte"},34665:{name:"ExifTag",type:"Long"},34675:{name:"InterColorProfile",type:"Undefined"},34853:{name:"GPSTag",type:"Long"},34857:{name:"Interlace",type:"Short"},34858:{name:"TimeZoneOffset",type:"Long"},34859:{name:"SelfTimerMode",type:"Short"},37387:{name:"FlashEnergy",type:"Rational"},37388:{name:"SpatialFrequencyResponse",type:"Undefined"},37389:{name:"Noise",type:"Undefined"},37390:{name:"FocalPlaneXResolution",type:"Rational"},37391:{name:"FocalPlaneYResolution",type:"Rational"},37392:{name:"FocalPlaneResolutionUnit",type:"Short"},37393:{name:"ImageNumber",type:"Long"},37394:{name:"SecurityClassification",type:"Ascii"},37395:{name:"ImageHistory",type:"Ascii"},37397:{name:"ExposureIndex",type:"Rational"},37398:{name:"TIFFEPStandardID",type:"Byte"},37399:{name:"SensingMethod",type:"Short"},40091:{name:"XPTitle",type:"Byte"},40092:{name:"XPComment",type:"Byte"},40093:{name:"XPAuthor",type:"Byte"},40094:{name:"XPKeywords",type:"Byte"},40095:{name:"XPSubject",type:"Byte"},50341:{name:"PrintImageMatching",type:"Undefined"},50706:{name:"DNGVersion",type:"Byte"},50707:{name:"DNGBackwardVersion",type:"Byte"},50708:{name:"UniqueCameraModel",type:"Ascii"},50709:{name:"LocalizedCameraModel",type:"Byte"},50710:{name:"CFAPlaneColor",type:"Byte"},50711:{name:"CFALayout",type:"Short"},50712:{name:"LinearizationTable",type:"Short"},50713:{name:"BlackLevelRepeatDim",type:"Short"},50714:{name:"BlackLevel",type:"Rational"},50715:{name:"BlackLevelDeltaH",type:"SRational"},50716:{name:"BlackLevelDeltaV",type:"SRational"},50717:{name:"WhiteLevel",type:"Short"},50718:{name:"DefaultScale",type:"Rational"},50719:{name:"DefaultCropOrigin",type:"Short"},50720:{name:"DefaultCropSize",type:"Short"},50721:{name:"ColorMatrix1",type:"SRational"},50722:{name:"ColorMatrix2",type:"SRational"},50723:{name:"CameraCalibration1",type:"SRational"},50724:{name:"CameraCalibration2",type:"SRational"},50725:{name:"ReductionMatrix1",type:"SRational"},50726:{name:"ReductionMatrix2",type:"SRational"},50727:{name:"AnalogBalance",type:"Rational"},50728:{name:"AsShotNeutral",type:"Short"},50729:{name:"AsShotWhiteXY",type:"Rational"},50730:{name:"BaselineExposure",type:"SRational"},50731:{name:"BaselineNoise",type:"Rational"},50732:{name:"BaselineSharpness",type:"Rational"},50733:{name:"BayerGreenSplit",type:"Long"},50734:{name:"LinearResponseLimit",type:"Rational"},50735:{name:"CameraSerialNumber",type:"Ascii"},50736:{name:"LensInfo",type:"Rational"},50737:{name:"ChromaBlurRadius",type:"Rational"},50738:{name:"AntiAliasStrength",type:"Rational"},50739:{name:"ShadowScale",type:"SRational"},50740:{name:"DNGPrivateData",type:"Byte"},50741:{name:"MakerNoteSafety",type:"Short"},50778:{name:"CalibrationIlluminant1",type:"Short"},50779:{name:"CalibrationIlluminant2",type:"Short"},50780:{name:"BestQualityScale",type:"Rational"},50781:{name:"RawDataUniqueID",type:"Byte"},50827:{name:"OriginalRawFileName",type:"Byte"},50828:{name:"OriginalRawFileData",type:"Undefined"},50829:{name:"ActiveArea",type:"Short"},50830:{name:"MaskedAreas",type:"Short"},50831:{name:"AsShotICCProfile",type:"Undefined"},50832:{name:"AsShotPreProfileMatrix",type:"SRational"},50833:{name:"CurrentICCProfile",type:"Undefined"},50834:{name:"CurrentPreProfileMatrix",type:"SRational"},50879:{name:"ColorimetricReference",type:"Short"},50931:{name:"CameraCalibrationSignature",type:"Byte"},50932:{name:"ProfileCalibrationSignature",type:"Byte"},50934:{name:"AsShotProfileName",type:"Byte"},50935:{name:"NoiseReductionApplied",type:"Rational"},50936:{name:"ProfileName",type:"Byte"},50937:{name:"ProfileHueSatMapDims",type:"Long"},50938:{name:"ProfileHueSatMapData1",type:"Float"},50939:{name:"ProfileHueSatMapData2",type:"Float"},50940:{name:"ProfileToneCurve",type:"Float"},50941:{name:"ProfileEmbedPolicy",type:"Long"},50942:{name:"ProfileCopyright",type:"Byte"},50964:{name:"ForwardMatrix1",type:"SRational"},50965:{name:"ForwardMatrix2",type:"SRational"},50966:{name:"PreviewApplicationName",type:"Byte"},50967:{name:"PreviewApplicationVersion",type:"Byte"},50968:{name:"PreviewSettingsName",type:"Byte"},50969:{name:"PreviewSettingsDigest",type:"Byte"},50970:{name:"PreviewColorSpace",type:"Long"},50971:{name:"PreviewDateTime",type:"Ascii"},50972:{name:"RawImageDigest",type:"Undefined"},50973:{name:"OriginalRawFileDigest",type:"Undefined"},50974:{name:"SubTileBlockSize",type:"Long"},50975:{name:"RowInterleaveFactor",type:"Long"},50981:{name:"ProfileLookTableDims",type:"Long"},50982:{name:"ProfileLookTableData",type:"Float"},51008:{name:"OpcodeList1",type:"Undefined"},51009:{name:"OpcodeList2",type:"Undefined"},51022:{name:"OpcodeList3",type:"Undefined"}},Exif:{33434:{name:"ExposureTime",type:"Rational"},33437:{name:"FNumber",type:"Rational"},34850:{name:"ExposureProgram",type:"Short"},34852:{name:"SpectralSensitivity",type:"Ascii"},34855:{name:"ISOSpeedRatings",type:"Short"},34856:{name:"OECF",type:"Undefined"},34864:{name:"SensitivityType",type:"Short"},34865:{name:"StandardOutputSensitivity",type:"Long"},34866:{name:"RecommendedExposureIndex",type:"Long"},34867:{name:"ISOSpeed",type:"Long"},34868:{name:"ISOSpeedLatitudeyyy",type:"Long"},34869:{name:"ISOSpeedLatitudezzz",type:"Long"},36864:{name:"ExifVersion",type:"Undefined"},36867:{name:"DateTimeOriginal",type:"Ascii"},36868:{name:"DateTimeDigitized",type:"Ascii"},37121:{name:"ComponentsConfiguration",type:"Undefined"},37122:{name:"CompressedBitsPerPixel",type:"Rational"},37377:{name:"ShutterSpeedValue",type:"SRational"},37378:{name:"ApertureValue",type:"Rational"},37379:{name:"BrightnessValue",type:"SRational"},37380:{name:"ExposureBiasValue",type:"SRational"},37381:{name:"MaxApertureValue",type:"Rational"},37382:{name:"SubjectDistance",type:"Rational"},37383:{name:"MeteringMode",type:"Short"},37384:{name:"LightSource",type:"Short"},37385:{name:"Flash",type:"Short"},37386:{name:"FocalLength",type:"Rational"},37396:{name:"SubjectArea",type:"Short"},37500:{name:"MakerNote",type:"Undefined"},37510:{name:"UserComment",type:"Ascii"},37520:{name:"SubSecTime",type:"Ascii"},37521:{name:"SubSecTimeOriginal",type:"Ascii"},37522:{name:"SubSecTimeDigitized",type:"Ascii"},40960:{name:"FlashpixVersion",type:"Undefined"},40961:{name:"ColorSpace",type:"Short"},40962:{name:"PixelXDimension",type:"Long"},40963:{name:"PixelYDimension",type:"Long"},40964:{name:"RelatedSoundFile",type:"Ascii"},40965:{name:"InteroperabilityTag",type:"Long"},41483:{name:"FlashEnergy",type:"Rational"},41484:{name:"SpatialFrequencyResponse",type:"Undefined"},41486:{name:"FocalPlaneXResolution",type:"Rational"},41487:{name:"FocalPlaneYResolution",type:"Rational"},41488:{name:"FocalPlaneResolutionUnit",type:"Short"},41492:{name:"SubjectLocation",type:"Short"},41493:{name:"ExposureIndex",type:"Rational"},41495:{name:"SensingMethod",type:"Short"},41728:{name:"FileSource",type:"Undefined"},41729:{name:"SceneType",type:"Undefined"},41730:{name:"CFAPattern",type:"Undefined"},41985:{name:"CustomRendered",type:"Short"},41986:{name:"ExposureMode",type:"Short"},41987:{name:"WhiteBalance",type:"Short"},41988:{name:"DigitalZoomRatio",type:"Rational"},41989:{name:"FocalLengthIn35mmFilm",type:"Short"},41990:{name:"SceneCaptureType",type:"Short"},41991:{name:"GainControl",type:"Short"},41992:{name:"Contrast",type:"Short"},41993:{name:"Saturation",type:"Short"},41994:{name:"Sharpness",type:"Short"},41995:{name:"DeviceSettingDescription",type:"Undefined"},41996:{name:"SubjectDistanceRange",type:"Short"},42016:{name:"ImageUniqueID",type:"Ascii"},42032:{name:"CameraOwnerName",type:"Ascii"},42033:{name:"BodySerialNumber",type:"Ascii"},42034:{name:"LensSpecification",type:"Rational"},42035:{name:"LensMake",type:"Ascii"},42036:{name:"LensModel",type:"Ascii"},42037:{name:"LensSerialNumber",type:"Ascii"},42240:{name:"Gamma",type:"Rational"}},GPS:{0:{name:"GPSVersionID",type:"Byte"},1:{name:"GPSLatitudeRef",type:"Ascii"},2:{name:"GPSLatitude",type:"Rational"},3:{name:"GPSLongitudeRef",type:"Ascii"},4:{name:"GPSLongitude",type:"Rational"},5:{name:"GPSAltitudeRef",type:"Byte"},6:{name:"GPSAltitude",type:"Rational"},7:{name:"GPSTimeStamp",type:"Rational"},8:{name:"GPSSatellites",type:"Ascii"},9:{name:"GPSStatus",type:"Ascii"},10:{name:"GPSMeasureMode",type:"Ascii"},11:{name:"GPSDOP",type:"Rational"},12:{name:"GPSSpeedRef",type:"Ascii"},13:{name:"GPSSpeed",type:"Rational"},14:{name:"GPSTrackRef",type:"Ascii"},15:{name:"GPSTrack",type:"Rational"},16:{name:"GPSImgDirectionRef",type:"Ascii"},17:{name:"GPSImgDirection",type:"Rational"},18:{name:"GPSMapDatum",type:"Ascii"},19:{name:"GPSDestLatitudeRef",type:"Ascii"},20:{name:"GPSDestLatitude",type:"Rational"},21:{name:"GPSDestLongitudeRef",type:"Ascii"},22:{name:"GPSDestLongitude",type:"Rational"},23:{name:"GPSDestBearingRef",type:"Ascii"},24:{name:"GPSDestBearing",type:"Rational"},25:{name:"GPSDestDistanceRef",type:"Ascii"},26:{name:"GPSDestDistance",type:"Rational"},27:{name:"GPSProcessingMethod",type:"Undefined"},28:{name:"GPSAreaInformation",type:"Undefined"},29:{name:"GPSDateStamp",type:"Ascii"},30:{name:"GPSDifferential",type:"Short"},31:{name:"GPSHPositioningError",type:"Rational"}},Interop:{1:{name:"InteroperabilityIndex",type:"Ascii"}}};c["0th"]=c.Image,c["1st"]=c.Image,e.TAGS=c,e.ImageIFD={ProcessingSoftware:11,NewSubfileType:254,SubfileType:255,ImageWidth:256,ImageLength:257,BitsPerSample:258,Compression:259,PhotometricInterpretation:262,Threshholding:263,CellWidth:264,CellLength:265,FillOrder:266,DocumentName:269,ImageDescription:270,Make:271,Model:272,StripOffsets:273,Orientation:274,SamplesPerPixel:277,RowsPerStrip:278,StripByteCounts:279,XResolution:282,YResolution:283,PlanarConfiguration:284,GrayResponseUnit:290,GrayResponseCurve:291,T4Options:292,T6Options:293,ResolutionUnit:296,TransferFunction:301,Software:305,DateTime:306,Artist:315,HostComputer:316,Predictor:317,WhitePoint:318,PrimaryChromaticities:319,ColorMap:320,HalftoneHints:321,TileWidth:322,TileLength:323,TileOffsets:324,TileByteCounts:325,SubIFDs:330,InkSet:332,InkNames:333,NumberOfInks:334,DotRange:336,TargetPrinter:337,ExtraSamples:338,SampleFormat:339,SMinSampleValue:340,SMaxSampleValue:341,TransferRange:342,ClipPath:343,XClipPathUnits:344,YClipPathUnits:345,Indexed:346,JPEGTables:347,OPIProxy:351,JPEGProc:512,JPEGInterchangeFormat:513,JPEGInterchangeFormatLength:514,JPEGRestartInterval:515,JPEGLosslessPredictors:517,JPEGPointTransforms:518,JPEGQTables:519,JPEGDCTables:520,JPEGACTables:521,YCbCrCoefficients:529,YCbCrSubSampling:530,YCbCrPositioning:531,ReferenceBlackWhite:532,XMLPacket:700,Rating:18246,RatingPercent:18249,ImageID:32781,CFARepeatPatternDim:33421,CFAPattern:33422,BatteryLevel:33423,Copyright:33432,ExposureTime:33434,ImageResources:34377,ExifTag:34665,InterColorProfile:34675,GPSTag:34853,Interlace:34857,TimeZoneOffset:34858,SelfTimerMode:34859,FlashEnergy:37387,SpatialFrequencyResponse:37388,Noise:37389,FocalPlaneXResolution:37390,FocalPlaneYResolution:37391,FocalPlaneResolutionUnit:37392,ImageNumber:37393,SecurityClassification:37394,ImageHistory:37395,ExposureIndex:37397,TIFFEPStandardID:37398,SensingMethod:37399,XPTitle:40091,XPComment:40092,XPAuthor:40093,XPKeywords:40094,XPSubject:40095,PrintImageMatching:50341,DNGVersion:50706,DNGBackwardVersion:50707,UniqueCameraModel:50708,LocalizedCameraModel:50709,CFAPlaneColor:50710,CFALayout:50711,LinearizationTable:50712,BlackLevelRepeatDim:50713,BlackLevel:50714,BlackLevelDeltaH:50715,BlackLevelDeltaV:50716,WhiteLevel:50717,DefaultScale:50718,DefaultCropOrigin:50719,DefaultCropSize:50720,ColorMatrix1:50721,ColorMatrix2:50722,CameraCalibration1:50723,CameraCalibration2:50724,ReductionMatrix1:50725,ReductionMatrix2:50726,AnalogBalance:50727,AsShotNeutral:50728,AsShotWhiteXY:50729,BaselineExposure:50730,BaselineNoise:50731,BaselineSharpness:50732,BayerGreenSplit:50733,LinearResponseLimit:50734,CameraSerialNumber:50735,LensInfo:50736,ChromaBlurRadius:50737,AntiAliasStrength:50738,ShadowScale:50739,DNGPrivateData:50740,MakerNoteSafety:50741,CalibrationIlluminant1:50778,CalibrationIlluminant2:50779,BestQualityScale:50780,RawDataUniqueID:50781,OriginalRawFileName:50827,OriginalRawFileData:50828,ActiveArea:50829,MaskedAreas:50830,AsShotICCProfile:50831,AsShotPreProfileMatrix:50832,CurrentICCProfile:50833,CurrentPreProfileMatrix:50834,ColorimetricReference:50879,CameraCalibrationSignature:50931,ProfileCalibrationSignature:50932,AsShotProfileName:50934,NoiseReductionApplied:50935,ProfileName:50936,ProfileHueSatMapDims:50937,ProfileHueSatMapData1:50938,ProfileHueSatMapData2:50939,ProfileToneCurve:50940,ProfileEmbedPolicy:50941,ProfileCopyright:50942,ForwardMatrix1:50964,ForwardMatrix2:50965,PreviewApplicationName:50966,PreviewApplicationVersion:50967,PreviewSettingsName:50968,PreviewSettingsDigest:50969,PreviewColorSpace:50970,PreviewDateTime:50971,RawImageDigest:50972,OriginalRawFileDigest:50973,SubTileBlockSize:50974,RowInterleaveFactor:50975,ProfileLookTableDims:50981,ProfileLookTableData:50982,OpcodeList1:51008,OpcodeList2:51009,OpcodeList3:51022,NoiseProfile:51041},e.ExifIFD={ExposureTime:33434,FNumber:33437,ExposureProgram:34850,SpectralSensitivity:34852,ISOSpeedRatings:34855,OECF:34856,SensitivityType:34864,StandardOutputSensitivity:34865,RecommendedExposureIndex:34866,ISOSpeed:34867,ISOSpeedLatitudeyyy:34868,ISOSpeedLatitudezzz:34869,ExifVersion:36864,DateTimeOriginal:36867,DateTimeDigitized:36868,ComponentsConfiguration:37121,CompressedBitsPerPixel:37122,ShutterSpeedValue:37377,ApertureValue:37378,BrightnessValue:37379,ExposureBiasValue:37380,MaxApertureValue:37381,SubjectDistance:37382,MeteringMode:37383,LightSource:37384,Flash:37385,FocalLength:37386,SubjectArea:37396,MakerNote:37500,UserComment:37510,SubSecTime:37520,SubSecTimeOriginal:37521,SubSecTimeDigitized:37522,FlashpixVersion:40960,ColorSpace:40961,PixelXDimension:40962,PixelYDimension:40963,RelatedSoundFile:40964,InteroperabilityTag:40965,FlashEnergy:41483,SpatialFrequencyResponse:41484,FocalPlaneXResolution:41486,FocalPlaneYResolution:41487,FocalPlaneResolutionUnit:41488,SubjectLocation:41492,ExposureIndex:41493,SensingMethod:41495,FileSource:41728,SceneType:41729,CFAPattern:41730,CustomRendered:41985,ExposureMode:41986,WhiteBalance:41987,DigitalZoomRatio:41988,FocalLengthIn35mmFilm:41989,SceneCaptureType:41990,GainControl:41991,Contrast:41992,Saturation:41993,Sharpness:41994,DeviceSettingDescription:41995,SubjectDistanceRange:41996,ImageUniqueID:42016,CameraOwnerName:42032,BodySerialNumber:42033,LensSpecification:42034,LensMake:42035,LensModel:42036,LensSerialNumber:42037,Gamma:42240},e.GPSIFD={GPSVersionID:0,GPSLatitudeRef:1,GPSLatitude:2,GPSLongitudeRef:3,GPSLongitude:4,GPSAltitudeRef:5,GPSAltitude:6,GPSTimeStamp:7,GPSSatellites:8,GPSStatus:9,GPSMeasureMode:10,GPSDOP:11,GPSSpeedRef:12,GPSSpeed:13,GPSTrackRef:14,GPSTrack:15,GPSImgDirectionRef:16,GPSImgDirection:17,GPSMapDatum:18,GPSDestLatitudeRef:19,GPSDestLatitude:20,GPSDestLongitudeRef:21,GPSDestLongitude:22,GPSDestBearingRef:23,GPSDestBearing:24,GPSDestDistanceRef:25,GPSDestDistance:26,GPSProcessingMethod:27,GPSAreaInformation:28,GPSDateStamp:29,GPSDifferential:30,GPSHPositioningError:31},e.InteropIFD={InteroperabilityIndex:1},e.GPSHelper={degToDmsRational:function(e){var t=Math.abs(e),a=t%1*60,n=a%1*60;return[[Math.floor(t),1],[Math.floor(a),1],[Math.round(100*n),100]]},dmsRationalToDeg:function(e,t){var a="S"===t||"W"===t?-1:1;return(e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600)*a}},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=e),exports.piexif=e):window.piexif=e}();
package/package.json CHANGED
@@ -1,32 +1,26 @@
1
1
  {
2
2
  "name": "accurafaceplugin",
3
- "version": "1.0.20",
4
- "description": "",
5
- "main": "./src/accura.js",
3
+ "version": "1.0.21",
4
+
5
+ "main": "./dist/accuramain.js",
6
+ "module": "./dist/accuramain.js",
7
+
6
8
  "scripts": {
7
- "build": "terser ./src/accura.js -o build/accuramain.js --compress --mangle reserved=['video','canvas','context'] --source-map"
9
+ "build": "webpack --mode production",
10
+ "publish:npm": "npm publish --access public"
8
11
  },
12
+
9
13
  "files": [
10
- "build/accuramain.js",
11
- "./accuraface1.js",
12
- "./accuraface2.js",
13
- "./public",
14
- "./accura.xml"
14
+ "dist"
15
15
  ],
16
- "keywords": [],
17
- "author": "",
18
- "license": "ISC",
16
+
19
17
  "devDependencies": {
20
18
  "@babel/core": "^7.25.2",
21
19
  "@babel/preset-env": "^7.25.4",
22
20
  "babel-loader": "^9.2.1",
23
- "file-loader": "^6.2.0",
24
- "raw-loader": "^4.0.2",
25
- "terser": "^5.34.1",
21
+ "copy-webpack-plugin": "^12.0.2",
22
+ "terser-webpack-plugin": "^5.3.10",
26
23
  "webpack": "^5.95.0",
27
24
  "webpack-cli": "^5.1.4"
28
- },
29
- "dependencies": {
30
- "accurafaceplugin": "^1.0.19"
31
25
  }
32
- }
26
+ }
package/accuraface2.js DELETED
@@ -1,267 +0,0 @@
1
- function Utils(errorOutputId) {
2
- // eslint-disable-line no-unused-vars
3
- let self = this;
4
- this.errorOutput = document.getElementById(errorOutputId);
5
- this.apiKey = "168508101488d7JV8yvF32yRGRti0hyatBHFwev0KInaUAgtGv";
6
-
7
- const OPENCV_URL = "opencv.js";
8
- this.loadOpenCv = function (onloadCallback) {
9
- let script = document.createElement("script");
10
- script.setAttribute("async", "");
11
- script.setAttribute("type", "text/javascript");
12
- script.addEventListener("load", () => {
13
- if (cv.getBuildInformation) {
14
- console.log(cv.getBuildInformation());
15
- onloadCallback();
16
- } else {
17
- // WASM
18
- cv["onRuntimeInitialized"] = () => {
19
- console.log(cv.getBuildInformation());
20
- onloadCallback();
21
- };
22
- }
23
- });
24
- script.addEventListener("error", () => {
25
- self.printError("Failed to load " + OPENCV_URL);
26
- });
27
- script.src = OPENCV_URL;
28
- let node = document.getElementsByTagName("script")[0];
29
- node.parentNode.insertBefore(script, node);
30
- };
31
-
32
- this.createFileFromUrl = function (path, url, callback) {
33
- let request = new XMLHttpRequest();
34
- request.open("GET", url, true);
35
- request.responseType = "arraybuffer";
36
- request.onload = function (ev) {
37
- if (request.readyState === 4) {
38
- if (request.status === 200) {
39
- let data = new Uint8Array(request.response);
40
- cv.FS_createDataFile("/", path, data, true, false, false);
41
- callback();
42
- } else {
43
- self.printError(
44
- "Failed to load " + url + " status: " + request.status
45
- );
46
- }
47
- }
48
- };
49
- request.send();
50
- };
51
-
52
- this.loadImageToCanvas = function (url, cavansId) {
53
- let canvas = document.getElementById(cavansId);
54
- let ctx = canvas.getContext("2d");
55
- let img = new Image();
56
- img.crossOrigin = "anonymous";
57
- img.onload = function () {
58
- canvas.width = img.width;
59
- canvas.height = img.height;
60
- ctx.drawImage(img, 0, 0, img.width, img.height);
61
- };
62
- img.src = url;
63
- };
64
-
65
- this.executeCode = function (textAreaId) {
66
- try {
67
- this.clearError();
68
- let code = document.getElementById(textAreaId).value;
69
- eval(code);
70
- } catch (err) {
71
- this.printError(err);
72
- }
73
- };
74
-
75
- this.clearError = function () {
76
- this.errorOutput.innerHTML = "";
77
- };
78
-
79
- this.printError = function (err) {
80
- if (typeof err === "undefined") {
81
- err = "";
82
- } else if (typeof err === "number") {
83
- if (!isNaN(err)) {
84
- if (typeof cv !== "undefined") {
85
- err = "Exception: " + cv.exceptionFromPtr(err).msg;
86
- }
87
- }
88
- } else if (typeof err === "string") {
89
- let ptr = Number(err.split(" ")[0]);
90
- if (!isNaN(ptr)) {
91
- if (typeof cv !== "undefined") {
92
- err = "Exception: " + cv.exceptionFromPtr(ptr).msg;
93
- }
94
- }
95
- } else if (err instanceof Error) {
96
- err = err.stack.replace(/\n/g, "<br>");
97
- }
98
- this.errorOutput.innerHTML = err;
99
- };
100
-
101
- this.loadCode = function (scriptId, textAreaId) {
102
- let scriptNode = document.getElementById(scriptId);
103
- let textArea = document.getElementById(textAreaId);
104
- if (scriptNode.type !== "text/code-snippet") {
105
- throw Error("Unknown code snippet type");
106
- }
107
- textArea.value = scriptNode.text.replace(/^\n/, "");
108
- };
109
-
110
- this.addFileInputHandler = function (fileInputId, canvasId) {
111
- let inputElement = document.getElementById(fileInputId);
112
- inputElement.addEventListener(
113
- "change",
114
- (e) => {
115
- let files = e.target.files;
116
- if (files.length > 0) {
117
- let imgUrl = URL.createObjectURL(files[0]);
118
- self.loadImageToCanvas(imgUrl, canvasId);
119
- }
120
- },
121
- false
122
- );
123
- };
124
-
125
- function onVideoCanPlay() {
126
- if (self.onCameraStartedCallback) {
127
- self.onCameraStartedCallback(self.stream, self.video);
128
- }
129
- }
130
-
131
- this.startCamera = function (resolution, callback, videoId) {
132
- const constraints = {
133
- qvga: { width: { exact: 320 }, height: { exact: 240 } },
134
- vga: { width: { exact: 640 }, height: { exact: 480 } },
135
- };
136
- let video = document.getElementById(videoId);
137
- if (!video) {
138
- video = document.createElement("video");
139
- }
140
-
141
- let videoConstraint = constraints[resolution];
142
- if (!videoConstraint) {
143
- videoConstraint = true;
144
- }
145
-
146
- navigator.mediaDevices
147
- .getUserMedia({ video: videoConstraint, audio: false })
148
- .then(function (stream) {
149
- video.srcObject = stream;
150
- video.play();
151
- self.video = video;
152
- self.stream = stream;
153
- self.onCameraStartedCallback = callback;
154
- video.addEventListener("canplay", onVideoCanPlay, false);
155
- })
156
- .catch(function (err) {
157
- self.printError("Camera Error: " + err.name + " " + err.message);
158
- });
159
- };
160
-
161
- this.stopCamera = function () {
162
- if (this.video) {
163
- this.video.pause();
164
- this.video.srcObject = null;
165
- this.video.removeEventListener("canplay", onVideoCanPlay);
166
- }
167
- if (this.stream) {
168
- this.stream.getVideoTracks()[0].stop();
169
- }
170
- };
171
-
172
- this.captureImage = function (canvasId) {
173
- let canvas = document.getElementById(canvasId);
174
- let dataUrl = canvas.toDataURL("image/jpeg");
175
- return dataUrl;
176
- };
177
-
178
- this.stringFunction = function (dynamicString) {
179
- console.log("Dynamic string:", dynamicString);
180
-
181
- document.getElementById("status-text").innerText = dynamicString;
182
- };
183
-
184
- this.captureAndSend = function () {
185
- let video = document.getElementById("cam_input");
186
- let canvas = document.getElementById("canvas_output");
187
-
188
- // Hide the video and show the canvas after capturing the photo
189
- video.style.display = "none";
190
- canvas.style.display = "block";
191
- isCanvasVisible = true;
192
-
193
- // Create a canvas element to temporarily hold the image data
194
- let tempCanvas = document.createElement("canvas");
195
- tempCanvas.width = video.videoWidth;
196
- tempCanvas.height = video.videoHeight;
197
- let ctx = tempCanvas.getContext("2d");
198
- ctx.drawImage(video, 0, 0, tempCanvas.width, tempCanvas.height);
199
-
200
- // Draw the oval shape on the temporary canvas
201
- ctx.save();
202
- ctx.beginPath();
203
- ctx.moveTo(tempCanvas.width / 2, 0);
204
- ctx.bezierCurveTo(
205
- tempCanvas.width,
206
- 0,
207
- tempCanvas.width,
208
- tempCanvas.height,
209
- tempCanvas.width / 2,
210
- tempCanvas.height
211
- );
212
- ctx.bezierCurveTo(0, tempCanvas.height, 0, 0, tempCanvas.width / 2, 0);
213
- ctx.clip();
214
- ctx.drawImage(tempCanvas, 0, 0);
215
- ctx.restore();
216
-
217
- let imageDataUrl = tempCanvas.toDataURL("image/jpeg");
218
-
219
- // // Check if imageDataUrl is valid
220
- // if (!imageDataUrl) {
221
- // console.error("Invalid imageDataUrl");
222
- // return;
223
- // }
224
-
225
- // // Send the captured image to the API
226
- // fetch("https://accurascan.com/v2/api/liveness", {
227
- // method: "POST",
228
- // headers: {
229
- // "Api-Key": self.apiKey,
230
- // "Content-Type": "application/json",
231
- // },
232
- // body: JSON.stringify({
233
- // liveness_image: imageDataUrl,
234
- // }),
235
- // })
236
- // .then((response) => {
237
- // // Check if the response is successful (status code 2xx)
238
- // if (!response.ok) {
239
- // throw new Error(
240
- // `Network response was not ok, status: ${response.status}`
241
- // );
242
- // }
243
- // return response.json(); // Parse response body as JSON
244
- // })
245
- // .then(function (data) {
246
- // console.log("API response:", data);
247
-
248
- // // Check the "status" property in the data object and display appropriate messages
249
- // if (data.status === true) {
250
- // self.stringFunction(
251
- // "Face detected! Quality: " +
252
- // data.data.quality +
253
- // ", Score: " +
254
- // data.data.score
255
- // );
256
- // //When face is detected
257
- // } else {
258
- // self.stringFunction("No face detected or other status");
259
- // // When no face is detected or handle other status scenarios if needed
260
- // }
261
- // })
262
- // .catch((error) => {
263
- // console.error("Error sending image to API:", error);
264
- // self.stringFunction("Error sending image to API");
265
- // });
266
- };
267
- }
@@ -1 +0,0 @@
1
- export default class FacePlugin{constructor(e,t,{threshold:n,textSize:i,textColor:s,textWeight:o,textBgColor:a,BodyBgColor:c,piexifUrl:d="/libs/piexif.js",audioUrl:r="/ding.mp3"}){this.haarcascadeUrl=e,this.faceDetectionCount=0,this.onResultReceived=t,this.FPS=30,this.ZOOM_FACTOR=1.5,this.lastFaceDetectionTime=Date.now(),this.opencvLoaded=!1,this.faceThreshold=n,this.instructSize=i,this.instructColor=s,this.instructWeight=o,this.instructBgColor=a,this.bgcolor=c,this.createUI(),this.addStyles(),this.video=document.getElementById("videoInput"),this.canvas=document.getElementById("canvasOutput"),this.instructionText=document.getElementById("instructionText"),this.loader=document.getElementById("loader");const h=document.createElement("script");h.src=d,document.head.appendChild(h),this.ding=new Audio(r),this.ding.preload="auto",this.audioUnlocked=!1,this.ding.muted=!0;const l=()=>{this.audioUnlocked||(this.ding.play().then((()=>{this.ding.pause(),this.ding.currentTime=0,this.ding.muted=!1,this.audioUnlocked=!0})).catch((()=>{})),document.removeEventListener("click",l))};document.addEventListener("click",l,{once:!0}),this.checkOpenCV()}createUI(){const e=document.createElement("div");e.className="accuraContainerBox";const t=document.createElement("div");t.className="camera-input",t.style.position="relative",this.cameraInput=t;const video=document.createElement("video");video.id="videoInput",video.width=640,video.height=480,video.autoplay=!0,video.muted=!0;const canvas=document.createElement("canvas");canvas.id="canvasOutput",canvas.style.display="none";const n=document.createElement("div");n.id="loader",n.className="loader",n.style.display="none";const i=document.createElement("p");i.id="instructionText",t.appendChild(video),t.appendChild(canvas),t.appendChild(n),e.appendChild(t),e.appendChild(i),document.body.appendChild(e)}checkOpenCV(){const e=()=>{window.cv?(this.opencvLoaded=!0,this.openCvReady()):setTimeout(e,100)};e()}openCvReady(){navigator.mediaDevices.getUserMedia({video:!0,audio:!1}).then((e=>{this.video.srcObject=e,this.video.play(),this.isCanvasVisible=!1,this.video.addEventListener("loadedmetadata",(()=>{if(this.video.videoWidth&&this.video.videoHeight){this.video.width=this.video.videoWidth,this.video.height=this.video.videoHeight,this.canvas.width=this.video.videoWidth,this.canvas.height=this.video.videoHeight;const e=new window.cv.Mat(this.video.videoHeight,this.video.videoWidth,window.cv.CV_8UC4),t=new window.cv.Mat(this.video.videoHeight,this.video.videoWidth,window.cv.CV_8UC4),n=new window.cv.VideoCapture(this.video),i=new window.cv.CascadeClassifier,s=new window.Utils("errorMessage"),o=this.haarcascadeUrl;s.createFileFromUrl(o,o,(()=>{i.load(o),this.facepluginopencv(n,e,t,i)}))}}))})).catch((e=>{console.error("An error occurred while accessing media devices: ",e)}))}isFaceInsideOval(e,canvas){const t=canvas.width/2,n=canvas.height/2,i=canvas.width/2,s=canvas.height/2;return(e.x+e.width/2-t)**2/i**2+(e.y+e.height/2-n)**2/s**2<=1}facepluginopencv(e,t,n,i){const s=Date.now();e.read(t);const o=new window.cv.Rect(t.cols/2-t.cols/(2*this.ZOOM_FACTOR),t.rows/2-t.rows/(2*this.ZOOM_FACTOR),t.cols/this.ZOOM_FACTOR,t.rows/this.ZOOM_FACTOR);let a=t.roi(o);window.cv.resize(a,n,new window.cv.Size(t.cols,t.rows),0,0,window.cv.INTER_LINEAR),this.instructionText.textContent="Keep Your Face In The Frame";let c=new window.cv.RectVector;try{if(i.detectMultiScale(t,c,1.5,3,0),1===c.size()){const e=c.get(0),n=(new window.cv.Rect(e.x,e.y,e.width,e.height),.14);let i=Math.max(0,e.x-e.width*n),s=Math.max(0,e.y-e.height*n),o=Math.min(t.cols-i,e.width*(1+2*n)),a=Math.min(t.rows-s,e.height*(1+2*n));const d=new window.cv.Rect(i,s,o,a);window.cv.rectangle(t,new window.cv.Point(d.x,d.y),new window.cv.Point(d.x+d.width,d.y+d.height),[5,255,0,255],2);const r=e.width*e.height,h=r/(Math.PI*(this.canvas.width/2)*(this.canvas.height/2))*100;if(this.isFaceInsideOval(e,this.canvas)){if(h<30)this.instructionText.textContent="Stay closer to the window";else if(h>=30&&h<=100&&(this.instructionText.textContent="Processing....",this.faceDetectionCount++,this.faceDetectionCount===this.faceThreshold)){const e=document.createElement("div");return e.id="faceScanSuccess",e.innerHTML='\n <div class="scan-success-wrapper">\n \x3c!-- Viewfinder frame (your provided paths, scaled up a bit for better visibility) --\x3e\n <svg class="face-viewfinder" width="120" height="120" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M8 18V8h10" stroke="#ffffff" stroke-width="5" stroke-linecap="round"/>\n <path d="M46 8h10v10" stroke="#ffffff" stroke-width="5" stroke-linecap="round"/>\n <path d="M56 46v10H46" stroke="#ffffff" stroke-width="5" stroke-linecap="round"/>\n <path d="M18 56H8V46" stroke="#ffffff" stroke-width="5" stroke-linecap="round"/>\n \x3c!-- Face representation (small circle + smile) --\x3e\n <circle cx="32" cy="26" r="9" stroke="#ffffff" stroke-width="4" fill="none"/>\n <path d="M22 42c4-8 16-8 20 0" stroke="#ffffff" stroke-width="4" stroke-linecap="round" fill="none"/>\n </svg>\n\n \x3c!-- Black checkmark overlay (appears on success) --\x3e\n <svg class="success-tick" viewBox="0 0 52 52" width="80" height="80">\n <path \n d="M14.1 27.2 L21.2 34.4 L37.9 17.6" \n stroke="green" \n stroke-width="6" \n stroke-linecap="round" \n stroke-linejoin="round" \n fill="none"\n />\n </svg>\n </div>\n',Object.assign(e.style,{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:"200",pointerEvents:"none",textAlign:"center"}),this.cameraInput.appendChild(e),setTimeout((()=>e.remove()),1500),this.audioUnlocked&&(this.ding.currentTime=0,this.ding.play().catch((()=>{}))),void setTimeout((()=>{this.convertToBase64WithMetadata(d);const e=this.video.srcObject;e&&e.getTracks().forEach((e=>e.stop()))}),1500)}}else this.instructionText.textContent="Move inside the oval window";this.lastFaceDetectionTime=Date.now()}}catch(e){console.error("Error processing video:",e)}finally{c.delete()}this.isCanvasVisible&&(window.cv.flip(t,t,1),window.cv.imshow(this.canvas.id,t));const d=1e3/this.FPS-(Date.now()-s);setTimeout((()=>this.facepluginopencv(e,t,n,i)),d)}convertToBase64WithMetadata(e){const t=document.createElement("canvas");t.width=this.video.videoWidth,t.height=this.video.videoHeight;const n=t.getContext("2d");n.drawImage(this.video,0,0,t.width,t.height);const i=document.createElement("canvas");i.width=e.width,i.height=e.height;const s=i.getContext("2d"),o=n.getImageData(e.x,e.y,e.width,e.height);s.putImageData(o,0,0);const a={"0th":{[piexif.ImageIFD.Make]:"AccuraFace",[piexif.ImageIFD.Model]:"FaceDetectionCamera"}},c=piexif.dump(a),d=piexif.insert(c,i.toDataURL("image/jpeg",.92));this.onResultReceived&&(document.querySelector(".accuraContainerBox").style.display="none",this.onResultReceived({base64:d,metadata:a}))}addStyles(){const e=`\n body {\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100vh;\n margin: 0;\n background-color: ${this.bgcolor||"rgb(255, 255, 255)"};\n font-family: Arial, sans-serif;\n flex-direction: column;\n }\n \n .accuraContainerBox {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 20px;\n background-color: transparent;\n border-radius: 10px;\n }\n \n #instructionText {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 10px;\n background-color: ${this.instructBgColor||"#fff"};\n color: ${this.instructColor||"rgb(10, 18, 131)"};\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);\n border-radius: 5px;\n margin-bottom: 20px;\n font-size: ${this.instructSize||"30px"};\n font-weight: ${this.instructWeight||"bold"};\n }\n \n .camera-input {\n width: 250px;\n height: 370px;\n position: relative;\n overflow: hidden;\n border-radius: 50%;\n transform: scale(1.0); \n }\n \n #videoInput {\n width: 100%;\n height: 100%;\n object-fit: cover;\n transition: transform 0.3s ease-in-out;\n transform: scaleX(-1) scale(1.5); \n }\n \n #canvasOutput {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n transform: scale(1.5);\n }\n \n #response-text {\n font-size: 18px;\n color: #333;\n margin-top: 10px;\n }\n\n/* Desktop (default) */\n\n /* Laptop */\n @media (max-width: 1200px) {\n #instructionText {\n font-size: ${this.instructSize||"28px"};\n }\n }\n\n /* iPad / Tablet */\n @media (max-width: 992px) {\n #instructionText {\n font-size: ${this.instructSize||"28px"};\n }\n }\n\n /* Mobile */\n @media (max-width: 768px) {\n #instructionText {\n font-size: 25px;\n }\n }\n\n /* Small Mobile (Extra Small Devices) */\n @media (max-width: 480px) {\n #instructionText {\n font-size: ${this.instructSize||"18px"};\n }\n }\n\n .scan-success-wrapper {\n position: relative;\n width: 140px;\n height: 140px;\n margin: 0 auto;\n}\n\n.face-viewfinder {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n opacity: 0.9;\n animation: pulseFrame 2s ease-in-out forwards;\n}\n\n.success-tick {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%) scale(0.6);\n opacity: 0;\n z-index: 2;\n animation: tickReveal 1.1s ease-out 0.4s forwards;\n}\n\n/* Animations */\n@keyframes pulseFrame {\n 0% { opacity: 0.6; transform: translate(-50%, -50%) scale(0.92); }\n 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }\n 100% { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }\n}\n\n@keyframes tickReveal {\n 0% { \n transform: translate(-50%, -50%) scale(0.4); \n opacity: 0; \n stroke-dashoffset: 60; \n }\n 40% { \n transform: translate(-50%, -50%) scale(1.15); \n opacity: 1; \n }\n 70% { transform: translate(-50%, -50%) scale(0.95); }\n 100% { \n transform: translate(-50%, -50%) scale(1); \n opacity: 1; \n stroke-dashoffset: 0; \n }\n}\n\n/* Add stroke-dasharray to the tick path via JS or CSS for draw effect */\n.success-tick path {\n stroke-dasharray: 60;\n stroke-dashoffset: 60;\n animation: drawTick 0.8s ease-out 0.5s forwards;\n}\n\n@keyframes drawTick {\n to { stroke-dashoffset: 0; }\n}\n `,t=document.createElement("style");t.type="text/css",t.innerText=e,document.head.appendChild(t)}}