lrz.bundle.js 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955
  1. ! function(e, t) {
  2. if("object" == typeof exports && "object" == typeof module) module.exports = t();
  3. else if("function" == typeof define && define.amd) define([], t);
  4. else {
  5. var n = t();
  6. for(var r in n)("object" == typeof exports ? exports : e)[r] = n[r]
  7. }
  8. }(this, function() {
  9. return function(e) {
  10. function t(n) {
  11. if(r[n]) return r[n].exports;
  12. var i = r[n] = {
  13. exports: {},
  14. id: n,
  15. loaded: !1
  16. };
  17. return e[n].call(i.exports, i, i.exports, t), i.loaded = !0, i.exports
  18. }
  19. var n = window.webpackJsonp;
  20. window.webpackJsonp = function(r, o) {
  21. for(var a, s, u = 0, l = []; u < r.length; u++) s = r[u], i[s] && l.push.apply(l, i[s]), i[s] = 0;
  22. for(a in o) e[a] = o[a];
  23. for(n && n(r, o); l.length;) l.shift().call(null, t)
  24. };
  25. var r = {},
  26. i = {
  27. 0: 0
  28. };
  29. return t.e = function(e, n) {
  30. if(0 === i[e]) return n.call(null, t);
  31. if(void 0 !== i[e]) i[e].push(n);
  32. else {
  33. i[e] = [n];
  34. var r = document.getElementsByTagName("head")[0],
  35. o = document.createElement("script");
  36. o.type = "text/javascript", o.charset = "utf-8", o.async = !0, o.src = t.p + "" + ({}[e] || e) + ".chunk.js", r.appendChild(o)
  37. }
  38. }, t.m = e, t.c = r, t.p = "", t(0)
  39. }([function(e, t, n) {
  40. function r(e, t) {
  41. var n = this;
  42. if(!e) throw new Error("没有收到图片,可能的解决方案:https://github.com/think2011/localResizeIMG/issues/7");
  43. t = t || {}, n.defaults = {
  44. width: null,
  45. height: null,
  46. fieldName: "file",
  47. quality: .7
  48. }, n.file = e;
  49. for(var r in t) t.hasOwnProperty(r) && (n.defaults[r] = t[r]);
  50. return this.init()
  51. }
  52. function i(e) {
  53. var t = null;
  54. return t = e ? [].filter.call(document.scripts, function(t) {
  55. return -1 !== t.src.indexOf(e)
  56. })[0] : document.scripts[document.scripts.length - 1], t ? t.src.substr(0, t.src.lastIndexOf("/")) : null
  57. }
  58. function o(e) {
  59. var t;
  60. t = e.split(",")[0].indexOf("base64") >= 0 ? atob(e.split(",")[1]) : unescape(e.split(",")[1]);
  61. for(var n = e.split(",")[0].split(":")[1].split(";")[0], r = new Uint8Array(t.length), i = 0; i < t.length; i++) r[i] = t.charCodeAt(i);
  62. return new s.Blob([r.buffer], {
  63. type: n
  64. })
  65. }
  66. n.p = i("lrz") + "/", window.URL = window.URL || window.webkitURL;
  67. var a = n(1),
  68. s = n(4),
  69. u = n(5),
  70. l = function(e) {
  71. var t = /OS (\d)_.* like Mac OS X/g.exec(e),
  72. n = /Android (\d.*?);/g.exec(e) || /Android\/(\d.*?) /g.exec(e);
  73. return {
  74. oldIOS: t ? +t.pop() < 8 : !1,
  75. oldAndroid: n ? +n.pop().substr(0, 3) < 4.5 : !1,
  76. iOS: /\(i[^;]+;( U;)? CPU.+Mac OS X/.test(e),
  77. android: /Android/g.test(e),
  78. mQQBrowser: /MQQBrowser/g.test(e)
  79. }
  80. }(navigator.userAgent);
  81. r.prototype.init = function() {
  82. var e = this,
  83. t = e.file,
  84. n = "string" == typeof t,
  85. r = /^data:/.test(t),
  86. i = new Image,
  87. u = document.createElement("canvas"),
  88. l = n ? t : URL.createObjectURL(t);
  89. if(e.img = i, e.blob = l, e.canvas = u, n ? e.fileName = r ? "base64.jpg" : t.split("/").pop() : e.fileName = t.name, !document.createElement("canvas").getContext) throw new Error("浏览器不支持canvas");
  90. return new a(function(n, a) {
  91. i.onerror = function() {
  92. var e = new Error("加载图片文件失败");
  93. throw a(e), e
  94. }, i.onload = function() {
  95. e._getBase64().then(function(e) {
  96. if(e.length < 10) {
  97. var t = new Error("生成base64失败");
  98. throw a(t), t
  99. }
  100. return e
  101. }).then(function(r) {
  102. var i = null;
  103. "object" == typeof e.file && r.length > e.file.size ? (i = new FormData, t = e.file) : (i = new s.FormData, t = o(r)), i.append(e.defaults.fieldName, t, e.fileName.replace(/\..+/g, ".jpg")), n({
  104. formData: i,
  105. fileLen: +t.size,
  106. base64: r,
  107. base64Len: r.length,
  108. origin: e.file,
  109. file: t
  110. });
  111. for(var a in e) e.hasOwnProperty(a) && (e[a] = null);
  112. URL.revokeObjectURL(e.blob)
  113. })
  114. }, !r && (i.crossOrigin = "*"), i.src = l
  115. })
  116. }, r.prototype._getBase64 = function() {
  117. var e = this,
  118. t = e.img,
  119. n = e.file,
  120. r = e.canvas;
  121. return new a(function(i) {
  122. try {
  123. u.getData("object" == typeof n ? n : t, function() {
  124. e.orientation = u.getTag(this, "Orientation"), e.resize = e._getResize(), e.ctx = r.getContext("2d"), r.width = e.resize.width, r.height = e.resize.height, e.ctx.fillStyle = "#fff", e.ctx.fillRect(0, 0, r.width, r.height), l.oldIOS ? e._createBase64ForOldIOS().then(i) : e._createBase64().then(i)
  125. })
  126. } catch(o) {
  127. throw new Error(o)
  128. }
  129. })
  130. }, r.prototype._createBase64ForOldIOS = function() {
  131. var e = this,
  132. t = e.img,
  133. r = e.canvas,
  134. i = e.defaults,
  135. o = e.orientation;
  136. return new a(function(e) {
  137. n.e(1, function(n) {
  138. var a = [n(6)];
  139. (function(n) {
  140. var a = new n(t);
  141. "5678".indexOf(o) > -1 ? a.render(r, {
  142. width: r.height,
  143. height: r.width,
  144. orientation: o
  145. }) : a.render(r, {
  146. width: r.width,
  147. height: r.height,
  148. orientation: o
  149. }), e(r.toDataURL("image/jpeg", i.quality))
  150. }).apply(null, a)
  151. })
  152. })
  153. }, r.prototype._createBase64 = function() {
  154. var e = this,
  155. t = e.resize,
  156. r = e.img,
  157. i = e.canvas,
  158. o = e.ctx,
  159. s = e.defaults,
  160. u = e.orientation;
  161. switch(u) {
  162. case 3:
  163. o.rotate(180 * Math.PI / 180), o.drawImage(r, -t.width, -t.height, t.width, t.height);
  164. break;
  165. case 6:
  166. o.rotate(90 * Math.PI / 180), o.drawImage(r, 0, -t.width, t.height, t.width);
  167. break;
  168. case 8:
  169. o.rotate(270 * Math.PI / 180), o.drawImage(r, -t.height, 0, t.height, t.width);
  170. break;
  171. case 2:
  172. o.translate(t.width, 0), o.scale(-1, 1), o.drawImage(r, 0, 0, t.width, t.height);
  173. break;
  174. case 4:
  175. o.translate(t.width, 0), o.scale(-1, 1), o.rotate(180 * Math.PI / 180), o.drawImage(r, -t.width, -t.height, t.width, t.height);
  176. break;
  177. case 5:
  178. o.translate(t.width, 0), o.scale(-1, 1), o.rotate(90 * Math.PI / 180), o.drawImage(r, 0, -t.width, t.height, t.width);
  179. break;
  180. case 7:
  181. o.translate(t.width, 0), o.scale(-1, 1), o.rotate(270 * Math.PI / 180), o.drawImage(r, -t.height, 0, t.height, t.width);
  182. break;
  183. default:
  184. o.drawImage(r, 0, 0, t.width, t.height)
  185. }
  186. return new a(function(e) {
  187. l.oldAndroid || l.mQQBrowser || !navigator.userAgent ? n.e(2, function(t) {
  188. var n = [t(7)];
  189. (function(t) {
  190. var n = new t,
  191. r = o.getImageData(0, 0, i.width, i.height);
  192. e(n.encode(r, 100 * s.quality))
  193. }).apply(null, n)
  194. }) : e(i.toDataURL("image/jpeg", s.quality))
  195. })
  196. }, r.prototype._getResize = function() {
  197. var e = this,
  198. t = e.img,
  199. n = e.defaults,
  200. r = n.width,
  201. i = n.height,
  202. o = e.orientation,
  203. a = {
  204. width: t.width,
  205. height: t.height
  206. };
  207. if("5678".indexOf(o) > -1 && (a.width = t.height, a.height = t.width), a.width < r || a.height < i) return a;
  208. var s = a.width / a.height;
  209. for(r && i ? s >= r / i ? a.width > r && (a.width = r, a.height = Math.ceil(r / s)) : a.height > i && (a.height = i, a.width = Math.ceil(i * s)) : r ? r < a.width && (a.width = r, a.height = Math.ceil(r / s)) : i && i < a.height && (a.width = Math.ceil(i * s), a.height = i); a.width >= 3264 || a.height >= 2448;) a.width *= .8, a.height *= .8;
  210. return a
  211. }, window.lrz = function(e, t) {
  212. return new r(e, t)
  213. }, window.lrz.version = "4.9.40", e.exports = window.lrz
  214. }, function(e, t, n) {
  215. (function(t) {
  216. ! function(n) {
  217. function r(e, t) {
  218. return function() {
  219. e.apply(t, arguments)
  220. }
  221. }
  222. function i(e) {
  223. if("object" != typeof this) throw new TypeError("Promises must be constructed via new");
  224. if("function" != typeof e) throw new TypeError("not a function");
  225. this._state = null, this._value = null, this._deferreds = [], c(e, r(a, this), r(s, this))
  226. }
  227. function o(e) {
  228. var t = this;
  229. return null === this._state ? void this._deferreds.push(e) : void f(function() {
  230. var n = t._state ? e.onFulfilled : e.onRejected;
  231. if(null === n) return void(t._state ? e.resolve : e.reject)(t._value);
  232. var r;
  233. try {
  234. r = n(t._value)
  235. } catch(i) {
  236. return void e.reject(i)
  237. }
  238. e.resolve(r)
  239. })
  240. }
  241. function a(e) {
  242. try {
  243. if(e === this) throw new TypeError("A promise cannot be resolved with itself.");
  244. if(e && ("object" == typeof e || "function" == typeof e)) {
  245. var t = e.then;
  246. if("function" == typeof t) return void c(r(t, e), r(a, this), r(s, this))
  247. }
  248. this._state = !0, this._value = e, u.call(this)
  249. } catch(n) {
  250. s.call(this, n)
  251. }
  252. }
  253. function s(e) {
  254. this._state = !1, this._value = e, u.call(this)
  255. }
  256. function u() {
  257. for(var e = 0, t = this._deferreds.length; t > e; e++) o.call(this, this._deferreds[e]);
  258. this._deferreds = null
  259. }
  260. function l(e, t, n, r) {
  261. this.onFulfilled = "function" == typeof e ? e : null, this.onRejected = "function" == typeof t ? t : null, this.resolve = n, this.reject = r
  262. }
  263. function c(e, t, n) {
  264. var r = !1;
  265. try {
  266. e(function(e) {
  267. r || (r = !0, t(e))
  268. }, function(e) {
  269. r || (r = !0, n(e))
  270. })
  271. } catch(i) {
  272. if(r) return;
  273. r = !0, n(i)
  274. }
  275. }
  276. var f = "function" == typeof t && t || function(e) {
  277. setTimeout(e, 1)
  278. },
  279. d = Array.isArray || function(e) {
  280. return "[object Array]" === Object.prototype.toString.call(e)
  281. };
  282. i.prototype["catch"] = function(e) {
  283. return this.then(null, e)
  284. }, i.prototype.then = function(e, t) {
  285. var n = this;
  286. return new i(function(r, i) {
  287. o.call(n, new l(e, t, r, i))
  288. })
  289. }, i.all = function() {
  290. var e = Array.prototype.slice.call(1 === arguments.length && d(arguments[0]) ? arguments[0] : arguments);
  291. return new i(function(t, n) {
  292. function r(o, a) {
  293. try {
  294. if(a && ("object" == typeof a || "function" == typeof a)) {
  295. var s = a.then;
  296. if("function" == typeof s) return void s.call(a, function(e) {
  297. r(o, e)
  298. }, n)
  299. }
  300. e[o] = a, 0 === --i && t(e)
  301. } catch(u) {
  302. n(u)
  303. }
  304. }
  305. if(0 === e.length) return t([]);
  306. for(var i = e.length, o = 0; o < e.length; o++) r(o, e[o])
  307. })
  308. }, i.resolve = function(e) {
  309. return e && "object" == typeof e && e.constructor === i ? e : new i(function(t) {
  310. t(e)
  311. })
  312. }, i.reject = function(e) {
  313. return new i(function(t, n) {
  314. n(e)
  315. })
  316. }, i.race = function(e) {
  317. return new i(function(t, n) {
  318. for(var r = 0, i = e.length; i > r; r++) e[r].then(t, n)
  319. })
  320. }, i._setImmediateFn = function(e) {
  321. f = e
  322. }, i.prototype.always = function(e) {
  323. var t = this.constructor;
  324. return this.then(function(n) {
  325. return t.resolve(e()).then(function() {
  326. return n
  327. })
  328. }, function(n) {
  329. return t.resolve(e()).then(function() {
  330. throw n
  331. })
  332. })
  333. }, "undefined" != typeof e && e.exports ? e.exports = i : n.Promise || (n.Promise = i)
  334. }(this)
  335. }).call(t, n(2).setImmediate)
  336. }, function(e, t, n) {
  337. (function(e, r) {
  338. function i(e, t) {
  339. this._id = e, this._clearFn = t
  340. }
  341. var o = n(3).nextTick,
  342. a = Function.prototype.apply,
  343. s = Array.prototype.slice,
  344. u = {},
  345. l = 0;
  346. t.setTimeout = function() {
  347. return new i(a.call(setTimeout, window, arguments), clearTimeout)
  348. }, t.setInterval = function() {
  349. return new i(a.call(setInterval, window, arguments), clearInterval)
  350. }, t.clearTimeout = t.clearInterval = function(e) {
  351. e.close()
  352. }, i.prototype.unref = i.prototype.ref = function() {}, i.prototype.close = function() {
  353. this._clearFn.call(window, this._id)
  354. }, t.enroll = function(e, t) {
  355. clearTimeout(e._idleTimeoutId), e._idleTimeout = t
  356. }, t.unenroll = function(e) {
  357. clearTimeout(e._idleTimeoutId), e._idleTimeout = -1
  358. }, t._unrefActive = t.active = function(e) {
  359. clearTimeout(e._idleTimeoutId);
  360. var t = e._idleTimeout;
  361. t >= 0 && (e._idleTimeoutId = setTimeout(function() {
  362. e._onTimeout && e._onTimeout()
  363. }, t))
  364. }, t.setImmediate = "function" == typeof e ? e : function(e) {
  365. var n = l++,
  366. r = arguments.length < 2 ? !1 : s.call(arguments, 1);
  367. return u[n] = !0, o(function() {
  368. u[n] && (r ? e.apply(null, r) : e.call(null), t.clearImmediate(n))
  369. }), n
  370. }, t.clearImmediate = "function" == typeof r ? r : function(e) {
  371. delete u[e]
  372. }
  373. }).call(t, n(2).setImmediate, n(2).clearImmediate)
  374. }, function(e, t) {
  375. function n() {
  376. l = !1, a.length ? u = a.concat(u) : c = -1, u.length && r()
  377. }
  378. function r() {
  379. if(!l) {
  380. var e = setTimeout(n);
  381. l = !0;
  382. for(var t = u.length; t;) {
  383. for(a = u, u = []; ++c < t;) a && a[c].run();
  384. c = -1, t = u.length
  385. }
  386. a = null, l = !1, clearTimeout(e)
  387. }
  388. }
  389. function i(e, t) {
  390. this.fun = e, this.array = t
  391. }
  392. function o() {}
  393. var a, s = e.exports = {},
  394. u = [],
  395. l = !1,
  396. c = -1;
  397. s.nextTick = function(e) {
  398. var t = new Array(arguments.length - 1);
  399. if(arguments.length > 1)
  400. for(var n = 1; n < arguments.length; n++) t[n - 1] = arguments[n];
  401. u.push(new i(e, t)), 1 !== u.length || l || setTimeout(r, 0)
  402. }, i.prototype.run = function() {
  403. this.fun.apply(null, this.array)
  404. }, s.title = "browser", s.browser = !0, s.env = {}, s.argv = [], s.version = "", s.versions = {}, s.on = o, s.addListener = o, s.once = o, s.off = o, s.removeListener = o, s.removeAllListeners = o, s.emit = o, s.binding = function(e) {
  405. throw new Error("process.binding is not supported")
  406. }, s.cwd = function() {
  407. return "/"
  408. }, s.chdir = function(e) {
  409. throw new Error("process.chdir is not supported")
  410. }, s.umask = function() {
  411. return 0
  412. }
  413. }, function(e, t) {
  414. function n() {
  415. var e = ~navigator.userAgent.indexOf("Android") && ~navigator.vendor.indexOf("Google") && !~navigator.userAgent.indexOf("Chrome");
  416. return e && navigator.userAgent.match(/AppleWebKit\/(\d+)/).pop() <= 534 || /MQQBrowser/g.test(navigator.userAgent)
  417. }
  418. var r = function() {
  419. try {
  420. return new Blob, !0
  421. } catch(e) {
  422. return !1
  423. }
  424. }() ? window.Blob : function(e, t) {
  425. var n = new(window.BlobBuilder || window.WebKitBlobBuilder || window.MSBlobBuilder || window.MozBlobBuilder);
  426. return e.forEach(function(e) {
  427. n.append(e)
  428. }), n.getBlob(t ? t.type : void 0)
  429. },
  430. i = function() {
  431. function e() {
  432. var e = this,
  433. n = [],
  434. i = Array(21).join("-") + (+new Date * (1e16 * Math.random())).toString(36),
  435. o = XMLHttpRequest.prototype.send;
  436. this.getParts = function() {
  437. return n.toString()
  438. }, this.append = function(e, t, r) {
  439. n.push("--" + i + '\r\nContent-Disposition: form-data; name="' + e + '"'), t instanceof Blob ? (n.push('; filename="' + (r || "blob") + '"\r\nContent-Type: ' + t.type + "\r\n\r\n"), n.push(t)) : n.push("\r\n\r\n" + t), n.push("\r\n")
  440. }, t++, XMLHttpRequest.prototype.send = function(a) {
  441. var s, u, l = this;
  442. a === e ? (n.push("--" + i + "--\r\n"), u = new r(n), s = new FileReader, s.onload = function() {
  443. o.call(l, s.result)
  444. }, s.onerror = function(e) {
  445. throw e
  446. }, s.readAsArrayBuffer(u), this.setRequestHeader("Content-Type", "multipart/form-data; boundary=" + i), t--, 0 == t && (XMLHttpRequest.prototype.send = o)) : o.call(this, a)
  447. }
  448. }
  449. var t = 0;
  450. return e.prototype = Object.create(FormData.prototype), e
  451. }();
  452. e.exports = {
  453. Blob: r,
  454. FormData: n() ? i : FormData
  455. }
  456. }, function(e, t, n) {
  457. var r, i;
  458. (function() {
  459. function n(e) {
  460. return !!e.exifdata
  461. }
  462. function o(e, t) {
  463. t = t || e.match(/^data\:([^\;]+)\;base64,/im)[1] || "", e = e.replace(/^data\:([^\;]+)\;base64,/gim, "");
  464. for(var n = atob(e), r = n.length, i = new ArrayBuffer(r), o = new Uint8Array(i), a = 0; r > a; a++) o[a] = n.charCodeAt(a);
  465. return i
  466. }
  467. function a(e, t) {
  468. var n = new XMLHttpRequest;
  469. n.open("GET", e, !0), n.responseType = "blob", n.onload = function(e) {
  470. (200 == this.status || 0 === this.status) && t(this.response)
  471. }, n.send()
  472. }
  473. function s(e, t) {
  474. function n(n) {
  475. var r = u(n),
  476. i = l(n);
  477. e.exifdata = r || {}, e.iptcdata = i || {}, t && t.call(e)
  478. }
  479. if(e.src)
  480. if(/^data\:/i.test(e.src)) {
  481. var r = o(e.src);
  482. n(r)
  483. } else if(/^blob\:/i.test(e.src)) {
  484. var i = new FileReader;
  485. i.onload = function(e) {
  486. n(e.target.result)
  487. }, a(e.src, function(e) {
  488. i.readAsArrayBuffer(e)
  489. })
  490. } else {
  491. var s = new XMLHttpRequest;
  492. s.onload = function() { 0 === this.status ? n(s.response) : t(new Error("Could not load image")), s = null
  493. }, s.open("GET", e.src, !0), s.responseType = "arraybuffer", s.send(null)
  494. } else if(window.FileReader && (e instanceof window.Blob || e instanceof window.File)) {
  495. var i = new FileReader;
  496. i.onload = function(e) {
  497. p && console.log("Got file of length " + e.target.result.byteLength), n(e.target.result)
  498. }, i.readAsArrayBuffer(e)
  499. }
  500. }
  501. function u(e) {
  502. var t = new DataView(e);
  503. if(p && console.log("Got file of length " + e.byteLength), 255 != t.getUint8(0) || 216 != t.getUint8(1)) return p && console.log("Not a valid JPEG"), !1;
  504. for(var n, r = 2, i = e.byteLength; i > r;) {
  505. if(255 != t.getUint8(r)) return p && console.log("Not a valid marker at offset " + r + ", found: " + t.getUint8(r)), !1;
  506. if(n = t.getUint8(r + 1), p && console.log(n), 225 == n) return p && console.log("Found 0xFFE1 marker"), g(t, r + 4, t.getUint16(r + 2) - 2);
  507. r += 2 + t.getUint16(r + 2)
  508. }
  509. }
  510. function l(e) {
  511. var t = new DataView(e);
  512. if(p && console.log("Got file of length " + e.byteLength), 255 != t.getUint8(0) || 216 != t.getUint8(1)) return p && console.log("Not a valid JPEG"), !1;
  513. for(var n = 2, r = e.byteLength, i = function(e, t) {
  514. return 56 === e.getUint8(t) && 66 === e.getUint8(t + 1) && 73 === e.getUint8(t + 2) && 77 === e.getUint8(t + 3) && 4 === e.getUint8(t + 4) && 4 === e.getUint8(t + 5)
  515. }; r > n;) {
  516. if(i(t, n)) {
  517. var o = t.getUint8(n + 7);
  518. o % 2 !== 0 && (o += 1), 0 === o && (o = 4);
  519. var a = n + 8 + o,
  520. s = t.getUint16(n + 6 + o);
  521. return c(e, a, s)
  522. }
  523. n++
  524. }
  525. }
  526. function c(e, t, n) {
  527. for(var r, i, o, a, s, u = new DataView(e), l = {}, c = t; t + n > c;) 28 === u.getUint8(c) && 2 === u.getUint8(c + 1) && (a = u.getUint8(c + 2), a in b && (o = u.getInt16(c + 3), s = o + 5, i = b[a], r = h(u, c + 5, o), l.hasOwnProperty(i) ? l[i] instanceof Array ? l[i].push(r) : l[i] = [l[i], r] : l[i] = r)), c++;
  528. return l
  529. }
  530. function f(e, t, n, r, i) {
  531. var o, a, s, u = e.getUint16(n, !i),
  532. l = {};
  533. for(s = 0; u > s; s++) o = n + 12 * s + 2, a = r[e.getUint16(o, !i)], !a && p && console.log("Unknown tag: " + e.getUint16(o, !i)), l[a] = d(e, o, t, n, i);
  534. return l
  535. }
  536. function d(e, t, n, r, i) {
  537. var o, a, s, u, l, c, f = e.getUint16(t + 2, !i),
  538. d = e.getUint32(t + 4, !i),
  539. g = e.getUint32(t + 8, !i) + n;
  540. switch(f) {
  541. case 1:
  542. case 7:
  543. if(1 == d) return e.getUint8(t + 8, !i);
  544. for(o = d > 4 ? g : t + 8, a = [], u = 0; d > u; u++) a[u] = e.getUint8(o + u);
  545. return a;
  546. case 2:
  547. return o = d > 4 ? g : t + 8, h(e, o, d - 1);
  548. case 3:
  549. if(1 == d) return e.getUint16(t + 8, !i);
  550. for(o = d > 2 ? g : t + 8, a = [], u = 0; d > u; u++) a[u] = e.getUint16(o + 2 * u, !i);
  551. return a;
  552. case 4:
  553. if(1 == d) return e.getUint32(t + 8, !i);
  554. for(a = [], u = 0; d > u; u++) a[u] = e.getUint32(g + 4 * u, !i);
  555. return a;
  556. case 5:
  557. if(1 == d) return l = e.getUint32(g, !i), c = e.getUint32(g + 4, !i), s = new Number(l / c), s.numerator = l, s.denominator = c, s;
  558. for(a = [], u = 0; d > u; u++) l = e.getUint32(g + 8 * u, !i), c = e.getUint32(g + 4 + 8 * u, !i), a[u] = new Number(l / c), a[u].numerator = l, a[u].denominator = c;
  559. return a;
  560. case 9:
  561. if(1 == d) return e.getInt32(t + 8, !i);
  562. for(a = [], u = 0; d > u; u++) a[u] = e.getInt32(g + 4 * u, !i);
  563. return a;
  564. case 10:
  565. if(1 == d) return e.getInt32(g, !i) / e.getInt32(g + 4, !i);
  566. for(a = [], u = 0; d > u; u++) a[u] = e.getInt32(g + 8 * u, !i) / e.getInt32(g + 4 + 8 * u, !i);
  567. return a
  568. }
  569. }
  570. function h(e, t, n) {
  571. var r, i = "";
  572. for(r = t; t + n > r; r++) i += String.fromCharCode(e.getUint8(r));
  573. return i
  574. }
  575. function g(e, t) {
  576. if("Exif" != h(e, t, 4)) return p && console.log("Not valid EXIF data! " + h(e, t, 4)), !1;
  577. var n, r, i, o, a, s = t + 6;
  578. if(18761 == e.getUint16(s)) n = !1;
  579. else {
  580. if(19789 != e.getUint16(s)) return p && console.log("Not valid TIFF data! (no 0x4949 or 0x4D4D)"), !1;
  581. n = !0
  582. }
  583. if(42 != e.getUint16(s + 2, !n)) return p && console.log("Not valid TIFF data! (no 0x002A)"), !1;
  584. var u = e.getUint32(s + 4, !n);
  585. if(8 > u) return p && console.log("Not valid TIFF data! (First offset less than 8)", e.getUint32(s + 4, !n)), !1;
  586. if(r = f(e, s, s + u, y, n), r.ExifIFDPointer) {
  587. o = f(e, s, s + r.ExifIFDPointer, w, n);
  588. for(i in o) {
  589. switch(i) {
  590. case "LightSource":
  591. case "Flash":
  592. case "MeteringMode":
  593. case "ExposureProgram":
  594. case "SensingMethod":
  595. case "SceneCaptureType":
  596. case "SceneType":
  597. case "CustomRendered":
  598. case "WhiteBalance":
  599. case "GainControl":
  600. case "Contrast":
  601. case "Saturation":
  602. case "Sharpness":
  603. case "SubjectDistanceRange":
  604. case "FileSource":
  605. o[i] = S[i][o[i]];
  606. break;
  607. case "ExifVersion":
  608. case "FlashpixVersion":
  609. o[i] = String.fromCharCode(o[i][0], o[i][1], o[i][2], o[i][3]);
  610. break;
  611. case "ComponentsConfiguration":
  612. o[i] = S.Components[o[i][0]] + S.Components[o[i][1]] + S.Components[o[i][2]] + S.Components[o[i][3]]
  613. }
  614. r[i] = o[i]
  615. }
  616. }
  617. if(r.GPSInfoIFDPointer) {
  618. a = f(e, s, s + r.GPSInfoIFDPointer, v, n);
  619. for(i in a) {
  620. switch(i) {
  621. case "GPSVersionID":
  622. a[i] = a[i][0] + "." + a[i][1] + "." + a[i][2] + "." + a[i][3]
  623. }
  624. r[i] = a[i]
  625. }
  626. }
  627. return r
  628. }
  629. var p = !1,
  630. m = function(e) {
  631. return e instanceof m ? e : this instanceof m ? void(this.EXIFwrapped = e) : new m(e)
  632. };
  633. "undefined" != typeof e && e.exports && (t = e.exports = m), t.EXIF = m;
  634. var w = m.Tags = {
  635. 36864: "ExifVersion",
  636. 40960: "FlashpixVersion",
  637. 40961: "ColorSpace",
  638. 40962: "PixelXDimension",
  639. 40963: "PixelYDimension",
  640. 37121: "ComponentsConfiguration",
  641. 37122: "CompressedBitsPerPixel",
  642. 37500: "MakerNote",
  643. 37510: "UserComment",
  644. 40964: "RelatedSoundFile",
  645. 36867: "DateTimeOriginal",
  646. 36868: "DateTimeDigitized",
  647. 37520: "SubsecTime",
  648. 37521: "SubsecTimeOriginal",
  649. 37522: "SubsecTimeDigitized",
  650. 33434: "ExposureTime",
  651. 33437: "FNumber",
  652. 34850: "ExposureProgram",
  653. 34852: "SpectralSensitivity",
  654. 34855: "ISOSpeedRatings",
  655. 34856: "OECF",
  656. 37377: "ShutterSpeedValue",
  657. 37378: "ApertureValue",
  658. 37379: "BrightnessValue",
  659. 37380: "ExposureBias",
  660. 37381: "MaxApertureValue",
  661. 37382: "SubjectDistance",
  662. 37383: "MeteringMode",
  663. 37384: "LightSource",
  664. 37385: "Flash",
  665. 37396: "SubjectArea",
  666. 37386: "FocalLength",
  667. 41483: "FlashEnergy",
  668. 41484: "SpatialFrequencyResponse",
  669. 41486: "FocalPlaneXResolution",
  670. 41487: "FocalPlaneYResolution",
  671. 41488: "FocalPlaneResolutionUnit",
  672. 41492: "SubjectLocation",
  673. 41493: "ExposureIndex",
  674. 41495: "SensingMethod",
  675. 41728: "FileSource",
  676. 41729: "SceneType",
  677. 41730: "CFAPattern",
  678. 41985: "CustomRendered",
  679. 41986: "ExposureMode",
  680. 41987: "WhiteBalance",
  681. 41988: "DigitalZoomRation",
  682. 41989: "FocalLengthIn35mmFilm",
  683. 41990: "SceneCaptureType",
  684. 41991: "GainControl",
  685. 41992: "Contrast",
  686. 41993: "Saturation",
  687. 41994: "Sharpness",
  688. 41995: "DeviceSettingDescription",
  689. 41996: "SubjectDistanceRange",
  690. 40965: "InteroperabilityIFDPointer",
  691. 42016: "ImageUniqueID"
  692. },
  693. y = m.TiffTags = {
  694. 256: "ImageWidth",
  695. 257: "ImageHeight",
  696. 34665: "ExifIFDPointer",
  697. 34853: "GPSInfoIFDPointer",
  698. 40965: "InteroperabilityIFDPointer",
  699. 258: "BitsPerSample",
  700. 259: "Compression",
  701. 262: "PhotometricInterpretation",
  702. 274: "Orientation",
  703. 277: "SamplesPerPixel",
  704. 284: "PlanarConfiguration",
  705. 530: "YCbCrSubSampling",
  706. 531: "YCbCrPositioning",
  707. 282: "XResolution",
  708. 283: "YResolution",
  709. 296: "ResolutionUnit",
  710. 273: "StripOffsets",
  711. 278: "RowsPerStrip",
  712. 279: "StripByteCounts",
  713. 513: "JPEGInterchangeFormat",
  714. 514: "JPEGInterchangeFormatLength",
  715. 301: "TransferFunction",
  716. 318: "WhitePoint",
  717. 319: "PrimaryChromaticities",
  718. 529: "YCbCrCoefficients",
  719. 532: "ReferenceBlackWhite",
  720. 306: "DateTime",
  721. 270: "ImageDescription",
  722. 271: "Make",
  723. 272: "Model",
  724. 305: "Software",
  725. 315: "Artist",
  726. 33432: "Copyright"
  727. },
  728. v = m.GPSTags = {
  729. 0: "GPSVersionID",
  730. 1: "GPSLatitudeRef",
  731. 2: "GPSLatitude",
  732. 3: "GPSLongitudeRef",
  733. 4: "GPSLongitude",
  734. 5: "GPSAltitudeRef",
  735. 6: "GPSAltitude",
  736. 7: "GPSTimeStamp",
  737. 8: "GPSSatellites",
  738. 9: "GPSStatus",
  739. 10: "GPSMeasureMode",
  740. 11: "GPSDOP",
  741. 12: "GPSSpeedRef",
  742. 13: "GPSSpeed",
  743. 14: "GPSTrackRef",
  744. 15: "GPSTrack",
  745. 16: "GPSImgDirectionRef",
  746. 17: "GPSImgDirection",
  747. 18: "GPSMapDatum",
  748. 19: "GPSDestLatitudeRef",
  749. 20: "GPSDestLatitude",
  750. 21: "GPSDestLongitudeRef",
  751. 22: "GPSDestLongitude",
  752. 23: "GPSDestBearingRef",
  753. 24: "GPSDestBearing",
  754. 25: "GPSDestDistanceRef",
  755. 26: "GPSDestDistance",
  756. 27: "GPSProcessingMethod",
  757. 28: "GPSAreaInformation",
  758. 29: "GPSDateStamp",
  759. 30: "GPSDifferential"
  760. },
  761. S = m.StringValues = {
  762. ExposureProgram: {
  763. 0: "Not defined",
  764. 1: "Manual",
  765. 2: "Normal program",
  766. 3: "Aperture priority",
  767. 4: "Shutter priority",
  768. 5: "Creative program",
  769. 6: "Action program",
  770. 7: "Portrait mode",
  771. 8: "Landscape mode"
  772. },
  773. MeteringMode: {
  774. 0: "Unknown",
  775. 1: "Average",
  776. 2: "CenterWeightedAverage",
  777. 3: "Spot",
  778. 4: "MultiSpot",
  779. 5: "Pattern",
  780. 6: "Partial",
  781. 255: "Other"
  782. },
  783. LightSource: {
  784. 0: "Unknown",
  785. 1: "Daylight",
  786. 2: "Fluorescent",
  787. 3: "Tungsten (incandescent light)",
  788. 4: "Flash",
  789. 9: "Fine weather",
  790. 10: "Cloudy weather",
  791. 11: "Shade",
  792. 12: "Daylight fluorescent (D 5700 - 7100K)",
  793. 13: "Day white fluorescent (N 4600 - 5400K)",
  794. 14: "Cool white fluorescent (W 3900 - 4500K)",
  795. 15: "White fluorescent (WW 3200 - 3700K)",
  796. 17: "Standard light A",
  797. 18: "Standard light B",
  798. 19: "Standard light C",
  799. 20: "D55",
  800. 21: "D65",
  801. 22: "D75",
  802. 23: "D50",
  803. 24: "ISO studio tungsten",
  804. 255: "Other"
  805. },
  806. Flash: {
  807. 0: "Flash did not fire",
  808. 1: "Flash fired",
  809. 5: "Strobe return light not detected",
  810. 7: "Strobe return light detected",
  811. 9: "Flash fired, compulsory flash mode",
  812. 13: "Flash fired, compulsory flash mode, return light not detected",
  813. 15: "Flash fired, compulsory flash mode, return light detected",
  814. 16: "Flash did not fire, compulsory flash mode",
  815. 24: "Flash did not fire, auto mode",
  816. 25: "Flash fired, auto mode",
  817. 29: "Flash fired, auto mode, return light not detected",
  818. 31: "Flash fired, auto mode, return light detected",
  819. 32: "No flash function",
  820. 65: "Flash fired, red-eye reduction mode",
  821. 69: "Flash fired, red-eye reduction mode, return light not detected",
  822. 71: "Flash fired, red-eye reduction mode, return light detected",
  823. 73: "Flash fired, compulsory flash mode, red-eye reduction mode",
  824. 77: "Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",
  825. 79: "Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",
  826. 89: "Flash fired, auto mode, red-eye reduction mode",
  827. 93: "Flash fired, auto mode, return light not detected, red-eye reduction mode",
  828. 95: "Flash fired, auto mode, return light detected, red-eye reduction mode"
  829. },
  830. SensingMethod: {
  831. 1: "Not defined",
  832. 2: "One-chip color area sensor",
  833. 3: "Two-chip color area sensor",
  834. 4: "Three-chip color area sensor",
  835. 5: "Color sequential area sensor",
  836. 7: "Trilinear sensor",
  837. 8: "Color sequential linear sensor"
  838. },
  839. SceneCaptureType: {
  840. 0: "Standard",
  841. 1: "Landscape",
  842. 2: "Portrait",
  843. 3: "Night scene"
  844. },
  845. SceneType: {
  846. 1: "Directly photographed"
  847. },
  848. CustomRendered: {
  849. 0: "Normal process",
  850. 1: "Custom process"
  851. },
  852. WhiteBalance: {
  853. 0: "Auto white balance",
  854. 1: "Manual white balance"
  855. },
  856. GainControl: {
  857. 0: "None",
  858. 1: "Low gain up",
  859. 2: "High gain up",
  860. 3: "Low gain down",
  861. 4: "High gain down"
  862. },
  863. Contrast: {
  864. 0: "Normal",
  865. 1: "Soft",
  866. 2: "Hard"
  867. },
  868. Saturation: {
  869. 0: "Normal",
  870. 1: "Low saturation",
  871. 2: "High saturation"
  872. },
  873. Sharpness: {
  874. 0: "Normal",
  875. 1: "Soft",
  876. 2: "Hard"
  877. },
  878. SubjectDistanceRange: {
  879. 0: "Unknown",
  880. 1: "Macro",
  881. 2: "Close view",
  882. 3: "Distant view"
  883. },
  884. FileSource: {
  885. 3: "DSC"
  886. },
  887. Components: {
  888. 0: "",
  889. 1: "Y",
  890. 2: "Cb",
  891. 3: "Cr",
  892. 4: "R",
  893. 5: "G",
  894. 6: "B"
  895. }
  896. },
  897. b = {
  898. 120: "caption",
  899. 110: "credit",
  900. 25: "keywords",
  901. 55: "dateCreated",
  902. 80: "byline",
  903. 85: "bylineTitle",
  904. 122: "captionWriter",
  905. 105: "headline",
  906. 116: "copyright",
  907. 15: "category"
  908. };
  909. m.getData = function(e, t) {
  910. return(e instanceof Image || e instanceof HTMLImageElement) && !e.complete ? !1 : (n(e) ? t && t.call(e) : s(e, t), !0)
  911. }, m.getTag = function(e, t) {
  912. return n(e) ? e.exifdata[t] : void 0
  913. }, m.getAllTags = function(e) {
  914. if(!n(e)) return {};
  915. var t, r = e.exifdata,
  916. i = {};
  917. for(t in r) r.hasOwnProperty(t) && (i[t] = r[t]);
  918. return i
  919. }, m.pretty = function(e) {
  920. if(!n(e)) return "";
  921. var t, r = e.exifdata,
  922. i = "";
  923. for(t in r) r.hasOwnProperty(t) && (i += "object" == typeof r[t] ? r[t] instanceof Number ? t + " : " + r[t] + " [" + r[t].numerator + "/" + r[t].denominator + "]\r\n" : t + " : [" + r[t].length + " values]\r\n" : t + " : " + r[t] + "\r\n");
  924. return i
  925. }, m.readFromBinaryFile = function(e) {
  926. return u(e)
  927. }, r = [], i = function() {
  928. return m
  929. }.apply(t, r), !(void 0 !== i && (e.exports = i))
  930. }).call(this)
  931. }])
  932. });
  933. //# sourceMappingURL=lrz.bundle.js.map