{"version":3,"sources":["webpack:///js/comment.js","webpack:///./mobile/src/router/comment.js","webpack:///./mobile/src/js/comment.js","webpack:///./mobile/src/js/upload.js","webpack:///./mobile/src/js/useragent.js"],"names":["webpackJsonp","1","module","exports","__webpack_require__","10","$","on","this","parent","remove","15","_typeof","Symbol","iterator","obj","constructor","prototype","window","document","undefined","regist","mName","brickjs","Upload","selector","cfgs","url","params","useCanvas","size","limit","width","quality","error","errorMsg","overnum","invalidLarge","invalidSmall","invalidType","forbidden","autoUpload","uploadBtn","tpl","tplContainer","autoHide","onSelect","files","onUploading","onProgress","loaded","total","onSuccess","response","file","onFailure","msg","onDelete","onComplete","onError","extend","_init","BinaryFile","strData","iDataOffset","iDataLength","data","dataOffset","dataLength","getRawData","length","getByteAt","iOffset","charCodeAt","getBytesAt","iLength","aBytes","i","IEBinary_getLength","IEBinary_getByteAt","VBArray","IEBinary_getBytesAt","toArray","getLength","getSByteAt","iByte","getShortAt","bBigEndian","iShort","getSShortAt","iUShort","getLongAt","iByte1","iByte2","iByte3","iByte4","iLong","getSLongAt","iULong","getStringAt","aStr","j","String","fromCharCode","join","getCharAt","toBase64","btoa","fromBase64","strBase64","atob","BinaryAjax","createRequest","oHTTP","ActiveXObject","XMLHttpRequest","getHead","strURL","fncCallback","fncError","onload","status","onreadystatechange","readyState","open","send","sendRequest","aRange","bAcceptRanges","iFileSize","iDataLen","binaryResponse","responseText","fileSize","getResponseHeader","oRes","responseBody","overrideMimeType","setRequestHeader","iStart","iEnd","parseInt","strAcceptRanges","Plugin","options","methods","defaults","_defaults","_name","pluginName","init","newsize","w","h","W","H","C","c","r","height","cropped","dataURLtoBlob","mimeString","split","byteString","ab","ArrayBuffer","ia","Uint8Array","bb","BlobBuilder","WebKitBlobBuilder","MozBlobBuilder","append","getBlob","Blob","type","detectSubsampling","img","iw","canvas","createElement","ctx","getContext","drawImage","getImageData","rotate","orientation","angle","o","90","180","270","2","3","4","5","6","7","8","transformCoordinate","translate","scale","Math","PI","detectVerticalSquash","ih","sy","ey","py","ratio","callback","d","target","arguments","a","al","deep","Boolean","prop","crop","$this","reader","FileReader","onloadend","e","dataURL","result","binary","exif","EXIF","readFromBinaryFile","Image","save","tmpCanvas","tmpCtx","vertSquashRatio","sh","sx","sw","clearRect","dx","floor","dw","ceil","dy","dh","restore","newcanvas","x","y","toDataURL","src","readAsDataURL","imageHasData","exifdata","http","findEXIFinJPEG","call","marker","offset","debug","console","log","readEXIFData","readTags","tiffStart","dirStart","strings","bigEnd","entryOffset","tag","entries","tags","readTagValue","vals","val","n","numerator","denominator","numValues","valueOffset","Number","start","exifData","gpsData","tiffOffset","TiffTags","ExifIFDPointer","ExifTags","StringValues","Components","GPSInfoIFDPointer","GPSTags","getData","complete","getTag","getAllTags","hasOwnProperty","pretty","strPretty","36864","40960","40961","40962","40963","37121","37122","37500","37510","40964","36867","36868","37520","37521","37522","33434","33437","34850","34852","34855","34856","37377","37378","37379","37380","37381","37382","37383","37384","37385","37396","37386","41483","41484","41486","41487","41488","41492","41493","41495","41728","41729","41730","41985","41986","41987","41988","41989","41990","41991","41992","41993","41994","41995","41996","40965","42016","256","257","34665","34853","258","259","262","274","277","284","530","531","282","283","296","273","278","279","513","514","301","318","319","529","532","306","271","272","305","315","33432","0","9","11","12","13","14","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","ExposureProgram","MeteringMode","255","LightSource","Flash","31","32","65","69","71","73","77","79","89","93","95","SensingMethod","SceneCaptureType","SceneType","CustomRendered","WhiteBalance","GainControl","Contrast","Saturation","Sharpness","SubjectDistanceRange","FileSource","Tags","self","container","input","find","disabled","filesFilter","failFiles","count","compress","_bind","tempFiles","change","_showError","html","hide","push","tempFilesLen","each","index1","index2","pop","_filter","_createTpl","_upload","click","failure","css","filesArr","index","maxSize","parseFloat","fileName","name","indexOf","aborted","items","previews","revoker","UserAgent","isiOS","toFixed","fileIndex","canvasResize","preview","_templ","show","_bindTpl","_dealObjectURL","setTimeout","clearTimeout","_delete","attr","currentFiles","_watchTpl","b","item","animate","replace","RegExp","create","URL","createObjectURL","revokeObjectURL","webkitURL","disable","xhr","upload","addEventListener","_checkPogress","eval","fileAborted","message","_resizeIos","_resize","formData","FormData","p","ratio1","ratio2","encodeURIComponent","title","uploadtype","isAndroid","chrome","pow","fileDelete","_hidePreview","itemLen","fadeOut","fileFailure","enable","alert","Zepto","jQuery","isDesktop","isWindows","isLinux","isMac","isTablet","isiPad","isAndroidTablet","isMobile","isiPhone","isWindowsPhone","isWeChat","isWeibo","ie","firefox","safari","opera","uc","mqq","baidu","androidBrowser","browser","engine","osVersion","_versions","_browsers","weibo","wechat","_platforms","windows","windowsPhone","mac","linux","iPad","iPod","iPhone","android","_osVersion","iOS","_engine","trident","gecko","applewebkit","presto","ua","navigator","userAgent","toLowerCase","_getPlatform","_getBrowser","_getBroserVersion","test","_testMobile","_getOSVersion","_getEngine","_toFixedVersion","ver","floatLength","$2","$1","contains","str","getUserAgent"],"mappings":"AAAAA,cAAc,IAERC,EACA,SAAUC,EAAQC,EAASC,GAEjC,YCLAA,GAAA,IACAA,EAAA,KDaMC,GACA,SAAUH,EAAQC,EAASC,GAEjC,YEjBAA,GAAQ,IACRA,EAAQ,IACRE,EAAE,wBAAwBC,GAAG,QAAQ,YAAY,WAChDD,EAAEE,MAAMC,SAASC,YFyBZC,GACA,SAAUT,OAAQC,QAASC,qBAEjC,YAGA,IAAIQ,SAA4B,kBAAXC,SAAoD,gBAApBA,QAAOC,SAAwB,SAAUC,GAAO,aAAcA,IAAS,SAAUA,GAAO,MAAOA,IAAyB,kBAAXF,SAAyBE,EAAIC,cAAgBH,QAAUE,IAAQF,OAAOI,UAAY,eAAkBF,KGlCrQ,SAAUT,EAAGY,OAAQC,SAAUC,WAC5B,QAASC,QAAOC,EAAOpB,OACW,KAAnBgB,OAAOK,UACdL,OAAOK,YAEXA,QAAQD,GAASpB,EAiwCzB,QAASsB,QAAOC,EAAUC,GACzBlB,KAAKkB,MACJC,IAAK,uCACLC,UACAC,WAAW,EACXC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EAAQC,EAASC,GAEjCF,EAAOC,QAAUC,EAAoB,MAKlC","file":"js/comment.js?v=76e6ae63","sourcesContent":["webpackJsonp([1],{\n\n/***/ 1:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n__webpack_require__(20);\n\n__webpack_require__(10);\n\n/***/ }),\n\n/***/ 10:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n__webpack_require__(16);\n__webpack_require__(15);\n$('.comment-imgs-box ul').on('click', 'li .close', function () {\n\t$(this).parent().remove();\n});\n\n/***/ }),\n\n/***/ 15:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n;(function ($, window, document, undefined) {\n function regist(mName, module) {\n if (typeof window.brickjs === \"undefined\") {\n window.brickjs = {};\n }\n brickjs[mName] = module;\n }\n ;\n /*\n * Binary Ajax 0.1.10\n * Copyright (c) 2008 Jacob Seidelin, jseidelin@nihilogic.dk, http://blog.nihilogic.dk/\n * Licensed under the MPL License [http://www.nihilogic.dk/licenses/mpl-license.txt]\n */\n\n var BinaryFile = function BinaryFile(strData, iDataOffset, iDataLength) {\n var data = strData;\n var dataOffset = iDataOffset || 0;\n var dataLength = 0;\n\n this.getRawData = function () {\n return data;\n };\n\n if (typeof strData == \"string\") {\n dataLength = iDataLength || data.length;\n\n this.getByteAt = function (iOffset) {\n return data.charCodeAt(iOffset + dataOffset) & 0xFF;\n };\n\n this.getBytesAt = function (iOffset, iLength) {\n var aBytes = [];\n\n for (var i = 0; i < iLength; i++) {\n aBytes[i] = data.charCodeAt(iOffset + i + dataOffset) & 0xFF;\n }\n ;\n\n return aBytes;\n };\n } else if (typeof strData == \"unknown\") {\n dataLength = iDataLength || IEBinary_getLength(data);\n\n this.getByteAt = function (iOffset) {\n return IEBinary_getByteAt(data, iOffset + dataOffset);\n };\n\n this.getBytesAt = function (iOffset, iLength) {\n return new VBArray(IEBinary_getBytesAt(data, iOffset + dataOffset, iLength)).toArray();\n };\n }\n\n this.getLength = function () {\n return dataLength;\n };\n\n this.getSByteAt = function (iOffset) {\n var iByte = this.getByteAt(iOffset);\n if (iByte > 127) return iByte - 256;else return iByte;\n };\n\n this.getShortAt = function (iOffset, bBigEndian) {\n var iShort = bBigEndian ? (this.getByteAt(iOffset) << 8) + this.getByteAt(iOffset + 1) : (this.getByteAt(iOffset + 1) << 8) + this.getByteAt(iOffset);\n if (iShort < 0) iShort += 65536;\n return iShort;\n };\n this.getSShortAt = function (iOffset, bBigEndian) {\n var iUShort = this.getShortAt(iOffset, bBigEndian);\n if (iUShort > 32767) return iUShort - 65536;else return iUShort;\n };\n this.getLongAt = function (iOffset, bBigEndian) {\n var iByte1 = this.getByteAt(iOffset),\n iByte2 = this.getByteAt(iOffset + 1),\n iByte3 = this.getByteAt(iOffset + 2),\n iByte4 = this.getByteAt(iOffset + 3);\n\n var iLong = bBigEndian ? (((iByte1 << 8) + iByte2 << 8) + iByte3 << 8) + iByte4 : (((iByte4 << 8) + iByte3 << 8) + iByte2 << 8) + iByte1;\n if (iLong < 0) iLong += 4294967296;\n return iLong;\n };\n this.getSLongAt = function (iOffset, bBigEndian) {\n var iULong = this.getLongAt(iOffset, bBigEndian);\n if (iULong > 2147483647) return iULong - 4294967296;else return iULong;\n };\n\n this.getStringAt = function (iOffset, iLength) {\n var aStr = [];\n\n var aBytes = this.getBytesAt(iOffset, iLength);\n for (var j = 0; j < iLength; j++) {\n aStr[j] = String.fromCharCode(aBytes[j]);\n }\n return aStr.join(\"\");\n };\n\n this.getCharAt = function (iOffset) {\n return String.fromCharCode(this.getByteAt(iOffset));\n };\n this.toBase64 = function () {\n return window.btoa(data);\n };\n this.fromBase64 = function (strBase64) {\n data = window.atob(strBase64);\n };\n };\n\n var BinaryAjax = function () {\n\n function createRequest() {\n var oHTTP = null;\n if (window.ActiveXObject) {\n oHTTP = new ActiveXObject(\"Microsoft.XMLHTTP\");\n } else if (window.XMLHttpRequest) {\n oHTTP = new XMLHttpRequest();\n }\n return oHTTP;\n }\n\n function getHead(strURL, fncCallback, fncError) {\n var oHTTP = createRequest();\n if (oHTTP) {\n if (fncCallback) {\n if (typeof oHTTP.onload != \"undefined\") {\n oHTTP.onload = function () {\n if (oHTTP.status == \"200\") {\n fncCallback(this);\n } else {\n if (fncError) fncError();\n }\n oHTTP = null;\n };\n } else {\n oHTTP.onreadystatechange = function () {\n if (oHTTP.readyState == 4) {\n if (oHTTP.status == \"200\") {\n fncCallback(this);\n } else {\n if (fncError) fncError();\n }\n oHTTP = null;\n }\n };\n }\n }\n oHTTP.open(\"HEAD\", strURL, true);\n oHTTP.send(null);\n } else {\n if (fncError) fncError();\n }\n }\n\n function sendRequest(strURL, fncCallback, fncError, aRange, bAcceptRanges, iFileSize) {\n var oHTTP = createRequest();\n if (oHTTP) {\n\n var iDataOffset = 0;\n if (aRange && !bAcceptRanges) {\n iDataOffset = aRange[0];\n }\n var iDataLen = 0;\n if (aRange) {\n iDataLen = aRange[1] - aRange[0] + 1;\n }\n\n if (fncCallback) {\n if (typeof oHTTP.onload != \"undefined\") {\n oHTTP.onload = function () {\n if (oHTTP.status == \"200\" || oHTTP.status == \"206\" || oHTTP.status == \"0\") {\n oHTTP.binaryResponse = new BinaryFile(oHTTP.responseText, iDataOffset, iDataLen);\n oHTTP.fileSize = iFileSize || oHTTP.getResponseHeader(\"Content-Length\");\n fncCallback(oHTTP);\n } else {\n if (fncError) fncError();\n }\n oHTTP = null;\n };\n } else {\n oHTTP.onreadystatechange = function () {\n if (oHTTP.readyState == 4) {\n if (oHTTP.status == \"200\" || oHTTP.status == \"206\" || oHTTP.status == \"0\") {\n // IE6 craps if we try to extend the XHR object\n var oRes = {\n status: oHTTP.status,\n // IE needs responseBody, Chrome/Safari needs responseText\n binaryResponse: new BinaryFile(typeof oHTTP.responseBody == \"unknown\" ? oHTTP.responseBody : oHTTP.responseText, iDataOffset, iDataLen),\n fileSize: iFileSize || oHTTP.getResponseHeader(\"Content-Length\")\n };\n fncCallback(oRes);\n } else {\n if (fncError) fncError();\n }\n oHTTP = null;\n }\n };\n }\n }\n oHTTP.open(\"GET\", strURL, true);\n\n if (oHTTP.overrideMimeType) oHTTP.overrideMimeType('text/plain; charset=x-user-defined');\n\n if (aRange && bAcceptRanges) {\n oHTTP.setRequestHeader(\"Range\", \"bytes=\" + aRange[0] + \"-\" + aRange[1]);\n }\n\n oHTTP.setRequestHeader(\"If-Modified-Since\", \"Sat, 1 Jan 1970 00:00:00 GMT\");\n\n oHTTP.send(null);\n } else {\n if (fncError) fncError();\n }\n }\n\n return function (strURL, fncCallback, fncError, aRange) {\n\n if (aRange) {\n getHead(strURL, function (oHTTP) {\n var iLength = parseInt(oHTTP.getResponseHeader(\"Content-Length\"), 10);\n var strAcceptRanges = oHTTP.getResponseHeader(\"Accept-Ranges\");\n\n var iStart, iEnd;\n iStart = aRange[0];\n if (aRange[0] < 0) iStart += iLength;\n iEnd = iStart + aRange[1] - 1;\n\n sendRequest(strURL, fncCallback, fncError, [iStart, iEnd], strAcceptRanges == \"bytes\", iLength);\n });\n } else {\n sendRequest(strURL, fncCallback, fncError);\n }\n };\n }();; /*\n * \n * canvasResize\n * \n * Version: 1.2.0 \n * Date (d/m/y): 02/10/12\n * Update (d/m/y): 14/05/13\n * Original author: @gokercebeci \n * Licensed under the MIT license\n * - This plugin working with binaryajax.js and exif.js \n * (It's under the MPL License http://www.nihilogic.dk/licenses/mpl-license.txt)\n * Demo: http://canvasResize.gokercebeci.com/\n * \n * - I fixed iOS6 Safari's image file rendering issue for large size image (over mega-pixel)\n * using few functions from https://github.com/stomita/ios-imagefile-megapixel\n * (detectSubsampling, )\n * And fixed orientation issue by using https://github.com/jseidelin/exif-js\n * Thanks, Shinichi Tomita and Jacob Seidelin\n */\n\n (function ($) {\n var pluginName = 'canvasResize',\n methods = {\n newsize: function newsize(w, h, W, H, C) {\n var c = C ? 'h' : '';\n if (W && w > W || H && h > H) {\n var r = w / h;\n if ((r >= 1 || H === 0) && W && !C) {\n w = W;\n h = W / r >> 0;\n } else if (C && r <= W / H) {\n w = W;\n h = W / r >> 0;\n c = 'w';\n } else {\n w = H * r >> 0;\n h = H;\n }\n }\n return {\n 'width': w,\n 'height': h,\n 'cropped': c\n };\n },\n dataURLtoBlob: function dataURLtoBlob(data) {\n var mimeString = data.split(',')[0].split(':')[1].split(';')[0];\n var byteString = atob(data.split(',')[1]);\n var ab = new ArrayBuffer(byteString.length);\n var ia = new Uint8Array(ab);\n for (var i = 0; i < byteString.length; i++) {\n ia[i] = byteString.charCodeAt(i);\n }\n var bb = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder;\n if (bb) {\n // console.log('BlobBuilder'); \n bb = new (window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder)();\n bb.append(ab);\n return bb.getBlob(mimeString);\n } else {\n // console.log('Blob'); \n bb = new Blob([ab], {\n 'type': mimeString\n });\n return bb;\n }\n },\n /**\n * Detect subsampling in loaded image.\n * In iOS, larger images than 2M pixels may be subsampled in rendering.\n */\n detectSubsampling: function detectSubsampling(img) {\n var iw = img.width,\n ih = img.height;\n if (iw * ih > 1048576) {\n // subsampling may happen over megapixel image\n var canvas = document.createElement('canvas');\n canvas.width = canvas.height = 1;\n var ctx = canvas.getContext('2d');\n ctx.drawImage(img, -iw + 1, 0);\n // subsampled image becomes half smaller in rendering size.\n // check alpha channel value to confirm image is covering edge pixel or not.\n // if alpha value is 0 image is not covering, hence subsampled.\n return ctx.getImageData(0, 0, 1, 1).data[3] === 0;\n } else {\n return false;\n }\n },\n /**\n * Update the orientation according to the specified rotation angle\n */\n rotate: function rotate(orientation, angle) {\n var o = {\n // nothing\n 1: { 90: 6, 180: 3, 270: 8 },\n // horizontal flip\n 2: { 90: 7, 180: 4, 270: 5 },\n // 180 rotate left\n 3: { 90: 8, 180: 1, 270: 6 },\n // vertical flip\n 4: { 90: 5, 180: 2, 270: 7 },\n // vertical flip + 90 rotate right\n 5: { 90: 2, 180: 7, 270: 4 },\n // 90 rotate right\n 6: { 90: 3, 180: 8, 270: 1 },\n // horizontal flip + 90 rotate right\n 7: { 90: 4, 180: 5, 270: 2 },\n // 90 rotate left\n 8: { 90: 1, 180: 6, 270: 3 }\n };\n return o[orientation][angle] ? o[orientation][angle] : orientation;\n },\n /**\n * Transform canvas coordination according to specified frame size and orientation\n * Orientation value is from EXIF tag\n */\n transformCoordinate: function transformCoordinate(canvas, width, height, orientation) {\n switch (orientation) {\n case 5:\n case 6:\n case 7:\n case 8:\n canvas.width = height;\n canvas.height = width;\n break;\n default:\n canvas.width = width;\n canvas.height = height;\n }\n var ctx = canvas.getContext('2d');\n switch (orientation) {\n case 1:\n // nothing\n break;\n case 2:\n // horizontal flip\n ctx.translate(width, 0);\n ctx.scale(-1, 1);\n break;\n case 3:\n // 180 rotate left\n ctx.translate(width, height);\n ctx.rotate(Math.PI);\n break;\n case 4:\n // vertical flip\n ctx.translate(0, height);\n ctx.scale(1, -1);\n break;\n case 5:\n // vertical flip + 90 rotate right\n ctx.rotate(0.5 * Math.PI);\n ctx.scale(1, -1);\n break;\n case 6:\n // 90 rotate right\n ctx.rotate(0.5 * Math.PI);\n ctx.translate(0, -height);\n break;\n case 7:\n // horizontal flip + 90 rotate right\n ctx.rotate(0.5 * Math.PI);\n ctx.translate(width, -height);\n ctx.scale(-1, 1);\n break;\n case 8:\n // 90 rotate left\n ctx.rotate(-0.5 * Math.PI);\n ctx.translate(-width, 0);\n break;\n default:\n break;\n }\n },\n /**\n * Detecting vertical squash in loaded image.\n * Fixes a bug which squash image vertically while drawing into canvas for some images.\n */\n detectVerticalSquash: function detectVerticalSquash(img, iw, ih) {\n var canvas = document.createElement('canvas');\n canvas.width = 1;\n canvas.height = ih;\n var ctx = canvas.getContext('2d');\n ctx.drawImage(img, 0, 0);\n var data = ctx.getImageData(0, 0, 1, ih).data;\n // search image edge pixel position in case it is squashed vertically.\n var sy = 0;\n var ey = ih;\n var py = ih;\n while (py > sy) {\n var alpha = data[(py - 1) * 4 + 3];\n if (alpha === 0) {\n ey = py;\n } else {\n sy = py;\n }\n py = ey + sy >> 1;\n }\n var ratio = py / ih;\n return ratio === 0 ? 1 : ratio;\n },\n callback: function callback(d) {\n return d;\n },\n extend: function extend() {\n var target = arguments[0] || {},\n a = 1,\n al = arguments.length,\n deep = false;\n if (target.constructor === Boolean) {\n deep = target;\n target = arguments[1] || {};\n }\n if (al === 1) {\n target = this;\n a = 0;\n }\n var prop;\n for (; a < al; a++) {\n if ((prop = arguments[a]) !== null) for (var i in prop) {\n if (target === prop[i]) continue;\n if (deep && _typeof(prop[i]) === 'object' && target[i]) methods.extend(target[i], prop[i]);else if (prop[i] !== undefined) target[i] = prop[i];\n }\n }return target;\n }\n },\n defaults = {\n width: 300,\n height: 0,\n crop: false,\n quality: 80,\n rotate: 0,\n 'callback': methods.callback\n };\n function Plugin(file, options) {\n this.file = file;\n // EXTEND\n this.options = methods.extend({}, defaults, options);\n this._defaults = defaults;\n this._name = pluginName;\n this.init();\n }\n Plugin.prototype = {\n init: function init() {\n //this.options.init(this);\n var $this = this;\n var file = this.file;\n\n var reader = new FileReader();\n reader.onloadend = function (e) {\n\n var dataURL = e.target.result;\n var byteString = atob(dataURL.split(',')[1]);\n var binary = new BinaryFile(byteString, 0, byteString.length);\n var exif = EXIF.readFromBinaryFile(binary);\n\n var img = new Image();\n img.onload = function (e) {\n\n var orientation = exif['Orientation'] || 1;\n orientation = methods.rotate(orientation, $this.options.rotate);\n\n // CW or CCW ? replace width and height\n var size = orientation >= 5 && orientation <= 8 ? methods.newsize(img.height, img.width, $this.options.width, $this.options.height, $this.options.crop) : methods.newsize(img.width, img.height, $this.options.width, $this.options.height, $this.options.crop);\n\n var iw = img.width,\n ih = img.height;\n var width = size.width,\n height = size.height;\n\n var canvas = document.createElement(\"canvas\");\n var ctx = canvas.getContext(\"2d\");\n ctx.save();\n methods.transformCoordinate(canvas, width, height, orientation);\n\n // over image size\n if (methods.detectSubsampling(img)) {\n iw /= 2;\n ih /= 2;\n }\n var d = 1024; // size of tiling canvas\n var tmpCanvas = document.createElement('canvas');\n tmpCanvas.width = tmpCanvas.height = d;\n var tmpCtx = tmpCanvas.getContext('2d');\n var vertSquashRatio = methods.detectVerticalSquash(img, iw, ih);\n var sy = 0;\n while (sy < ih) {\n var sh = sy + d > ih ? ih - sy : d;\n var sx = 0;\n while (sx < iw) {\n var sw = sx + d > iw ? iw - sx : d;\n tmpCtx.clearRect(0, 0, d, d);\n tmpCtx.drawImage(img, -sx, -sy);\n var dx = Math.floor(sx * width / iw);\n var dw = Math.ceil(sw * width / iw);\n var dy = Math.floor(sy * height / ih / vertSquashRatio);\n var dh = Math.ceil(sh * height / ih / vertSquashRatio);\n ctx.drawImage(tmpCanvas, 0, 0, sw, sh, dx, dy, dw, dh);\n sx += d;\n }\n sy += d;\n }\n ctx.restore();\n tmpCanvas = tmpCtx = null;\n\n // if rotated width and height data replacing issue \n var newcanvas = document.createElement('canvas');\n newcanvas.width = size.cropped === 'h' ? height : width;\n newcanvas.height = size.cropped === 'w' ? width : height;\n var x = size.cropped === 'h' ? (height - width) * .5 : 0;\n var y = size.cropped === 'w' ? (width - height) * .5 : 0;\n var newctx = newcanvas.getContext('2d');\n newctx.drawImage(canvas, x, y, width, height);\n\n // console.log(file, file.type);\n if (file.type === \"image/png\") {\n var data = newcanvas.toDataURL(file.type);\n } else {\n var data = newcanvas.toDataURL(\"image/jpeg\", $this.options.quality * .01);\n }\n\n // CALLBACK\n $this.options.callback(data, newcanvas.width, newcanvas.height);\n\n // });\n };\n img.src = dataURL;\n // =====================================================\n };\n reader.readAsDataURL(file);\n //reader.readAsBinaryString(file);\n }\n };\n $[pluginName] = function (file, options) {\n if (typeof file === 'string') return methods[file](options);else new Plugin(file, options);\n };\n })(window);; /*\n * Javascript EXIF Reader 0.1.6\n * Copyright (c) 2008 Jacob Seidelin, jseidelin@nihilogic.dk, http://blog.nihilogic.dk/\n * Licensed under the MPL License [http://www.nihilogic.dk/licenses/mpl-license.txt]\n */\n\n var EXIF = function () {\n\n var debug = false;\n\n var ExifTags = {\n\n // version tags\n 0x9000: \"ExifVersion\", // EXIF version\n 0xA000: \"FlashpixVersion\", // Flashpix format version\n\n // colorspace tags\n 0xA001: \"ColorSpace\", // Color space information tag\n\n // image configuration\n 0xA002: \"PixelXDimension\", // Valid width of meaningful image\n 0xA003: \"PixelYDimension\", // Valid height of meaningful image\n 0x9101: \"ComponentsConfiguration\", // Information about channels\n 0x9102: \"CompressedBitsPerPixel\", // Compressed bits per pixel\n\n // user information\n 0x927C: \"MakerNote\", // Any desired information written by the manufacturer\n 0x9286: \"UserComment\", // Comments by user\n\n // related file\n 0xA004: \"RelatedSoundFile\", // Name of related sound file\n\n // date and time\n 0x9003: \"DateTimeOriginal\", // Date and time when the original image was generated\n 0x9004: \"DateTimeDigitized\", // Date and time when the image was stored digitally\n 0x9290: \"SubsecTime\", // Fractions of seconds for DateTime\n 0x9291: \"SubsecTimeOriginal\", // Fractions of seconds for DateTimeOriginal\n 0x9292: \"SubsecTimeDigitized\", // Fractions of seconds for DateTimeDigitized\n\n // picture-taking conditions\n 0x829A: \"ExposureTime\", // Exposure time (in seconds)\n 0x829D: \"FNumber\", // F number\n 0x8822: \"ExposureProgram\", // Exposure program\n 0x8824: \"SpectralSensitivity\", // Spectral sensitivity\n 0x8827: \"ISOSpeedRatings\", // ISO speed rating\n 0x8828: \"OECF\", // Optoelectric conversion factor\n 0x9201: \"ShutterSpeedValue\", // Shutter speed\n 0x9202: \"ApertureValue\", // Lens aperture\n 0x9203: \"BrightnessValue\", // Value of brightness\n 0x9204: \"ExposureBias\", // Exposure bias\n 0x9205: \"MaxApertureValue\", // Smallest F number of lens\n 0x9206: \"SubjectDistance\", // Distance to subject in meters\n 0x9207: \"MeteringMode\", // Metering mode\n 0x9208: \"LightSource\", // Kind of light source\n 0x9209: \"Flash\", // Flash status\n 0x9214: \"SubjectArea\", // Location and area of main subject\n 0x920A: \"FocalLength\", // Focal length of the lens in mm\n 0xA20B: \"FlashEnergy\", // Strobe energy in BCPS\n 0xA20C: \"SpatialFrequencyResponse\", // \n 0xA20E: \"FocalPlaneXResolution\", // Number of pixels in width direction per FocalPlaneResolutionUnit\n 0xA20F: \"FocalPlaneYResolution\", // Number of pixels in height direction per FocalPlaneResolutionUnit\n 0xA210: \"FocalPlaneResolutionUnit\", // Unit for measuring FocalPlaneXResolution and FocalPlaneYResolution\n 0xA214: \"SubjectLocation\", // Location of subject in image\n 0xA215: \"ExposureIndex\", // Exposure index selected on camera\n 0xA217: \"SensingMethod\", // Image sensor type\n 0xA300: \"FileSource\", // Image source (3 == DSC)\n 0xA301: \"SceneType\", // Scene type (1 == directly photographed)\n 0xA302: \"CFAPattern\", // Color filter array geometric pattern\n 0xA401: \"CustomRendered\", // Special processing\n 0xA402: \"ExposureMode\", // Exposure mode\n 0xA403: \"WhiteBalance\", // 1 = auto white balance, 2 = manual\n 0xA404: \"DigitalZoomRation\", // Digital zoom ratio\n 0xA405: \"FocalLengthIn35mmFilm\", // Equivalent foacl length assuming 35mm film camera (in mm)\n 0xA406: \"SceneCaptureType\", // Type of scene\n 0xA407: \"GainControl\", // Degree of overall image gain adjustment\n 0xA408: \"Contrast\", // Direction of contrast processing applied by camera\n 0xA409: \"Saturation\", // Direction of saturation processing applied by camera\n 0xA40A: \"Sharpness\", // Direction of sharpness processing applied by camera\n 0xA40B: \"DeviceSettingDescription\", // \n 0xA40C: \"SubjectDistanceRange\", // Distance to subject\n\n // other tags\n 0xA005: \"InteroperabilityIFDPointer\",\n 0xA420: \"ImageUniqueID\" // Identifier assigned uniquely to each image\n };\n\n var TiffTags = {\n 0x0100: \"ImageWidth\",\n 0x0101: \"ImageHeight\",\n 0x8769: \"ExifIFDPointer\",\n 0x8825: \"GPSInfoIFDPointer\",\n 0xA005: \"InteroperabilityIFDPointer\",\n 0x0102: \"BitsPerSample\",\n 0x0103: \"Compression\",\n 0x0106: \"PhotometricInterpretation\",\n 0x0112: \"Orientation\",\n 0x0115: \"SamplesPerPixel\",\n 0x011C: \"PlanarConfiguration\",\n 0x0212: \"YCbCrSubSampling\",\n 0x0213: \"YCbCrPositioning\",\n 0x011A: \"XResolution\",\n 0x011B: \"YResolution\",\n 0x0128: \"ResolutionUnit\",\n 0x0111: \"StripOffsets\",\n 0x0116: \"RowsPerStrip\",\n 0x0117: \"StripByteCounts\",\n 0x0201: \"JPEGInterchangeFormat\",\n 0x0202: \"JPEGInterchangeFormatLength\",\n 0x012D: \"TransferFunction\",\n 0x013E: \"WhitePoint\",\n 0x013F: \"PrimaryChromaticities\",\n 0x0211: \"YCbCrCoefficients\",\n 0x0214: \"ReferenceBlackWhite\",\n 0x0132: \"DateTime\",\n 0x010E: \"ImageDescription\",\n 0x010F: \"Make\",\n 0x0110: \"Model\",\n 0x0131: \"Software\",\n 0x013B: \"Artist\",\n 0x8298: \"Copyright\"\n };\n\n var GPSTags = {\n 0x0000: \"GPSVersionID\",\n 0x0001: \"GPSLatitudeRef\",\n 0x0002: \"GPSLatitude\",\n 0x0003: \"GPSLongitudeRef\",\n 0x0004: \"GPSLongitude\",\n 0x0005: \"GPSAltitudeRef\",\n 0x0006: \"GPSAltitude\",\n 0x0007: \"GPSTimeStamp\",\n 0x0008: \"GPSSatellites\",\n 0x0009: \"GPSStatus\",\n 0x000A: \"GPSMeasureMode\",\n 0x000B: \"GPSDOP\",\n 0x000C: \"GPSSpeedRef\",\n 0x000D: \"GPSSpeed\",\n 0x000E: \"GPSTrackRef\",\n 0x000F: \"GPSTrack\",\n 0x0010: \"GPSImgDirectionRef\",\n 0x0011: \"GPSImgDirection\",\n 0x0012: \"GPSMapDatum\",\n 0x0013: \"GPSDestLatitudeRef\",\n 0x0014: \"GPSDestLatitude\",\n 0x0015: \"GPSDestLongitudeRef\",\n 0x0016: \"GPSDestLongitude\",\n 0x0017: \"GPSDestBearingRef\",\n 0x0018: \"GPSDestBearing\",\n 0x0019: \"GPSDestDistanceRef\",\n 0x001A: \"GPSDestDistance\",\n 0x001B: \"GPSProcessingMethod\",\n 0x001C: \"GPSAreaInformation\",\n 0x001D: \"GPSDateStamp\",\n 0x001E: \"GPSDifferential\"\n };\n\n var StringValues = {\n ExposureProgram: {\n 0: \"Not defined\",\n 1: \"Manual\",\n 2: \"Normal program\",\n 3: \"Aperture priority\",\n 4: \"Shutter priority\",\n 5: \"Creative program\",\n 6: \"Action program\",\n 7: \"Portrait mode\",\n 8: \"Landscape mode\"\n },\n MeteringMode: {\n 0: \"Unknown\",\n 1: \"Average\",\n 2: \"CenterWeightedAverage\",\n 3: \"Spot\",\n 4: \"MultiSpot\",\n 5: \"Pattern\",\n 6: \"Partial\",\n 255: \"Other\"\n },\n LightSource: {\n 0: \"Unknown\",\n 1: \"Daylight\",\n 2: \"Fluorescent\",\n 3: \"Tungsten (incandescent light)\",\n 4: \"Flash\",\n 9: \"Fine weather\",\n 10: \"Cloudy weather\",\n 11: \"Shade\",\n 12: \"Daylight fluorescent (D 5700 - 7100K)\",\n 13: \"Day white fluorescent (N 4600 - 5400K)\",\n 14: \"Cool white fluorescent (W 3900 - 4500K)\",\n 15: \"White fluorescent (WW 3200 - 3700K)\",\n 17: \"Standard light A\",\n 18: \"Standard light B\",\n 19: \"Standard light C\",\n 20: \"D55\",\n 21: \"D65\",\n 22: \"D75\",\n 23: \"D50\",\n 24: \"ISO studio tungsten\",\n 255: \"Other\"\n },\n Flash: {\n 0x0000: \"Flash did not fire\",\n 0x0001: \"Flash fired\",\n 0x0005: \"Strobe return light not detected\",\n 0x0007: \"Strobe return light detected\",\n 0x0009: \"Flash fired, compulsory flash mode\",\n 0x000D: \"Flash fired, compulsory flash mode, return light not detected\",\n 0x000F: \"Flash fired, compulsory flash mode, return light detected\",\n 0x0010: \"Flash did not fire, compulsory flash mode\",\n 0x0018: \"Flash did not fire, auto mode\",\n 0x0019: \"Flash fired, auto mode\",\n 0x001D: \"Flash fired, auto mode, return light not detected\",\n 0x001F: \"Flash fired, auto mode, return light detected\",\n 0x0020: \"No flash function\",\n 0x0041: \"Flash fired, red-eye reduction mode\",\n 0x0045: \"Flash fired, red-eye reduction mode, return light not detected\",\n 0x0047: \"Flash fired, red-eye reduction mode, return light detected\",\n 0x0049: \"Flash fired, compulsory flash mode, red-eye reduction mode\",\n 0x004D: \"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected\",\n 0x004F: \"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected\",\n 0x0059: \"Flash fired, auto mode, red-eye reduction mode\",\n 0x005D: \"Flash fired, auto mode, return light not detected, red-eye reduction mode\",\n 0x005F: \"Flash fired, auto mode, return light detected, red-eye reduction mode\"\n },\n SensingMethod: {\n 1: \"Not defined\",\n 2: \"One-chip color area sensor\",\n 3: \"Two-chip color area sensor\",\n 4: \"Three-chip color area sensor\",\n 5: \"Color sequential area sensor\",\n 7: \"Trilinear sensor\",\n 8: \"Color sequential linear sensor\"\n },\n SceneCaptureType: {\n 0: \"Standard\",\n 1: \"Landscape\",\n 2: \"Portrait\",\n 3: \"Night scene\"\n },\n SceneType: {\n 1: \"Directly photographed\"\n },\n CustomRendered: {\n 0: \"Normal process\",\n 1: \"Custom process\"\n },\n WhiteBalance: {\n 0: \"Auto white balance\",\n 1: \"Manual white balance\"\n },\n GainControl: {\n 0: \"None\",\n 1: \"Low gain up\",\n 2: \"High gain up\",\n 3: \"Low gain down\",\n 4: \"High gain down\"\n },\n Contrast: {\n 0: \"Normal\",\n 1: \"Soft\",\n 2: \"Hard\"\n },\n Saturation: {\n 0: \"Normal\",\n 1: \"Low saturation\",\n 2: \"High saturation\"\n },\n Sharpness: {\n 0: \"Normal\",\n 1: \"Soft\",\n 2: \"Hard\"\n },\n SubjectDistanceRange: {\n 0: \"Unknown\",\n 1: \"Macro\",\n 2: \"Close view\",\n 3: \"Distant view\"\n },\n FileSource: {\n 3: \"DSC\"\n },\n Components: {\n 0: \"\",\n 1: \"Y\",\n 2: \"Cb\",\n 3: \"Cr\",\n 4: \"R\",\n 5: \"G\",\n 6: \"B\"\n }\n };\n\n function addEvent(element, event, handler) {\n if (element.addEventListener) {\n element.addEventListener(event, handler, false);\n } else if (element.attachEvent) {\n element.attachEvent(\"on\" + event, handler);\n }\n }\n\n function imageHasData(img) {\n return !!img.exifdata;\n }\n\n function getImageData(img, callback) {\n BinaryAjax(img.src, function (http) {\n var data = findEXIFinJPEG(http.binaryResponse);\n img.exifdata = data || {};\n if (callback) {\n callback.call(img);\n }\n });\n }\n\n function findEXIFinJPEG(file) {\n if (file.getByteAt(0) != 0xFF || file.getByteAt(1) != 0xD8) {\n return false; // not a valid jpeg\n }\n\n var offset = 2,\n length = file.getLength(),\n marker;\n\n while (offset < length) {\n if (file.getByteAt(offset) != 0xFF) {\n if (debug) console.log(\"Not a valid marker at offset \" + offset + \", found: \" + file.getByteAt(offset));\n return false; // not a valid marker, something is wrong\n }\n\n marker = file.getByteAt(offset + 1);\n\n // we could implement handling for other markers here, \n // but we're only looking for 0xFFE1 for EXIF data\n\n if (marker == 22400) {\n if (debug) console.log(\"Found 0xFFE1 marker\");\n\n return readEXIFData(file, offset + 4, file.getShortAt(offset + 2, true) - 2);\n\n // offset += 2 + file.getShortAt(offset+2, true);\n } else if (marker == 225) {\n // 0xE1 = Application-specific 1 (for EXIF)\n if (debug) console.log(\"Found 0xFFE1 marker\");\n\n return readEXIFData(file, offset + 4, file.getShortAt(offset + 2, true) - 2);\n } else {\n offset += 2 + file.getShortAt(offset + 2, true);\n }\n }\n }\n\n function readTags(file, tiffStart, dirStart, strings, bigEnd) {\n var entries = file.getShortAt(dirStart, bigEnd),\n tags = {},\n entryOffset,\n tag,\n i;\n\n for (i = 0; i < entries; i++) {\n entryOffset = dirStart + i * 12 + 2;\n tag = strings[file.getShortAt(entryOffset, bigEnd)];\n if (!tag && debug) console.log(\"Unknown tag: \" + file.getShortAt(entryOffset, bigEnd));\n tags[tag] = readTagValue(file, entryOffset, tiffStart, dirStart, bigEnd);\n }\n return tags;\n }\n\n function readTagValue(file, entryOffset, tiffStart, dirStart, bigEnd) {\n var type = file.getShortAt(entryOffset + 2, bigEnd),\n numValues = file.getLongAt(entryOffset + 4, bigEnd),\n valueOffset = file.getLongAt(entryOffset + 8, bigEnd) + tiffStart,\n offset,\n vals,\n val,\n n,\n numerator,\n denominator;\n\n switch (type) {\n case 1: // byte, 8-bit unsigned int\n case 7:\n // undefined, 8-bit byte, value depending on field\n if (numValues == 1) {\n return file.getByteAt(entryOffset + 8, bigEnd);\n } else {\n offset = numValues > 4 ? valueOffset : entryOffset + 8;\n vals = [];\n for (n = 0; n < numValues; n++) {\n vals[n] = file.getByteAt(offset + n);\n }\n return vals;\n }\n\n case 2:\n // ascii, 8-bit byte\n offset = numValues > 4 ? valueOffset : entryOffset + 8;\n return file.getStringAt(offset, numValues - 1);\n\n case 3:\n // short, 16 bit int\n if (numValues == 1) {\n return file.getShortAt(entryOffset + 8, bigEnd);\n } else {\n offset = numValues > 2 ? valueOffset : entryOffset + 8;\n vals = [];\n for (n = 0; n < numValues; n++) {\n vals[n] = file.getShortAt(offset + 2 * n, bigEnd);\n }\n return vals;\n }\n\n case 4:\n // long, 32 bit int\n if (numValues == 1) {\n return file.getLongAt(entryOffset + 8, bigEnd);\n } else {\n vals = [];\n for (var n = 0; n < numValues; n++) {\n vals[n] = file.getLongAt(valueOffset + 4 * n, bigEnd);\n }\n return vals;\n }\n\n case 5:\n // rational = two long values, first is numerator, second is denominator\n if (numValues == 1) {\n numerator = file.getLongAt(valueOffset, bigEnd);\n denominator = file.getLongAt(valueOffset + 4, bigEnd);\n val = new Number(numerator / denominator);\n val.numerator = numerator;\n val.denominator = denominator;\n return val;\n } else {\n vals = [];\n for (n = 0; n < numValues; n++) {\n numerator = file.getLongAt(valueOffset + 8 * n, bigEnd);\n denominator = file.getLongAt(valueOffset + 4 + 8 * n, bigEnd);\n vals[n] = new Number(numerator / denominator);\n vals[n].numerator = numerator;\n vals[n].denominator = denominator;\n }\n return vals;\n }\n\n case 9:\n // slong, 32 bit signed int\n if (numValues == 1) {\n return file.getSLongAt(entryOffset + 8, bigEnd);\n } else {\n vals = [];\n for (n = 0; n < numValues; n++) {\n vals[n] = file.getSLongAt(valueOffset + 4 * n, bigEnd);\n }\n return vals;\n }\n\n case 10:\n // signed rational, two slongs, first is numerator, second is denominator\n if (numValues == 1) {\n return file.getSLongAt(valueOffset, bigEnd) / file.getSLongAt(valueOffset + 4, bigEnd);\n } else {\n vals = [];\n for (n = 0; n < numValues; n++) {\n vals[n] = file.getSLongAt(valueOffset + 8 * n, bigEnd) / file.getSLongAt(valueOffset + 4 + 8 * n, bigEnd);\n }\n return vals;\n }\n }\n }\n\n function readEXIFData(file, start) {\n if (file.getStringAt(start, 4) != \"Exif\") {\n if (debug) console.log(\"Not valid EXIF data! \" + file.getStringAt(start, 4));\n return false;\n }\n\n var bigEnd,\n tags,\n tag,\n exifData,\n gpsData,\n tiffOffset = start + 6;\n\n // test for TIFF validity and endianness\n if (file.getShortAt(tiffOffset) == 0x4949) {\n bigEnd = false;\n } else if (file.getShortAt(tiffOffset) == 0x4D4D) {\n bigEnd = true;\n } else {\n if (debug) console.log(\"Not valid TIFF data! (no 0x4949 or 0x4D4D)\");\n return false;\n }\n\n if (file.getShortAt(tiffOffset + 2, bigEnd) != 0x002A) {\n if (debug) console.log(\"Not valid TIFF data! (no 0x002A)\");\n return false;\n }\n\n if (file.getLongAt(tiffOffset + 4, bigEnd) != 0x00000008) {\n if (debug) console.log(\"Not valid TIFF data! (First offset not 8)\", file.getShortAt(tiffOffset + 4, bigEnd));\n return false;\n }\n\n tags = readTags(file, tiffOffset, tiffOffset + 8, TiffTags, bigEnd);\n\n if (tags.ExifIFDPointer) {\n exifData = readTags(file, tiffOffset, tiffOffset + tags.ExifIFDPointer, ExifTags, bigEnd);\n for (tag in exifData) {\n switch (tag) {\n case \"LightSource\":\n case \"Flash\":\n case \"MeteringMode\":\n case \"ExposureProgram\":\n case \"SensingMethod\":\n case \"SceneCaptureType\":\n case \"SceneType\":\n case \"CustomRendered\":\n case \"WhiteBalance\":\n case \"GainControl\":\n case \"Contrast\":\n case \"Saturation\":\n case \"Sharpness\":\n case \"SubjectDistanceRange\":\n case \"FileSource\":\n exifData[tag] = StringValues[tag][exifData[tag]];\n break;\n\n case \"ExifVersion\":\n case \"FlashpixVersion\":\n exifData[tag] = String.fromCharCode(exifData[tag][0], exifData[tag][1], exifData[tag][2], exifData[tag][3]);\n break;\n\n case \"ComponentsConfiguration\":\n exifData[tag] = StringValues.Components[exifData[tag][0]] + StringValues.Components[exifData[tag][1]] + StringValues.Components[exifData[tag][2]] + StringValues.Components[exifData[tag][3]];\n break;\n }\n tags[tag] = exifData[tag];\n }\n }\n\n if (tags.GPSInfoIFDPointer) {\n gpsData = readTags(file, tiffOffset, tiffOffset + tags.GPSInfoIFDPointer, GPSTags, bigEnd);\n for (tag in gpsData) {\n switch (tag) {\n case \"GPSVersionID\":\n gpsData[tag] = gpsData[tag][0] + \".\" + gpsData[tag][1] + \".\" + gpsData[tag][2] + \".\" + gpsData[tag][3];\n break;\n }\n tags[tag] = gpsData[tag];\n }\n }\n\n return tags;\n }\n\n function getData(img, callback) {\n if (!img.complete) return false;\n if (!imageHasData(img)) {\n getImageData(img, callback);\n } else {\n if (callback) {\n callback.call(img);\n }\n }\n return true;\n }\n\n function getTag(img, tag) {\n if (!imageHasData(img)) return;\n return img.exifdata[tag];\n }\n\n function getAllTags(img) {\n if (!imageHasData(img)) return {};\n var a,\n data = img.exifdata,\n tags = {};\n for (a in data) {\n if (data.hasOwnProperty(a)) {\n tags[a] = data[a];\n }\n }\n return tags;\n }\n\n function pretty(img) {\n if (!imageHasData(img)) return \"\";\n var a,\n data = img.exifdata,\n strPretty = \"\";\n for (a in data) {\n if (data.hasOwnProperty(a)) {\n if (_typeof(data[a]) == \"object\") {\n if (data[a] instanceof Number) {\n strPretty += a + \" : \" + data[a] + \" [\" + data[a].numerator + \"/\" + data[a].denominator + \"]\\r\\n\";\n } else {\n strPretty += a + \" : [\" + data[a].length + \" values]\\r\\n\";\n }\n } else {\n strPretty += a + \" : \" + data[a] + \"\\r\\n\";\n }\n }\n }\n return strPretty;\n }\n\n function readFromBinaryFile(file) {\n return findEXIFinJPEG(file);\n }\n\n return {\n readFromBinaryFile: readFromBinaryFile,\n pretty: pretty,\n getTag: getTag,\n getAllTags: getAllTags,\n getData: getData,\n Tags: ExifTags,\n TiffTags: TiffTags,\n GPSTags: GPSTags,\n StringValues: StringValues\n };\n }();; /** \n * @file html5图片上传\n * @author yuanmin.pu@condenast.com.cn\n * @version 0.1.0\n * @requires http://js.selfimg.com.cn/jquery/jquery-1.7.1.min.js[http://js.selfimg.com.cn/gallery/zepto/1.1.4/zepto.min.js]\n * @requires http://js.selfimg.com.cn/brickjs/useragent/0.1.0/useragent.min.js\n * @example demo.html\n * @see http://js.selfimg.com.cn/brickjs/upload/0.1.0/upload.min.js\n */\n\n /** \n * @class\n * @author yuanmin.pu@condenast.com.cn\n * @description html5图片上传\n * @version 0.1.0\n * @requires http://js.selfimg.com.cn/jquery/jquery-1.7.1.min.js[http://js.selfimg.com.cn/gallery/zepto/1.1.4/zepto.min.js]\n * @requires http://js.selfimg.com.cn/brickjs/useragent/0.1.0/useragent.min.js\n * @example demo.html\n * @see http://js.selfimg.com.cn/brickjs/upload/0.1.0/upload.min.js\n * @param {Object} selector 绑定的对象\n * @param {Object} cfgs 配置项\n * @param {String} [cfgs.url=http://imgsys.self.com.cn/interface] 接口地址\n * @param {Object} cfgs.params 地址参数\n * @param {Boolean} [cfgs.useCanvas=true] 是否使用canvas压缩,默认使用(ios下始终为true)\n * @param {(String|Number)} [cfgs.size=0] 大小限制,使用canvas则为压缩后的大小,默认不限制,单位M\n * @param {Number} [cfgs.limit=0] 数量限制,默认不限制\n * @param {Number} [cfgs.width=640] 宽度限制\n * @param {Number} [cfgs.quality=100] 图片质量0-100\n * @param {String} [cfgs.error] 文件检查错误输出\n * @param {Object} [cfgs.errorMsg] 文件检查错误信息\n * @param {Boolean} [cfgs.autoUpload=false] 是否自动上传\n * @param {Boolean} [cfgs.uploadBtn] 开始上传按钮,手动上传时配置\n * @param {(Object|String)} [cfgs.tpl=null] 上传列表模板:null不使用,空字符串使用默认,非空字符串使用自定义\n * @param {Object} [cfgs.tplContainer] 上传列表容器\n * @param {Boolean} [cfgs.autoHide=true] 多文件上传时自动隐藏上传成功的列表\n * @param {Function} [cfgs.onSelect] 文件选择后\n * @param {Function} [cfgs.onUploading] 整体文件上传中\n * @param {Function} [cfgs.onProgress] 文件上传进度\n * @param {Function} [cfgs.onSuccess] 文件上传成功时\n * @param {Function} [cfgs.onFailure] 文件上传失败时\n * @param {Function} [cfgs.onDelete] 文件删除后\n * @param {Function} [cfgs.onComplete] 文件全部上传完毕时\n * @param {Function} [cfgs.onError] 文件检查错误处理 function(msg) {}\n */\n function Upload(selector, cfgs) {\n this.cfgs = {\n url: 'http://imgsys.self.com.cn/interfaces',\n params: {},\n useCanvas: true,\n size: 0,\n limit: 0,\n width: 640,\n quality: 100,\n error: '',\n errorMsg: {\n overnum: '超出上传数量限制',\n invalidLarge: '太大了',\n invalidSmall: '太小了',\n invalidType: '是不支持的图片类型',\n forbidden: '图片上传中或者图片上传被禁用'\n },\n autoUpload: false,\n uploadBtn: '',\n tpl: '',\n tplContainer: '',\n autoHide: true,\n onSelect: function onSelect(files) {},\n onUploading: function onUploading() {},\n onProgress: function onProgress(loaded, total) {},\n onSuccess: function onSuccess(response, file) {},\n onFailure: function onFailure(msg, file) {},\n onDelete: function onDelete(file) {},\n onComplete: function onComplete(msg, files) {},\n onError: null\n };\n\n $.extend(true, this.cfgs, cfgs);\n this._init(selector);\n }\n\n Upload.prototype = {\n _init: function _init(selector) {\n var self = this;\n\n /** 包含容器 */\n self.container = $(selector);\n /** 上传控件 */\n self.input = self.container.find('[type=\"file\"]');\n /** 上传列表容器 */\n self.tplContainer = self.container.find(self.cfgs.tplContainer);\n /** 文件检查错误输出对象 */\n self.error = self.container.find(self.cfgs.error);\n /** 开始上传按钮 */\n self.uploadBtn = self.container.find(self.cfgs.uploadBtn);\n self.tpl = self.cfgs.tpl || '';\n self.disabled = true;\n self.files = [];\n self.filesFilter = [];\n self.failFiles = [];\n self.count = 0; // 总文件数\n self.compress = 0; // 压缩次数\n self._bind();\n },\n _bind: function _bind() {\n var self = this,\n tempFiles = [];\n\n self.input.change(function (e) {\n if (!self.disabled) {\n self._showError(self.error, self.cfgs.errorMsg.forbidden);\n return;\n }\n\n if (self.error.length) {\n self.error.html('').hide();\n }\n\n self.failFiles = [];\n tempFiles = [];\n tempFiles.push(e.target.files);\n var tempFilesLen = tempFiles[0].length;\n\n $.each(tempFiles, function (index1, files) {\n $.each(files, function (index2, file) {\n self.files.push(file);\n });\n });\n\n if (self.cfgs.limit > 0 && self.files.length > self.cfgs.limit) {\n for (var i = 0; i < tempFilesLen; i++) {\n self.files.pop();\n }\n self._showError(self.error, self.cfgs.errorMsg.overnum + self.cfgs.limit);\n } else {\n self.filesFilter = self._filter(self.files);\n self.count = self.filesFilter.length;\n self.cfgs.onSelect(self.filesFilter);\n\n if (typeof self.cfgs.tpl === 'string' && self.tplContainer.length && self.filesFilter.length) {\n self._createTpl(self.filesFilter);\n }\n\n if (self.cfgs.autoUpload) {\n self._upload();\n }\n }\n });\n\n if (self.uploadBtn.length) {\n self.uploadBtn.click(function () {\n if (!self.disabled) {\n self._showError(self.error, self.cfgs.errorMsg.forbidden);\n return;\n }\n\n if (typeof self.cfgs.tpl === 'string' && self.tplContainer.length && self.filesFilter.length) {\n var failure = self.tplContainer.find('[node-status=\"failure\"]');\n\n failure.find('[node-type=\"result\"]').hide();\n failure.find('[node-type=\"progress\"]').css('width', 0);\n failure.find('[node-type=\"reupload\"]').hide();\n }\n\n self.count = self.filesFilter.length;\n self.failFiles = [];\n self._upload();\n });\n }\n },\n _filter: function _filter(files) {\n var self = this,\n filesArr = [],\n msg = [];\n\n $.each(files, function (index, file) {\n var maxSize = parseFloat(self.cfgs.size),\n fileName = file.name ? file.name : '';\n\n if (file.type) {\n if (file.type.indexOf('image') === 0) {\n if (!self.cfgs.useCanvas && maxSize > 0 && file.size >= maxSize * 1048576) {\n msg.push(fileName + self.cfgs.errorMsg.invalidLarge);\n } else {\n file.index = index;\n file.aborted = false;\n filesArr.push(file);\n }\n } else {\n msg.push(fileName + self.cfgs.errorMsg.invalidType);\n }\n } else {\n if (!self.cfgs.useCanvas && maxSize > 0 && file.size >= maxSize * 1048576) {\n msg.push(fileName + self.cfgs.errorMsg.invalidLarge);\n } else {\n file.index = index;\n file.aborted = false;\n filesArr.push(file);\n }\n }\n });\n\n if (msg.length) {\n self._showError(self.error, msg.join('\\n'));\n }\n\n return filesArr;\n },\n _createTpl: function _createTpl(files) {\n var self = this,\n tpl = '',\n items = '',\n previews = [],\n revoker = null;\n\n if (self.cfgs.tpl) {\n tpl = self.cfgs.tpl;\n } else {\n tpl = '
$name
\\\n \t$size
\\\n \t\\\n \t^
\\\n \tx
\\\n \t$name
\\\n \t$size
\\\n \t\\\n \t^
\\\n \tx
\\\n \t