diff --git a/dist/exif-reader.js b/dist/exif-reader.js index 2eb771e..eafb168 100644 --- a/dist/exif-reader.js +++ b/dist/exif-reader.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ExifReader=t():e.ExifReader=t()}("undefined"!=typeof self?self:this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:0,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=1,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:1,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:1})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:1,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(module,__webpack_exports__,__webpack_require__){"use strict";function get(){if("undefined"!=typeof DOMParser)return DOMParser;try{return eval("require")("xmldom").DOMParser}catch(e){return}}__webpack_exports__.a={get:get}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t,n){for(var r=[],i=0;i=8){var t=d(e.slice(0,8));if("ASCII\0\0\0"===t)return d(e.slice(8));if("JIS\0\0\0\0\0"===t)return"[JIS encoded text]";if("UNICODE\0"===t)return"[Unicode encoded text]";if("\0\0\0\0\0\0\0\0"===t)return"[Undefined encoding]"}return"Undefined"}function m(e){return e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600}var g=function(e,t){if(18761===e.getUint16(t))return 18761;if(19789===e.getUint16(t))return 19789;throw Error("Illegal byte order value. Faulty image.")};function v(e,t){return 65472===e.getUint16(t)}function h(e,t){return 65474===e.getUint16(t)}function y(e,t){return 65506===e.getUint16(t)&&"ICC_PROFILE\0"===i(e,t+4,12)}function S(e,t){return 65506===e.getUint16(t)&&"MPF\0"===i(e,t+4,4)}function b(e,t){return 65505===e.getUint16(t)&&"Exif"===i(e,t+4,4)&&0===e.getUint8(t+4+4)}function C(e,t){return 65505===e.getUint16(t)&&function(e,t){return"http://ns.adobe.com/xap/1.0/\0"===i(e,t+4,29)}(e,t)}function I(e,t){return 65505===e.getUint16(t)&&function(e,t){return"http://ns.adobe.com/xmp/extension/\0"===i(e,t+4,35)}(e,t)}function P(e,t){return{dataOffset:e+33,length:t-31}}function A(e,t){return{dataOffset:e+79,length:t-77}}function U(e,t){return 65517===e.getUint16(t)&&"Photoshop 3.0"===i(e,t+4,13)&&0===e.getUint8(t+4+13)}function w(e,t){var n=e.getUint16(t);return n>=65504&&n<=65519||65534===n||65472===n||65474===n||65476===n||65499===n||65501===n||65498===n}function D(e,t){return"IHDR"===i(e,t+4,4)}function O(e,t){return"iTXt"===i(e,t+4,4)&&"XML:com.adobe.xmp\0"===i(e,t+8,18)}function T(e,t){t+=28;for(var n=0;n<2&&t=4&&function(e){var t=18761===e.getUint16(0);return 42===e.getUint16(2,t)}(e)}(e))return{hasAppMarkers:1,tiffHeaderOffset:0};if(function(e){return e.byteLength>=2&&65496===e.getUint16(0)}(e))return function(e){for(var t,n,r,i,o,a,u,c,f=2;f+4+5<=e.byteLength;){if(v(e,f))n=f+2;else if(h(e,f))r=f+2;else if(b(e,f))t=e.getUint16(f+2),i=f+10;else if(C(e,f))a||(a=[]),t=e.getUint16(f+2),a.push(P(f,t));else if(I(e,f))a||(a=[]),t=e.getUint16(f+2),a.push(A(f,t));else if(U(e,f))t=e.getUint16(f+2),o=f+18;else if(y(e,f)){var s=f+18,l=(t=e.getUint16(f+2))-16,d=e.getUint8(f+16),p=e.getUint8(f+17);u||(u=[]),u.push({offset:s,length:l,chunkNumber:d,chunksTotal:p})}else if(S(e,f))t=e.getUint16(f+2),c=f+8;else{if(!w(e,f))break;t=e.getUint16(f+2)}f+=2+t}return{hasAppMarkers:f>2,fileDataOffset:n||r,tiffHeaderOffset:i,iptcDataOffset:o,xmpChunks:a,iccChunks:u,mpfDataOffset:c}}(e);if(function(e){return"‰PNG\r\n\n"===i(e,0,8)}(e))return function(e){for(var t={hasAppMarkers:0},n=8;n+4+4<=e.byteLength;){if(D(e,n))t.hasAppMarkers=1,t.pngHeaderOffset=n+8;else if(O(e,n)){var r=T(e,n);void 0!==r&&(t.hasAppMarkers=1,t.xmpChunks=[{dataOffset:r,length:e.getUint32(n+0)-(r-(n+8))}])}n+=e.getUint32(n+0)+4+4+4}return t}(e);if(function(e){var t=i(e,8,4);return"ftyp"===i(e,4,4)&&-1!==["heic","heix","hevc","hevx","heim","heis","hevm","hevs","mif1"].indexOf(t)}(e))return function(e){var t=function(e){for(var t=0;t+4+4<=e.byteLength;){var n=M(e,t);if(n>=8&&"meta"===i(e,t+4,4))return{offset:t,length:n};t+=n}return{offset:void 0,length:0}}(e),n=t.offset,r=t.length;if(void 0===n)return{hasAppMarkers:0};var o=Math.min(n+r,e.byteLength),a=function(e,t,n){for(var r={ilocOffset:void 0,exifItemOffset:void 0,colrOffset:void 0};t+4<=n&&(!r.ilocOffset||!r.exifItemOffset||!r.colrOffset);){var o=i(e,t,4);"iloc"===o?r.ilocOffset=t:"Exif"===o?r.exifItemOffset=t+-4:"colr"===o&&(r.colrOffset=t+-4),t++}return r}(e,n,o),u=a.exifItemOffset,c=a.ilocOffset,f=a.colrOffset,s=function(e,t,n,r){if(n&&t&&!(t+2>r)){var i=e.getUint16(t);for(n+=12;n+16<=r;){if(e.getUint16(n)===i){var o=e.getUint32(n+8);if(o+4<=e.byteLength)return o+(e.getUint32(o)+4)}n+=16}}}(e,u,c,o),l=function(e,t,n){if(t&&!(t+12>n)){var r=i(e,t+8,4);if("prof"===r||"rICC"===r)return[{offset:t+12,length:M(e,t)-12,chunkNumber:1,chunksTotal:1}]}}(e,f,o);return{hasAppMarkers:void 0!==s||void 0!==l,tiffHeaderOffset:s,iccChunks:l}}(e);if(function(e){return"RIFF"===i(e,0,4)&&"WEBP"===i(e,8,4)}(e))return function(e){for(var t,n,r,o=12,a=0;o+8e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n>31&1,e>>30&1,e>>29&1],n=[];return t[0]&&n.push("Dependent Parent Image"),t[1]&&n.push("Dependent Child Image"),t[2]&&n.push("Representative Image"),{value:t,description:n.join(", ")||"None"}}function Q(e){var t=e>>24&7;return{value:t,description:0===t?"JPEG":"Unknown"}}function Z(e){var t=16777215&e;return{value:t,description:{196608:"Baseline MP Primary Image",65537:"Large Thumbnail (VGA equivalent)",65538:"Large Thumbnail (Full HD equivalent)",131073:"Multi-Frame Image (Panorama)",131074:"Multi-Frame Image (Disparity)",131075:"Multi-Frame Image (Multi-Angle)",0:"Undefined"}[t]||"Unknown"}}function ee(e){return 0===e}function te(e,t,n,r,i){var o=k.getTypeSize("SHORT"),a={},u=function(e,t,n){return t+k.getTypeSize("SHORT")<=e.byteLength?k.getShortAt(e,t,n):0}(e,r,i);r+=o;for(var c=0;ce.byteLength);c++){var f=ne(e,t,n,r,i);void 0!==f&&(a[f.name]={id:f.id,value:f.value,description:f.description}),r+=12}if(r"}s===k.tagTypes.ASCII&&(o=function(e){try{return e.map((function(e){return decodeURIComponent(escape(e))}))}catch(t){return e}}(o=function(e){for(var t=[],n=0,r=0;r5&&void 0!==arguments[5]?arguments[5]:0,a=[];o&&(r*=k.typeSizes[n],n=k.tagTypes.BYTE);for(var u=0;un)){var r=k.getByteAt(e,t+7);return{value:r,description:""+r}}}(e,t,n);return{"Bits Per Sample":ae(e,t,n),"Image Height":ue(e,t,n),"Image Width":ce(e,t,n),"Color Components":r,Subsampling:r&&fe(e,t,r.value,n)}};function ae(e,t,n){if(!(3>n)){var r=k.getByteAt(e,t+2);return{value:r,description:""+r}}}function ue(e,t,n){if(!(5>n)){var r=k.getShortAt(e,t+3);return{value:r,description:"".concat(r,"px")}}}function ce(e,t,n){if(!(7>n)){var r=k.getShortAt(e,t+5);return{value:r,description:"".concat(r,"px")}}}function fe(e,t,n,r){if(!(8+3*n>r)){for(var i=[],o=0;o1?se(i)+le(i):""}}}function se(e){var t={1:"Y",2:"Cb",3:"Cr",4:"I",5:"Q"};return e.map((function(e){return t[e[0]]})).join("")}function le(e){var t={17:"4:4:4 (1 1)",18:"4:4:0 (1 2)",20:"4:4:1 (1 4)",33:"4:2:2 (2 1)",34:"4:2:0 (2 2)",36:"4:2:1 (2 4)",65:"4:1:1 (4 1)",66:"4:1:0 (4 2)"};return 0===e.length||void 0===e[0][1]||void 0===t[e[0][1]]?"":t[e[0][1]]}var de={iptc:{256:{name:"Model Version",description:function(e){return""+((e[0]<<8)+e[1])}},261:{name:"Destination",repeatable:1},276:{name:"File Format",description:function(e){return""+((e[0]<<8)+e[1])}},278:{name:"File Format Version",description:function(e){return""+((e[0]<<8)+e[1])}},286:"Service Identifier",296:"Envelope Number",306:"Product ID",316:"Envelope Priority",326:{name:"Date Sent",description:pe},336:{name:"Time Sent",description:me},346:{name:"Coded Character Set",description:ge,encoding_name:ge},356:"UNO",376:{name:"ARM Identifier",description:function(e){return""+((e[0]<<8)+e[1])}},378:{name:"ARM Version",description:function(e){return""+((e[0]<<8)+e[1])}},512:{name:"Record Version",description:function(e){return""+((e[0]<<8)+e[1])}},515:"Object Type Reference",516:"Object Attribute Reference",517:"Object Name",519:"Edit Status",520:{name:"Editorial Update",description:function(e){return"01"===d(e)?"Additional Language":"Unknown"}},522:"Urgency",524:{name:"Subject Reference",repeatable:1,description:function(e){var t=d(e).split(":");return t[2]+(t[3]?"/"+t[3]:"")+(t[4]?"/"+t[4]:"")}},527:"Category",532:{name:"Supplemental Category",repeatable:1},534:"Fixture Identifier",537:{name:"Keywords",repeatable:1},538:{name:"Content Location Code",repeatable:1},539:{name:"Content Location Name",repeatable:1},542:"Release Date",547:"Release Time",549:"Expiration Date",550:"Expiration Time",552:"Special Instructions",554:{name:"Action Advised",description:function(e){var t=d(e);return"01"===t?"Object Kill":"02"===t?"Object Replace":"03"===t?"Object Append":"04"===t?"Object Reference":"Unknown"}},557:{name:"Reference Service",repeatable:1},559:{name:"Reference Date",repeatable:1},562:{name:"Reference Number",repeatable:1},567:{name:"Date Created",description:pe},572:{name:"Time Created",description:me},574:{name:"Digital Creation Date",description:pe},575:{name:"Digital Creation Time",description:me},577:"Originating Program",582:"Program Version",587:{name:"Object Cycle",description:function(e){var t=d(e);return"a"===t?"morning":"p"===t?"evening":"b"===t?"both":"Unknown"}},592:{name:"By-line",repeatable:1},597:{name:"By-line Title",repeatable:1},602:"City",604:"Sub-location",607:"Province/State",612:"Country/Primary Location Code",613:"Country/Primary Location Name",615:"Original Transmission Reference",617:"Headline",622:"Credit",627:"Source",628:"Copyright Notice",630:{name:"Contact",repeatable:1},632:"Caption/Abstract",634:{name:"Writer/Editor",repeatable:1},637:{name:"Rasterized Caption",description:function(e){return e}},642:"Image Type",643:{name:"Image Orientation",description:function(e){var t=d(e);return"P"===t?"Portrait":"L"===t?"Landscape":"S"===t?"Square":"Unknown"}},647:"Language Identifier",662:{name:"Audio Type",description:function(e){var t=d(e),n=t.charAt(0),r=t.charAt(1),i="";return"1"===n?i+="Mono":"2"===n&&(i+="Stereo"),"A"===r?i+=", actuality":"C"===r?i+=", question and answer session":"M"===r?i+=", music, transmitted by itself":"Q"===r?i+=", response to a question":"R"===r?i+=", raw sound":"S"===r?i+=", scener":"V"===r?i+=", voicer":"W"===r&&(i+=", wrap"),""!==i?i:t}},663:{name:"Audio Sampling Rate",description:function(e){return parseInt(d(e),10)+" Hz"}},664:{name:"Audio Sampling Resolution",description:function(e){var t=parseInt(d(e),10);return t+(1===t?" bit":" bits")}},665:{name:"Audio Duration",description:function(e){var t=d(e);return t.length>=6?t.substr(0,2)+":"+t.substr(2,2)+":"+t.substr(4,2):t}},666:"Audio Outcue",698:"Short Document ID",699:"Unique Document ID",700:"Owner ID",712:{name:function(e){return 2===e.length?"ObjectData Preview File Format":"Record 2 destination"},description:function(e){if(2===e.length){var t=(e[0]<<8)+e[1];return 0===t?"No ObjectData":1===t?"IPTC-NAA Digital Newsphoto Parameter Record":2===t?"IPTC7901 Recommended Message Format":3===t?"Tagged Image File Format (Adobe/Aldus Image data)":4===t?"Illustrator (Adobe Graphics data)":5===t?"AppleSingle (Apple Computer Inc)":6===t?"NAA 89-3 (ANPA 1312)":7===t?"MacBinary II":8===t?"IPTC Unstructured Character Oriented File Format (UCOFF)":9===t?"United Press International ANPA 1312 variant":10===t?"United Press International Down-Load Message":11===t?"JPEG File Interchange (JFIF)":12===t?"Photo-CD Image-Pac (Eastman Kodak)":13===t?"Microsoft Bit Mapped Graphics File [*.BMP]":14===t?"Digital Audio File [*.WAV] (Microsoft & Creative Labs)":15===t?"Audio plus Moving Video [*.AVI] (Microsoft)":16===t?"PC DOS/Windows Executable Files [*.COM][*.EXE]":17===t?"Compressed Binary File [*.ZIP] (PKWare Inc)":18===t?"Audio Interchange File Format AIFF (Apple Computer Inc)":19===t?"RIFF Wave (Microsoft Corporation)":20===t?"Freehand (Macromedia/Aldus)":21===t?'Hypertext Markup Language "HTML" (The Internet Society)':22===t?"MPEG 2 Audio Layer 2 (Musicom), ISO/IEC":23===t?"MPEG 2 Audio Layer 3, ISO/IEC":24===t?"Portable Document File (*.PDF) Adobe":25===t?"News Industry Text Format (NITF)":26===t?"Tape Archive (*.TAR)":27===t?"Tidningarnas Telegrambyrå NITF version (TTNITF DTD)":28===t?"Ritzaus Bureau NITF version (RBNITF DTD)":29===t?"Corel Draw [*.CDR]":"Unknown format ".concat(t)}return d(e)}},713:{name:"ObjectData Preview File Format Version",description:function(e,t){var n={"00":{"00":"1"},"01":{"01":"1","02":"2","03":"3","04":"4"},"02":{"04":"4"},"03":{"01":"5.0","02":"6.0"},"04":{"01":"1.40"},"05":{"01":"2"},"06":{"01":"1"},11:{"01":"1.02"},20:{"01":"3.1","02":"4.0","03":"5.0","04":"5.5"},21:{"02":"2.0"}},r=d(e);if(t["ObjectData Preview File Format"]){var i=d(t["ObjectData Preview File Format"].value);if(n[i]&&n[i][r])return n[i][r]}return r}},714:"ObjectData Preview Data",1802:{name:"Size Mode",description:function(e){return e[0].toString()}},1812:{name:"Max Subfile Size",description:function(e){for(var t=0,n=0;n=8?t.substr(0,4)+"-"+t.substr(4,2)+"-"+t.substr(6,2):t}function me(e){var t=d(e),n=t;return t.length>=6&&(n=t.substr(0,2)+":"+t.substr(2,2)+":"+t.substr(4,2),11===t.length&&(n+=t.substr(6,1)+t.substr(7,2)+":"+t.substr(9,2))),n}function ge(e){var t=d(e);return"%G"===t?"UTF-8":"%5"===t?"Windows-1252":"%/G"===t?"UTF-8 Level 1":"%/H"===t?"UTF-8 Level 2":"%/I"===t?"UTF-8 Level 3":"/A"===t?"ISO-8859-1":"/B"===t?"ISO-8859-2":"/C"===t?"ISO-8859-3":"/D"===t?"ISO-8859-4":"/@"===t?"ISO-8859-5":"/G"===t?"ISO-8859-6":"/F"===t?"ISO-8859-7":"/H"===t?"ISO-8859-8":"Unknown"}var ve=function(e,t){var n=function(){if("undefined"!=typeof TextDecoder)return TextDecoder}();if("undefined"!=typeof n&&void 0!==e)try{return new n(e).decode(Uint8Array.from(t))}catch(e){}return function(e){try{return decodeURIComponent(escape(e))}catch(t){return e}}(t.map((function(e){return String.fromCharCode(e)})).join(""))},he=function(e,t){try{if(Array.isArray(e))return Ce(new DataView(Uint8Array.from(e).buffer),{size:e.length},0);var n=function(e,t){for(;t+12<=e.byteLength;){var n=ye(e,t);if(Se(n))return{naaBlock:n,dataOffset:t+12};t+=12+n.size+be(n)}throw Error("No IPTC NAA resource block.")}(e,t);return Ce(e,n.naaBlock,n.dataOffset)}catch(e){return{}}};function ye(e,t){if(943868237!==e.getUint32(t,0))throw Error("Not an IPTC resource block.");return{type:e.getUint16(t+4),size:e.getUint16(t+10)}}function Se(e){return 1028===e.type}function be(e){return e.size%2!=0?1:0}function Ce(e,t,n){for(var r={},i=void 0,o=n+t.size;ne.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&n.push(xe(e,t.slice(1))),n}(e,t).reduce(Fe,{})};function xe(e,t){for(var n=t.reduce((function(e,t){return e+t.length}),0),r=new Uint8Array(n),i=0,o=0;o).+$/,"$1"),"application/xml");if("parsererror"===o.documentElement.nodeName)throw Error(o.documentElement.textContent);return o}(t)),1)))}catch(t){return e}}function Le(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=ke(e);return Re(n)?t?{}:Ne(n[0]):Ee(n)}function ke(e){for(var t=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:void 0;if(Array.isArray(e))return _e(e);if("object"===Te(e))return Xe(e);try{return t&&"function"==typeof we[t]?we[t](e):decodeURIComponent(escape(e))}catch(t){return e}}function _e(e){return e.map((function(e){return void 0!==e.value?Ve(e.value):Ve(e)})).join(", ")}function Xe(e){var t=[];for(var n in e)t.push("".concat(Ye(n),": ").concat(e[n].value));return t.join("; ")}function Ye(e){return"CiAdrCity"===e?"CreatorCity":"CiAdrCtry"===e?"CreatorCountry":"CiAdrExtadr"===e?"CreatorAddress":"CiAdrPcode"===e?"CreatorPostalCode":"CiAdrRegion"===e?"CreatorRegion":"CiEmailWork"===e?"CreatorWorkEmail":"CiTelWork"===e?"CreatorWorkPhone":"CiUrlWork"===e?"CreatorWorkUrl":e}function qe(e){var t={};for(var n in e)We(n)||(t[He(n)]=Ke(e[n],n));return t}function Ke(e,t){return Je(e)?$e(e,t):function(e){return"Resource"===e.attributes["rdf:parseType"]||void 0!==e.value["rdf:Description"]&&void 0===e.value["rdf:Description"].value["rdf:value"]}(e)?function(e,t){var n={value:{},attributes:{}};return void 0!==e.value["rdf:Description"]&&(u(n.value,Be(e.value["rdf:Description"].attributes)),u(n.attributes,Qe(e)),e=e.value["rdf:Description"]),u(n.value,qe(e.value)),n.description=Ve(n.value,t),n}(e,t):function(e){return 0===Object.keys(e.value).length&&void 0===e.attributes["rdf:resource"]}(e)?function(e,t){var n=Be(e.attributes);return{value:n,attributes:{},description:Ve(n,t)}}(e,t):function(e){return void 0!==Ze(e.value)}(e)?function(e,t){var n=Ze(e.value).value["rdf:li"],r=Qe(e),i=[];return void 0===n?n=[]:Array.isArray(n)||(n=[n]),n.forEach((function(e){i.push(function(e){return Je(e)?$e(e):function(e){return"Resource"===e.attributes["rdf:parseType"]}(e)?qe(e.value):{value:e.value,attributes:Qe(e),description:Ve(e.value)}}(e))})),{value:i,attributes:r,description:Ve(i,t)}}(e,t):function(e,t){var n=et(e)||je(e.value);return{value:n,attributes:Qe(e),description:Ve(n,t)}}(e,t)}function Je(e){return"Resource"===e.attributes["rdf:parseType"]&&void 0!==e.value["rdf:value"]||void 0!==e.value["rdf:Description"]&&void 0!==e.value["rdf:Description"].value["rdf:value"]}function $e(e,t){var n=Qe(e);void 0!==e.value["rdf:Description"]&&(e=e.value["rdf:Description"]),u(n,Qe(e),function(e){var t={};for(var n in e.value)"rdf:value"===n||We(n)||(t[He(n)]=e.value[n].value);return t}(e));var r=function(e){return et(e.value["rdf:value"])||e.value["rdf:value"].value}(e);return{value:r,attributes:n,description:Ve(r,t)}}function Qe(e){var t={};for(var n in e.attributes)"rdf:parseType"===n||"rdf:resource"===n||We(n)||(t[He(n)]=e.attributes[n]);return t}function Ze(e){return e["rdf:Bag"]||e["rdf:Seq"]||e["rdf:Alt"]}function et(e){return e.attributes&&e.attributes["rdf:resource"]}var tt={desc:{name:"ICC Description"},cprt:{name:"ICC Copyright"},dmdd:{name:"ICC Device Model Description"},vued:{name:"ICC Viewing Conditions Description"},dmnd:{name:"ICC Device Manufacturer for Display"},tech:{name:"Technology"}},nt={4:{name:"Preferred CMM type",value:function(e,t){return i(e,t,4)},description:function(e){return null!==e?rt(e):""}},8:{name:"Profile Version",value:function(e,t){return e.getUint8(t).toString(10)+"."+(e.getUint8(t+1)>>4).toString(10)+"."+(e.getUint8(t+1)%16).toString(10)}},12:{name:"Profile/Device class",value:function(e,t){return i(e,t,4)},description:function(e){switch(e.toLowerCase()){case"scnr":return"Input Device profile";case"mntr":return"Display Device profile";case"prtr":return"Output Device profile";case"link":return"DeviceLink profile";case"abst":return"Abstract profile";case"spac":return"ColorSpace profile";case"nmcl":return"NamedColor profile";case"cenc":return"ColorEncodingSpace profile";case"mid ":return"MultiplexIdentification profile";case"mlnk":return"MultiplexLink profile";case"mvis":return"MultiplexVisualization profile";default:return e}}},16:{name:"Color Space",value:function(e,t){return i(e,t,4)}},20:{name:"Connection Space",value:function(e,t){return i(e,t,4)}},24:{name:"ICC Profile Date",value:function(e,t){return function(e,t){var n=e.getUint16(t),r=e.getUint16(t+2)-1,i=e.getUint16(t+4),o=e.getUint16(t+6),a=e.getUint16(t+8),u=e.getUint16(t+10);return new Date(Date.UTC(n,r,i,o,a,u))}(e,t).toISOString()}},36:{name:"ICC Signature",value:function(e,t){return n=e.buffer.slice(t,t+4),String.fromCharCode.apply(null,new Uint8Array(n));var n}},40:{name:"Primary Platform",value:function(e,t){return i(e,t,4)},description:function(e){return rt(e)}},48:{name:"Device Manufacturer",value:function(e,t){return i(e,t,4)},description:function(e){return rt(e)}},52:{name:"Device Model Number",value:function(e,t){return i(e,t,4)}},64:{name:"Rendering Intent",value:function(e,t){return e.getUint32(t)},description:function(e){switch(e){case 0:return"Perceptual";case 1:return"Relative Colorimetric";case 2:return"Saturation";case 3:return"Absolute Colorimetric";default:return e}}},80:{name:"Profile Creator",value:function(e,t){return i(e,t,4)}}};function rt(e){switch(e.toLowerCase()){case"appl":return"Apple";case"adbe":return"Adobe";case"msft":return"Microsoft";case"sunw":return"Sun Microsystems";case"sgi":return"Silicon Graphics";case"tgnt":return"Taligent";default:return e}}var it=function(e,t){try{for(var n=t.reduce((function(e,t){return e+t.length}),0),r=new Uint8Array(n),a=0,u=function(e){return Array.isArray(e)?new DataView(Uint8Array.from(e).buffer).buffer:e.buffer}(e),c=function(e){var n=t.find((function(t){return t.chunkNumber===e}));if(!n)throw Error("ICC chunk ".concat(e," not found"));var i=u.slice(n.offset,n.offset+n.length),o=new Uint8Array(i);r.set(o,a),a+=o.length},f=1;f<=t.length;f++)c(f);return function(e){var t=e.buffer,n=e.getUint32();if(e.byteLength!==n)throw Error("ICC profile length not matching");if(e.length<84)throw Error("ICC profile too short");for(var r={},a=Object.keys(nt),u=0;ut.length)return r;var y=i(e,v,4);if("desc"===y){var S=e.getUint32(v+8);if(S>h)return r;ut(r,g,at(t.slice(v+12,v+S+11)))}else if("mluc"===y){for(var b=e.getUint32(v+8),C=e.getUint32(v+12),I=v+16,P=[],A=0;Ae.byteLength)){var n=k.getLongAt(e,t);return{value:n,description:"".concat(n,"px")}}}function st(e,t){if(!(t+4+4>e.byteLength)){var n=k.getLongAt(e,t+4);return{value:n,description:"".concat(n,"px")}}}function lt(e,t){if(!(t+8+1>e.byteLength)){var n=k.getByteAt(e,t+8);return{value:n,description:"".concat(n)}}}function dt(e,t){if(!(t+9+1>e.byteLength)){var n=k.getByteAt(e,t+9);return{value:n,description:{0:"Grayscale",2:"RGB",3:"Palette",4:"Grayscale with Alpha",6:"RGB with Alpha"}[n]||"Unknown"}}}function pt(e,t){if(!(t+10+1>e.byteLength)){var n=k.getByteAt(e,t+10);return{value:n,description:0===n?"Deflate/Inflate":"Unknown"}}}function mt(e,t){if(!(t+11+1>e.byteLength)){var n=k.getByteAt(e,t+11);return{value:n,description:0===n?"Adaptive":"Unknown"}}}function gt(e,t){if(!(t+12+1>e.byteLength)){var n=k.getByteAt(e,t+12);return{value:n,description:{0:"Noninterlaced",1:"Adam7 Interlace"}[n]||"Unknown"}}}var vt=[6,7,99],ht=function(e,t,n){if((i=t)&&(void 0===i.Compression||vt.includes(i.Compression.value))&&i.JPEGInterchangeFormat&&i.JPEGInterchangeFormat.value&&i.JPEGInterchangeFormatLength&&i.JPEGInterchangeFormatLength.value){t.type="image/jpeg";var r=n+t.JPEGInterchangeFormat.value;t.image=e.buffer.slice(r,r+t.JPEGInterchangeFormatLength.value),c(t,"base64",(function(){return f(this.image)}))}var i;return t};function yt(e){this.name="MetadataMissingError",this.message=e||"No Exif data",this.stack=Error().stack}yt.prototype=Error();var St={MetadataMissingError:yt},bt=(t.default={load:Ct,loadView:At,errors:St},St);function Ct(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{expanded:0};return It(e)&&(e=new Uint8Array(e).buffer),At(Pt(e),t)}function It(e){try{return Buffer.isBuffer(e)}catch(e){return 0}}function Pt(e){try{return new DataView(e)}catch(t){return new l(e)}}function At(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{expanded:0},n=0,r={},i=x(e),o=i.fileDataOffset,c=i.tiffHeaderOffset,f=i.iptcDataOffset,s=i.xmpChunks,l=i.iccChunks,d=i.mpfDataOffset,p=i.pngHeaderOffset;if(Ut(o)){n=1;var m=oe(e,o);t.expanded?r.file=m:r=u({},r,m)}if(wt(c)){n=1;var g=Y(e,c);if(g.Thumbnail&&(r.Thumbnail=g.Thumbnail,delete g.Thumbnail),t.expanded?(r.exif=g,Dt(r)):r=u({},r,g),g["IPTC-NAA"]&&!Ot(f)){var v=he(g["IPTC-NAA"].value,0);t.expanded?r.iptc=v:r=u({},r,v)}if(g.ApplicationNotes&&!Tt(s)){var h=Me(a(g.ApplicationNotes.value));t.expanded?r.xmp=h:r=u({},r,h)}if(g.ICC_Profile&&!Mt(l)){var y=it(g.ICC_Profile.value,[{offset:0,length:g.ICC_Profile.value.length,chunkNumber:1,chunksTotal:1}]);t.expanded?r.icc=y:r=u({},r,y)}}if(Ot(f)){n=1;var S=he(e,f);t.expanded?r.iptc=S:r=u({},r,S)}if(Tt(s)){n=1;var b=Me(e,s);t.expanded?r.xmp=b:r=u({},r,b)}if(Mt(l)){n=1;var C=it(e,l);t.expanded?r.icc=C:r=u({},r,C)}if(xt(d)){n=1;var I=q(e,d);t.expanded?r.mpf=I:r=u({},r,I)}if(Ft(p)){n=1;var P=ct(e,p);t.expanded?r.pngFile=P:r=u({},r,P)}var A=ht(e,r.Thumbnail,c);if(A?(n=1,r.Thumbnail=A):delete r.Thumbnail,!n)throw new St.MetadataMissingError;return r}function Ut(e){return void 0!==e}function wt(e){return void 0!==e}function Dt(e){if(e.exif){if(e.exif.GPSLatitude&&e.exif.GPSLatitudeRef)try{e.gps=e.gps||{},e.gps.Latitude=m(e.exif.GPSLatitude.value),"S"===e.exif.GPSLatitudeRef.value.join("")&&(e.gps.Latitude=-e.gps.Latitude)}catch(e){}if(e.exif.GPSLongitude&&e.exif.GPSLongitudeRef)try{e.gps=e.gps||{},e.gps.Longitude=m(e.exif.GPSLongitude.value),"W"===e.exif.GPSLongitudeRef.value.join("")&&(e.gps.Longitude=-e.gps.Longitude)}catch(e){}if(e.exif.GPSAltitude&&e.exif.GPSAltitudeRef)try{e.gps=e.gps||{},e.gps.Altitude=e.exif.GPSAltitude.value[0]/e.exif.GPSAltitude.value[1],1===e.exif.GPSAltitudeRef.value&&(e.gps.Altitude=-e.gps.Altitude)}catch(e){}}}function Ot(e){return void 0!==e}function Tt(e){return Array.isArray(e)&&e.length>0}function Mt(e){return Array.isArray(e)&&e.length>0}function xt(e){return void 0!==e}function Ft(e){return void 0!==e}}])})); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ExifReader=t():e.ExifReader=t()}("undefined"!=typeof self?self:this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:0,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=1,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:1,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:1})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:1,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(module,__webpack_exports__,__webpack_require__){"use strict";function get(){if("undefined"!=typeof DOMParser)return DOMParser;try{return eval("require")("xmldom").DOMParser}catch(e){return}}__webpack_exports__.a={get:get}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t,n){for(var r=[],i=0;i=8){var t=d(e.slice(0,8));if("ASCII\0\0\0"===t)return d(e.slice(8));if("JIS\0\0\0\0\0"===t)return"[JIS encoded text]";if("UNICODE\0"===t)return"[Unicode encoded text]";if("\0\0\0\0\0\0\0\0"===t)return"[Undefined encoding]"}return"Undefined"}function m(e){return e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600}var g=18761,v=g,h=function(e,t){if(e.getUint16(t)===g)return g;if(19789===e.getUint16(t))return 19789;throw Error("Illegal byte order value. Faulty image.")},y=65505;function S(e,t){return 65472===e.getUint16(t)}function b(e,t){return 65474===e.getUint16(t)}function C(e,t){return 65506===e.getUint16(t)&&"ICC_PROFILE\0"===i(e,t+4,12)}function I(e,t){return 65506===e.getUint16(t)&&"MPF\0"===i(e,t+4,4)}function P(e,t){return e.getUint16(t)===y&&"Exif"===i(e,t+4,4)&&0===e.getUint8(t+4+4)}function A(e,t){return e.getUint16(t)===y&&function(e,t){return"http://ns.adobe.com/xap/1.0/\0"===i(e,t+4,29)}(e,t)}function U(e,t){return e.getUint16(t)===y&&function(e,t){return"http://ns.adobe.com/xmp/extension/\0"===i(e,t+4,35)}(e,t)}function w(e,t){return{dataOffset:e+33,length:t-31}}function D(e,t){return{dataOffset:e+79,length:t-77}}function O(e,t){return 65517===e.getUint16(t)&&"Photoshop 3.0"===i(e,t+4,13)&&0===e.getUint8(t+4+13)}function T(e,t){var n=e.getUint16(t);return n>=65504&&n<=65519||65534===n||65472===n||65474===n||65476===n||65499===n||65501===n||65498===n}var M="‰PNG\r\n\n";function x(e,t){return"IHDR"===i(e,t+4,4)}function F(e,t){return"iTXt"===i(e,t+4,4)&&"XML:com.adobe.xmp\0"===i(e,t+8,18)}function L(e,t){t+=28;for(var n=0;n<2&&t=4&&function(e){var t=e.getUint16(0)===v;return 42===e.getUint16(2,t)}(e)}(e))return{hasAppMarkers:1,tiffHeaderOffset:0};if(function(e){return e.byteLength>=2&&65496===e.getUint16(0)}(e))return function(e){for(var t,n,r,i,o,a,u,c,f=2;f+4+5<=e.byteLength;){if(S(e,f))n=f+2;else if(b(e,f))r=f+2;else if(P(e,f))t=e.getUint16(f+2),i=f+10;else if(A(e,f))a||(a=[]),t=e.getUint16(f+2),a.push(w(f,t));else if(U(e,f))a||(a=[]),t=e.getUint16(f+2),a.push(D(f,t));else if(O(e,f))t=e.getUint16(f+2),o=f+18;else if(C(e,f)){var s=f+18,l=(t=e.getUint16(f+2))-16,d=e.getUint8(f+16),p=e.getUint8(f+17);u||(u=[]),u.push({offset:s,length:l,chunkNumber:d,chunksTotal:p})}else if(I(e,f))t=e.getUint16(f+2),c=f+8;else{if(!T(e,f))break;t=e.getUint16(f+2)}f+=2+t}return{hasAppMarkers:f>2,fileDataOffset:n||r,tiffHeaderOffset:i,iptcDataOffset:o,xmpChunks:a,iccChunks:u,mpfDataOffset:c}}(e);if(function(e){return i(e,0,8)===M}(e))return function(e){for(var t={hasAppMarkers:0},n=8;n+4+4<=e.byteLength;){if(x(e,n))t.hasAppMarkers=1,t.pngHeaderOffset=n+8;else if(F(e,n)){var r=L(e,n);void 0!==r&&(t.hasAppMarkers=1,t.xmpChunks=[{dataOffset:r,length:e.getUint32(n+0)-(r-(n+8))}])}n+=e.getUint32(n+0)+4+4+4}return t}(e);if(function(e){var t=i(e,8,4);return"ftyp"===i(e,4,4)&&-1!==["heic","heix","hevc","hevx","heim","heis","hevm","hevs","mif1"].indexOf(t)}(e))return function(e){var t=function(e){for(var t=0;t+4+4<=e.byteLength;){var n=k(e,t);if(n>=8&&"meta"===i(e,t+4,4))return{offset:t,length:n};t+=n}return{offset:void 0,length:0}}(e),n=t.offset,r=t.length;if(void 0===n)return{hasAppMarkers:0};var o=Math.min(n+r,e.byteLength),a=function(e,t,n){for(var r={ilocOffset:void 0,exifItemOffset:void 0,colrOffset:void 0};t+4<=n&&(!r.ilocOffset||!r.exifItemOffset||!r.colrOffset);){var o=i(e,t,4);"iloc"===o?r.ilocOffset=t:"Exif"===o?r.exifItemOffset=t+-4:"colr"===o&&(r.colrOffset=t+-4),t++}return r}(e,n,o),u=a.exifItemOffset,c=a.ilocOffset,f=a.colrOffset,s=function(e,t,n,r){if(n&&t&&!(t+2>r)){var i=e.getUint16(t);for(n+=12;n+16<=r;){if(e.getUint16(n)===i){var o=e.getUint32(n+8);if(o+4<=e.byteLength)return o+(e.getUint32(o)+4)}n+=16}}}(e,u,c,o),l=function(e,t,n){if(t&&!(t+12>n)){var r=i(e,t+8,4);if("prof"===r||"rICC"===r)return[{offset:t+12,length:k(e,t)-12,chunkNumber:1,chunksTotal:1}]}}(e,f,o);return{hasAppMarkers:void 0!==s||void 0!==l,tiffHeaderOffset:s,iccChunks:l}}(e);if(function(e){return"RIFF"===i(e,0,4)&&"WEBP"===i(e,8,4)}(e))return function(e){for(var t,n,r,o=12,a=0;o+8e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n>31&1,e>>30&1,e>>29&1],n=[];return t[0]&&n.push("Dependent Parent Image"),t[1]&&n.push("Dependent Child Image"),t[2]&&n.push("Representative Image"),{value:t,description:n.join(", ")||"None"}}function ne(e){var t=e>>24&7;return{value:t,description:0===t?"JPEG":"Unknown"}}function re(e){var t=16777215&e;return{value:t,description:{196608:"Baseline MP Primary Image",65537:"Large Thumbnail (VGA equivalent)",65538:"Large Thumbnail (Full HD equivalent)",131073:"Multi-Frame Image (Panorama)",131074:"Multi-Frame Image (Disparity)",131075:"Multi-Frame Image (Multi-Angle)",0:"Undefined"}[t]||"Unknown"}}function ie(e){return 0===e}function oe(e,t,n,r,i){var o=G.getTypeSize("SHORT"),a={},u=function(e,t,n){return t+G.getTypeSize("SHORT")<=e.byteLength?G.getShortAt(e,t,n):0}(e,r,i);r+=o;for(var c=0;ce.byteLength);c++){var f=ae(e,t,n,r,i);void 0!==f&&(a[f.name]={id:f.id,value:f.value,description:f.description}),r+=12}if(r"}s===G.tagTypes.ASCII&&(o=function(e){try{return e.map((function(e){return decodeURIComponent(escape(e))}))}catch(t){return e}}(o=function(e){for(var t=[],n=0,r=0;r5&&void 0!==arguments[5]?arguments[5]:0,a=[];o&&(r*=G.typeSizes[n],n=G.tagTypes.BYTE);for(var u=0;un)){var r=G.getByteAt(e,t+7);return{value:r,description:""+r}}}(e,t,n);return{"Bits Per Sample":se(e,t,n),"Image Height":le(e,t,n),"Image Width":de(e,t,n),"Color Components":r,Subsampling:r&&pe(e,t,r.value,n)}};function se(e,t,n){if(!(3>n)){var r=G.getByteAt(e,t+2);return{value:r,description:""+r}}}function le(e,t,n){if(!(5>n)){var r=G.getShortAt(e,t+3);return{value:r,description:"".concat(r,"px")}}}function de(e,t,n){if(!(7>n)){var r=G.getShortAt(e,t+5);return{value:r,description:"".concat(r,"px")}}}function pe(e,t,n,r){if(!(8+3*n>r)){for(var i=[],o=0;o1?me(i)+ge(i):""}}}function me(e){var t={1:"Y",2:"Cb",3:"Cr",4:"I",5:"Q"};return e.map((function(e){return t[e[0]]})).join("")}function ge(e){var t={17:"4:4:4 (1 1)",18:"4:4:0 (1 2)",20:"4:4:1 (1 4)",33:"4:2:2 (2 1)",34:"4:2:0 (2 2)",36:"4:2:1 (2 4)",65:"4:1:1 (4 1)",66:"4:1:0 (4 2)"};return 0===e.length||void 0===e[0][1]||void 0===t[e[0][1]]?"":t[e[0][1]]}var ve={iptc:{256:{name:"Model Version",description:function(e){return""+((e[0]<<8)+e[1])}},261:{name:"Destination",repeatable:1},276:{name:"File Format",description:function(e){return""+((e[0]<<8)+e[1])}},278:{name:"File Format Version",description:function(e){return""+((e[0]<<8)+e[1])}},286:"Service Identifier",296:"Envelope Number",306:"Product ID",316:"Envelope Priority",326:{name:"Date Sent",description:he},336:{name:"Time Sent",description:ye},346:{name:"Coded Character Set",description:Se,encoding_name:Se},356:"UNO",376:{name:"ARM Identifier",description:function(e){return""+((e[0]<<8)+e[1])}},378:{name:"ARM Version",description:function(e){return""+((e[0]<<8)+e[1])}},512:{name:"Record Version",description:function(e){return""+((e[0]<<8)+e[1])}},515:"Object Type Reference",516:"Object Attribute Reference",517:"Object Name",519:"Edit Status",520:{name:"Editorial Update",description:function(e){return"01"===d(e)?"Additional Language":"Unknown"}},522:"Urgency",524:{name:"Subject Reference",repeatable:1,description:function(e){var t=d(e).split(":");return t[2]+(t[3]?"/"+t[3]:"")+(t[4]?"/"+t[4]:"")}},527:"Category",532:{name:"Supplemental Category",repeatable:1},534:"Fixture Identifier",537:{name:"Keywords",repeatable:1},538:{name:"Content Location Code",repeatable:1},539:{name:"Content Location Name",repeatable:1},542:"Release Date",547:"Release Time",549:"Expiration Date",550:"Expiration Time",552:"Special Instructions",554:{name:"Action Advised",description:function(e){var t=d(e);return"01"===t?"Object Kill":"02"===t?"Object Replace":"03"===t?"Object Append":"04"===t?"Object Reference":"Unknown"}},557:{name:"Reference Service",repeatable:1},559:{name:"Reference Date",repeatable:1},562:{name:"Reference Number",repeatable:1},567:{name:"Date Created",description:he},572:{name:"Time Created",description:ye},574:{name:"Digital Creation Date",description:he},575:{name:"Digital Creation Time",description:ye},577:"Originating Program",582:"Program Version",587:{name:"Object Cycle",description:function(e){var t=d(e);return"a"===t?"morning":"p"===t?"evening":"b"===t?"both":"Unknown"}},592:{name:"By-line",repeatable:1},597:{name:"By-line Title",repeatable:1},602:"City",604:"Sub-location",607:"Province/State",612:"Country/Primary Location Code",613:"Country/Primary Location Name",615:"Original Transmission Reference",617:"Headline",622:"Credit",627:"Source",628:"Copyright Notice",630:{name:"Contact",repeatable:1},632:"Caption/Abstract",634:{name:"Writer/Editor",repeatable:1},637:{name:"Rasterized Caption",description:function(e){return e}},642:"Image Type",643:{name:"Image Orientation",description:function(e){var t=d(e);return"P"===t?"Portrait":"L"===t?"Landscape":"S"===t?"Square":"Unknown"}},647:"Language Identifier",662:{name:"Audio Type",description:function(e){var t=d(e),n=t.charAt(0),r=t.charAt(1),i="";return"1"===n?i+="Mono":"2"===n&&(i+="Stereo"),"A"===r?i+=", actuality":"C"===r?i+=", question and answer session":"M"===r?i+=", music, transmitted by itself":"Q"===r?i+=", response to a question":"R"===r?i+=", raw sound":"S"===r?i+=", scener":"V"===r?i+=", voicer":"W"===r&&(i+=", wrap"),""!==i?i:t}},663:{name:"Audio Sampling Rate",description:function(e){return parseInt(d(e),10)+" Hz"}},664:{name:"Audio Sampling Resolution",description:function(e){var t=parseInt(d(e),10);return t+(1===t?" bit":" bits")}},665:{name:"Audio Duration",description:function(e){var t=d(e);return t.length>=6?t.substr(0,2)+":"+t.substr(2,2)+":"+t.substr(4,2):t}},666:"Audio Outcue",698:"Short Document ID",699:"Unique Document ID",700:"Owner ID",712:{name:function(e){return 2===e.length?"ObjectData Preview File Format":"Record 2 destination"},description:function(e){if(2===e.length){var t=(e[0]<<8)+e[1];return 0===t?"No ObjectData":1===t?"IPTC-NAA Digital Newsphoto Parameter Record":2===t?"IPTC7901 Recommended Message Format":3===t?"Tagged Image File Format (Adobe/Aldus Image data)":4===t?"Illustrator (Adobe Graphics data)":5===t?"AppleSingle (Apple Computer Inc)":6===t?"NAA 89-3 (ANPA 1312)":7===t?"MacBinary II":8===t?"IPTC Unstructured Character Oriented File Format (UCOFF)":9===t?"United Press International ANPA 1312 variant":10===t?"United Press International Down-Load Message":11===t?"JPEG File Interchange (JFIF)":12===t?"Photo-CD Image-Pac (Eastman Kodak)":13===t?"Microsoft Bit Mapped Graphics File [*.BMP]":14===t?"Digital Audio File [*.WAV] (Microsoft & Creative Labs)":15===t?"Audio plus Moving Video [*.AVI] (Microsoft)":16===t?"PC DOS/Windows Executable Files [*.COM][*.EXE]":17===t?"Compressed Binary File [*.ZIP] (PKWare Inc)":18===t?"Audio Interchange File Format AIFF (Apple Computer Inc)":19===t?"RIFF Wave (Microsoft Corporation)":20===t?"Freehand (Macromedia/Aldus)":21===t?'Hypertext Markup Language "HTML" (The Internet Society)':22===t?"MPEG 2 Audio Layer 2 (Musicom), ISO/IEC":23===t?"MPEG 2 Audio Layer 3, ISO/IEC":24===t?"Portable Document File (*.PDF) Adobe":25===t?"News Industry Text Format (NITF)":26===t?"Tape Archive (*.TAR)":27===t?"Tidningarnas Telegrambyrå NITF version (TTNITF DTD)":28===t?"Ritzaus Bureau NITF version (RBNITF DTD)":29===t?"Corel Draw [*.CDR]":"Unknown format ".concat(t)}return d(e)}},713:{name:"ObjectData Preview File Format Version",description:function(e,t){var n={"00":{"00":"1"},"01":{"01":"1","02":"2","03":"3","04":"4"},"02":{"04":"4"},"03":{"01":"5.0","02":"6.0"},"04":{"01":"1.40"},"05":{"01":"2"},"06":{"01":"1"},11:{"01":"1.02"},20:{"01":"3.1","02":"4.0","03":"5.0","04":"5.5"},21:{"02":"2.0"}},r=d(e);if(t["ObjectData Preview File Format"]){var i=d(t["ObjectData Preview File Format"].value);if(n[i]&&n[i][r])return n[i][r]}return r}},714:"ObjectData Preview Data",1802:{name:"Size Mode",description:function(e){return e[0].toString()}},1812:{name:"Max Subfile Size",description:function(e){for(var t=0,n=0;n=8?t.substr(0,4)+"-"+t.substr(4,2)+"-"+t.substr(6,2):t}function ye(e){var t=d(e),n=t;return t.length>=6&&(n=t.substr(0,2)+":"+t.substr(2,2)+":"+t.substr(4,2),11===t.length&&(n+=t.substr(6,1)+t.substr(7,2)+":"+t.substr(9,2))),n}function Se(e){var t=d(e);return"%G"===t?"UTF-8":"%5"===t?"Windows-1252":"%/G"===t?"UTF-8 Level 1":"%/H"===t?"UTF-8 Level 2":"%/I"===t?"UTF-8 Level 3":"/A"===t?"ISO-8859-1":"/B"===t?"ISO-8859-2":"/C"===t?"ISO-8859-3":"/D"===t?"ISO-8859-4":"/@"===t?"ISO-8859-5":"/G"===t?"ISO-8859-6":"/F"===t?"ISO-8859-7":"/H"===t?"ISO-8859-8":"Unknown"}var be=function(e,t){var n=function(){if("undefined"!=typeof TextDecoder)return TextDecoder}();if("undefined"!=typeof n&&void 0!==e)try{return new n(e).decode(Uint8Array.from(t))}catch(e){}return function(e){try{return decodeURIComponent(escape(e))}catch(t){return e}}(t.map((function(e){return String.fromCharCode(e)})).join(""))},Ce=function(e,t){try{if(Array.isArray(e))return Ue(new DataView(Uint8Array.from(e).buffer),{size:e.length},0);var n=function(e,t){for(;t+12<=e.byteLength;){var n=Ie(e,t);if(Pe(n))return{naaBlock:n,dataOffset:t+12};t+=12+n.size+Ae(n)}throw Error("No IPTC NAA resource block.")}(e,t);return Ue(e,n.naaBlock,n.dataOffset)}catch(e){return{}}};function Ie(e,t){if(943868237!==e.getUint32(t,0))throw Error("Not an IPTC resource block.");return{type:e.getUint16(t+4),size:e.getUint16(t+10)}}function Pe(e){return 1028===e.type}function Ae(e){return e.size%2!=0?1:0}function Ue(e,t,n){for(var r={},i=void 0,o=n+t.size;ne.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&n.push(Re(e,t.slice(1))),n}(e,t).reduce(Ne,{})};function Re(e,t){for(var n=t.reduce((function(e,t){return e+t.length}),0),r=new Uint8Array(n),i=0,o=0;o).+$/,"$1"),"application/xml");if("parsererror"===o.documentElement.nodeName)throw Error(o.documentElement.textContent);return o}(t)),1)))}catch(t){return e}}function Ee(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:0,n=je(e);return Be(n)?t?{}:ze(n[0]):We(n)}function je(e){for(var t=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:void 0;if(Array.isArray(e))return Je(e);if("object"===Le(e))return $e(e);try{return t&&"function"==typeof Me[t]?Me[t](e):decodeURIComponent(escape(e))}catch(t){return e}}function Je(e){return e.map((function(e){return void 0!==e.value?Ke(e.value):Ke(e)})).join(", ")}function $e(e){var t=[];for(var n in e)t.push("".concat(Qe(n),": ").concat(e[n].value));return t.join("; ")}function Qe(e){return"CiAdrCity"===e?"CreatorCity":"CiAdrCtry"===e?"CreatorCountry":"CiAdrExtadr"===e?"CreatorAddress":"CiAdrPcode"===e?"CreatorPostalCode":"CiAdrRegion"===e?"CreatorRegion":"CiEmailWork"===e?"CreatorWorkEmail":"CiTelWork"===e?"CreatorWorkPhone":"CiUrlWork"===e?"CreatorWorkUrl":e}function Ze(e){var t={};for(var n in e)Ye(n)||(t[qe(n)]=et(e[n],n));return t}function et(e,t){return tt(e)?nt(e,t):function(e){return"Resource"===e.attributes["rdf:parseType"]||void 0!==e.value["rdf:Description"]&&void 0===e.value["rdf:Description"].value["rdf:value"]}(e)?function(e,t){var n={value:{},attributes:{}};return void 0!==e.value["rdf:Description"]&&(u(n.value,_e(e.value["rdf:Description"].attributes)),u(n.attributes,rt(e)),e=e.value["rdf:Description"]),u(n.value,Ze(e.value)),n.description=Ke(n.value,t),n}(e,t):function(e){return 0===Object.keys(e.value).length&&void 0===e.attributes["rdf:resource"]}(e)?function(e,t){var n=_e(e.attributes);return{value:n,attributes:{},description:Ke(n,t)}}(e,t):function(e){return void 0!==it(e.value)}(e)?function(e,t){var n=it(e.value).value["rdf:li"],r=rt(e),i=[];return void 0===n?n=[]:Array.isArray(n)||(n=[n]),n.forEach((function(e){i.push(function(e){return tt(e)?nt(e):function(e){return"Resource"===e.attributes["rdf:parseType"]}(e)?Ze(e.value):{value:e.value,attributes:rt(e),description:Ke(e.value)}}(e))})),{value:i,attributes:r,description:Ke(i,t)}}(e,t):function(e,t){var n=ot(e)||Ve(e.value);return{value:n,attributes:rt(e),description:Ke(n,t)}}(e,t)}function tt(e){return"Resource"===e.attributes["rdf:parseType"]&&void 0!==e.value["rdf:value"]||void 0!==e.value["rdf:Description"]&&void 0!==e.value["rdf:Description"].value["rdf:value"]}function nt(e,t){var n=rt(e);void 0!==e.value["rdf:Description"]&&(e=e.value["rdf:Description"]),u(n,rt(e),function(e){var t={};for(var n in e.value)"rdf:value"===n||Ye(n)||(t[qe(n)]=e.value[n].value);return t}(e));var r=function(e){return ot(e.value["rdf:value"])||e.value["rdf:value"].value}(e);return{value:r,attributes:n,description:Ke(r,t)}}function rt(e){var t={};for(var n in e.attributes)"rdf:parseType"===n||"rdf:resource"===n||Ye(n)||(t[qe(n)]=e.attributes[n]);return t}function it(e){return e["rdf:Bag"]||e["rdf:Seq"]||e["rdf:Alt"]}function ot(e){return e.attributes&&e.attributes["rdf:resource"]}var at={desc:{name:"ICC Description"},cprt:{name:"ICC Copyright"},dmdd:{name:"ICC Device Model Description"},vued:{name:"ICC Viewing Conditions Description"},dmnd:{name:"ICC Device Manufacturer for Display"},tech:{name:"Technology"}},ut={4:{name:"Preferred CMM type",value:function(e,t){return i(e,t,4)},description:function(e){return null!==e?ct(e):""}},8:{name:"Profile Version",value:function(e,t){return e.getUint8(t).toString(10)+"."+(e.getUint8(t+1)>>4).toString(10)+"."+(e.getUint8(t+1)%16).toString(10)}},12:{name:"Profile/Device class",value:function(e,t){return i(e,t,4)},description:function(e){switch(e.toLowerCase()){case"scnr":return"Input Device profile";case"mntr":return"Display Device profile";case"prtr":return"Output Device profile";case"link":return"DeviceLink profile";case"abst":return"Abstract profile";case"spac":return"ColorSpace profile";case"nmcl":return"NamedColor profile";case"cenc":return"ColorEncodingSpace profile";case"mid ":return"MultiplexIdentification profile";case"mlnk":return"MultiplexLink profile";case"mvis":return"MultiplexVisualization profile";default:return e}}},16:{name:"Color Space",value:function(e,t){return i(e,t,4)}},20:{name:"Connection Space",value:function(e,t){return i(e,t,4)}},24:{name:"ICC Profile Date",value:function(e,t){return function(e,t){var n=e.getUint16(t),r=e.getUint16(t+2)-1,i=e.getUint16(t+4),o=e.getUint16(t+6),a=e.getUint16(t+8),u=e.getUint16(t+10);return new Date(Date.UTC(n,r,i,o,a,u))}(e,t).toISOString()}},36:{name:"ICC Signature",value:function(e,t){return n=e.buffer.slice(t,t+4),String.fromCharCode.apply(null,new Uint8Array(n));var n}},40:{name:"Primary Platform",value:function(e,t){return i(e,t,4)},description:function(e){return ct(e)}},48:{name:"Device Manufacturer",value:function(e,t){return i(e,t,4)},description:function(e){return ct(e)}},52:{name:"Device Model Number",value:function(e,t){return i(e,t,4)}},64:{name:"Rendering Intent",value:function(e,t){return e.getUint32(t)},description:function(e){switch(e){case 0:return"Perceptual";case 1:return"Relative Colorimetric";case 2:return"Saturation";case 3:return"Absolute Colorimetric";default:return e}}},80:{name:"Profile Creator",value:function(e,t){return i(e,t,4)}}};function ct(e){switch(e.toLowerCase()){case"appl":return"Apple";case"adbe":return"Adobe";case"msft":return"Microsoft";case"sunw":return"Sun Microsystems";case"sgi":return"Silicon Graphics";case"tgnt":return"Taligent";default:return e}}var ft=function(e,t){try{for(var n=t.reduce((function(e,t){return e+t.length}),0),r=new Uint8Array(n),a=0,u=function(e){return Array.isArray(e)?new DataView(Uint8Array.from(e).buffer).buffer:e.buffer}(e),c=function(e){var n=t.find((function(t){return t.chunkNumber===e}));if(!n)throw Error("ICC chunk ".concat(e," not found"));var i=u.slice(n.offset,n.offset+n.length),o=new Uint8Array(i);r.set(o,a),a+=o.length},f=1;f<=t.length;f++)c(f);return function(e){var t=e.buffer,n=e.getUint32();if(e.byteLength!==n)throw Error("ICC profile length not matching");if(e.length<84)throw Error("ICC profile too short");for(var r={},a=Object.keys(ut),u=0;ut.length)return r;var y=i(e,v,4);if(y===lt){var S=e.getUint32(v+8);if(S>h)return r;ht(r,g,vt(t.slice(v+12,v+S+11)))}else if(y===dt){for(var b=e.getUint32(v+8),C=e.getUint32(v+12),I=v+16,P=[],A=0;Ae.byteLength)){var n=G.getLongAt(e,t);return{value:n,description:"".concat(n,"px")}}}function bt(e,t){if(!(t+4+4>e.byteLength)){var n=G.getLongAt(e,t+4);return{value:n,description:"".concat(n,"px")}}}function Ct(e,t){if(!(t+8+1>e.byteLength)){var n=G.getByteAt(e,t+8);return{value:n,description:"".concat(n)}}}function It(e,t){if(!(t+9+1>e.byteLength)){var n=G.getByteAt(e,t+9);return{value:n,description:{0:"Grayscale",2:"RGB",3:"Palette",4:"Grayscale with Alpha",6:"RGB with Alpha"}[n]||"Unknown"}}}function Pt(e,t){if(!(t+10+1>e.byteLength)){var n=G.getByteAt(e,t+10);return{value:n,description:0===n?"Deflate/Inflate":"Unknown"}}}function At(e,t){if(!(t+11+1>e.byteLength)){var n=G.getByteAt(e,t+11);return{value:n,description:0===n?"Adaptive":"Unknown"}}}function Ut(e,t){if(!(t+12+1>e.byteLength)){var n=G.getByteAt(e,t+12);return{value:n,description:{0:"Noninterlaced",1:"Adam7 Interlace"}[n]||"Unknown"}}}var wt=[6,7,99],Dt=function(e,t,n){if((i=t)&&(void 0===i.Compression||wt.includes(i.Compression.value))&&i.JPEGInterchangeFormat&&i.JPEGInterchangeFormat.value&&i.JPEGInterchangeFormatLength&&i.JPEGInterchangeFormatLength.value){t.type="image/jpeg";var r=n+t.JPEGInterchangeFormat.value;t.image=e.buffer.slice(r,r+t.JPEGInterchangeFormatLength.value),c(t,"base64",(function(){return f(this.image)}))}var i;return t};function Ot(e){this.name="MetadataMissingError",this.message=e||"No Exif data",this.stack=Error().stack}Ot.prototype=Error();var Tt={MetadataMissingError:Ot},Mt=(t.default={load:xt,loadView:kt,errors:Tt},Tt);function xt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{expanded:0};return Ft(e)&&(e=new Uint8Array(e).buffer),kt(Lt(e),t)}function Ft(e){try{return Buffer.isBuffer(e)}catch(e){return 0}}function Lt(e){try{return new DataView(e)}catch(t){return new l(e)}}function kt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{expanded:0},n=0,r={},i=R(e),o=i.fileDataOffset,c=i.tiffHeaderOffset,f=i.iptcDataOffset,s=i.xmpChunks,l=i.iccChunks,d=i.mpfDataOffset,p=i.pngHeaderOffset;if(Rt(o)){n=1;var m=fe(e,o);t.expanded?r.file=m:r=u({},r,m)}if(Nt(c)){n=1;var g=$(e,c);if(g.Thumbnail&&(r.Thumbnail=g.Thumbnail,delete g.Thumbnail),t.expanded?(r.exif=g,Et(r)):r=u({},r,g),g["IPTC-NAA"]&&!Gt(f)){var v=Ce(g["IPTC-NAA"].value,0);t.expanded?r.iptc=v:r=u({},r,v)}if(g.ApplicationNotes&&!jt(s)){var h=ke(a(g.ApplicationNotes.value));t.expanded?r.xmp=h:r=u({},r,h)}if(g.ICC_Profile&&!Bt(l)){var y=ft(g.ICC_Profile.value,[{offset:0,length:g.ICC_Profile.value.length,chunkNumber:1,chunksTotal:1}]);t.expanded?r.icc=y:r=u({},r,y)}}if(Gt(f)){n=1;var S=Ce(e,f);t.expanded?r.iptc=S:r=u({},r,S)}if(jt(s)){n=1;var b=ke(e,s);t.expanded?r.xmp=b:r=u({},r,b)}if(Bt(l)){n=1;var C=ft(e,l);t.expanded?r.icc=C:r=u({},r,C)}if(zt(d)){n=1;var I=Q(e,d);t.expanded?r.mpf=I:r=u({},r,I)}if(Wt(p)){n=1;var P=yt(e,p);t.expanded?r.pngFile=P:r=u({},r,P)}var A=Dt(e,r.Thumbnail,c);if(A?(n=1,r.Thumbnail=A):delete r.Thumbnail,!n)throw new Tt.MetadataMissingError;return r}function Rt(e){return void 0!==e}function Nt(e){return void 0!==e}function Et(e){if(e.exif){if(e.exif.GPSLatitude&&e.exif.GPSLatitudeRef)try{e.gps=e.gps||{},e.gps.Latitude=m(e.exif.GPSLatitude.value),"S"===e.exif.GPSLatitudeRef.value.join("")&&(e.gps.Latitude=-e.gps.Latitude)}catch(e){}if(e.exif.GPSLongitude&&e.exif.GPSLongitudeRef)try{e.gps=e.gps||{},e.gps.Longitude=m(e.exif.GPSLongitude.value),"W"===e.exif.GPSLongitudeRef.value.join("")&&(e.gps.Longitude=-e.gps.Longitude)}catch(e){}if(e.exif.GPSAltitude&&e.exif.GPSAltitudeRef)try{e.gps=e.gps||{},e.gps.Altitude=e.exif.GPSAltitude.value[0]/e.exif.GPSAltitude.value[1],1===e.exif.GPSAltitudeRef.value&&(e.gps.Altitude=-e.gps.Altitude)}catch(e){}}}function Gt(e){return void 0!==e}function jt(e){return Array.isArray(e)&&e.length>0}function Bt(e){return Array.isArray(e)&&e.length>0}function zt(e){return void 0!==e}function Wt(e){return void 0!==e}}])})); //# sourceMappingURL=exif-reader.js.map \ No newline at end of file diff --git a/dist/exif-reader.js.map b/dist/exif-reader.js.map index 00cda82..946f406 100644 --- a/dist/exif-reader.js.map +++ b/dist/exif-reader.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://ExifReader/webpack/universalModuleDefinition","webpack://ExifReader/webpack/bootstrap","webpack://ExifReader/./src/dom-parser.js","webpack://ExifReader/./src/utils.js","webpack://ExifReader/./src/dataview.js","webpack://ExifReader/./src/tag-names-utils.js","webpack://ExifReader/./src/byte-order.js","webpack://ExifReader/./src/image-header-jpeg.js","webpack://ExifReader/./src/image-header-png.js","webpack://ExifReader/./src/image-header-heic.js","webpack://ExifReader/./src/image-header-webp.js","webpack://ExifReader/./src/image-header.js","webpack://ExifReader/./src/image-header-tiff.js","webpack://ExifReader/./src/types.js","webpack://ExifReader/./src/tag-names-common.js","webpack://ExifReader/./src/tag-names-gps-ifd.js","webpack://ExifReader/./src/tag-names-interoperability-ifd.js","webpack://ExifReader/./src/tag-names-mpf-ifd.js","webpack://ExifReader/./src/tag-names.js","webpack://ExifReader/./src/tag-names-0th-ifd.js","webpack://ExifReader/./src/tag-names-exif-ifd.js","webpack://ExifReader/./src/tags.js","webpack://ExifReader/./src/file-tags.js","webpack://ExifReader/./src/iptc-tag-names.js","webpack://ExifReader/./src/text-decoder.js","webpack://ExifReader/./src/tag-decoder.js","webpack://ExifReader/./src/iptc-tags.js","webpack://ExifReader/./src/xmp-tag-names.js","webpack://ExifReader/./src/xmp-tags.js","webpack://ExifReader/./src/icc-tag-names.js","webpack://ExifReader/./src/icc-tags.js","webpack://ExifReader/./src/png-file-tags.js","webpack://ExifReader/./src/thumbnail.js","webpack://ExifReader/./src/errors.js","webpack://ExifReader/./src/exif-reader.js"],"names":["root","factory","exports","module","define","amd","self","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","DOMParser","eval","error","getStringFromDataView","dataView","offset","length","chars","byteLength","push","getUint8","getStringValueFromArray","getUnicodeStringFromDataView","getUint16","charArray","map","charCode","String","fromCharCode","join","objectAssign","arguments","deferInit","initializer","initialized","configurable","apply","writable","getBase64Image","image","btoa","Array","reduce","Uint8Array","data","byte","Buffer","undefined","from","toString","DataView","buffer","readUInt8","readUInt16LE","readUInt16BE","readUInt32LE","readUInt32BE","readInt32LE","readInt32BE","bufferTypeIsUnsupported","Error","littleEndian","getStringValue","getEncodedString","encoding","slice","getCalculatedGpsValue","tiffHeaderOffset","isSOF0Marker","appMarkerPosition","isSOF2Marker","isApp2ICCMarker","APP2_ICC_IDENTIFIER","isApp2MPFMarker","APP2_MPF_IDENTIFIER","isApp1ExifMarker","APP1_EXIF_IDENTIFIER","isApp1XmpMarker","APP1_XMP_IDENTIFIER","isXmpIdentifier","isApp1ExtendedXmpMarker","APP1_XMP_EXTENDED_IDENTIFIER","isExtendedXmpIdentifier","getXmpChunkDetails","fieldLength","dataOffset","getExtendedXmpChunkDetails","isApp13PhotoshopMarker","APP13_IPTC_IDENTIFIER","isAppMarker","appMarker","isPngImageHeaderChunk","isPngXmpChunk","PNG_CHUNK_LENGTH_SIZE","PNG_XMP_PREFIX","getPngXmpDataOffset","PNG_CHUNK_DATA_OFFSET","numberOfNullSeparators","getAtomLength","atomLength","getUint32","extendsToEndOfFile","hasExtendedSize","hasEmptyHighBits","hasTiffMarker","Tiff","hasAppMarkers","Jpeg","sof0DataOffset","sof2DataOffset","iptcDataOffset","xmpChunks","iccChunks","mpfDataOffset","iccDataOffset","iccDataLength","iccChunkNumber","APP_ID_OFFSET","iccChunksTotal","ICC_CHUNK_NUMBER_OFFSET","chunkNumber","chunksTotal","fileDataOffset","PNG_ID","Png","offsets","pngHeaderOffset","heicMajorBrand","HEIC_ID_OFFSET","HEIC_ID","indexOf","Heic","findMetaAtom","metaOffset","metaLength","metaEndOffset","Math","min","ilocOffset","exifItemOffset","colrOffset","itemName","findMetaItems","exifOffset","exifItemIndex","exifPointer","findExifOffset","colorType","findIccChunks","RIFF_ID","WEBP_MARKER","Webp","chunkId","chunkSize","EXIF_IDENTIFIER","typeSizes","1","2","3","4","5","7","9","10","13","tagTypes","getAsciiValue","getByteAt","getAsciiAt","getShortAt","byteOrder","getLongAt","getRationalAt","getUndefinedAt","getSlongAt","getSrationalAt","getIfdPointerAt","getTypeSize","typeName","getInt32","0","ref","values","num","test","status","description","tagNames0thExifIfds","round","formats","6","isArray","sample","TagNamesCommon","character","pow","sqrt","toFixed","x","y","focalLengths","TagNamesGpsIfd","TagNamesInteroperabilityIfd","TagNamesMpfIfd","getTagValueAt","Types","ByteOrder","tags","readIfd","get0thIfdOffset","read0thIfd","readInteroperabilityIfd","readGpsIfd","readExifIfd","images","ceil","attributes","getImageNumberValue","getImageFlags","getImageFormat","getImageType","imageSize","imageOffset","isFirstIndividualImage","dependentImage1EntryNumber","dependentImage2EntryNumber","addMpfImages","entries","size","flags","flagsDescription","imageFormat","type","ifdType","FIELD_COUNT_SIZE","numberOfFields","getNumberOfFields","fieldIndex","tag","readTag","id","nextIfdOffset","tagValue","TAG_TYPE_OFFSET","TAG_COUNT_OFFSET","TAG_VALUE_OFFSET","tagCode","tagType","tagCount","tagValueFitsInOffsetSlot","getTagValue","tagValueOffset","tagValueFitsInDataView","asciiValue","decodeURIComponent","escape","decodeAsciiValue","string","j","splitNullSeparatedAsciiString","tagName","tagDescription","TagNames","getDescriptionFromTagValue","count","forceByteType","valueIndex","getLength","numberOfColorComponents","OFFSET","getNumberOfColorComponents","getDataPrecision","getImageHeight","getImageWidth","getSubsampling","components","componentOffset","getComponentIds","getSamplingType","ids","compontent","types","getCreationDate","getCreationTime","getEncodingName","parts","split","stringValue","character0","charAt","character1","parseInt","bits","duration","substr","intValue","formatVersions","objectDataPreviewFileFormat","date","time","parsedTime","Decoder","TextDecoder","decode","parseTags","BYTES_8BIM_SIZE","resourceBlock","getResourceBlock","isNaaResourceBlock","naaBlock","getBlockPadding","getNaaResourceBlock","endOfBlockOffset","tagSize","leadByteIsMissing","getTagName","IptcTagNames","getTagDescription","tagIsRepeatable","tagContainsEncoding","tagIsName","hasDynamicName","hasDescriptionProperty","tagValueIsText","TagDecoder","calculateGPSValue","degreesString","minutesString","degrees","parseFloat","minutes","Number","isNaN","chunks","readTags","completeChunks","combineChunks","extractCompleteChunks","totalLength","chunk","combinedChunks","set","chunkDataView","parseXMPObject","convertToObject","getRDF","node","childNodes","Parser","console","warn","domParser","xmlString","doc","parseFromString","replace","documentElement","nodeName","textContent","getDocument","isTopNode","getChildNodes","hasTextOnlyContent","getTextValue","getElementsFromNodes","elements","nodes","nodeValue","forEach","isElement","nodeElement","getAttributes","getElementFromNode","element","xmpObject","parseNodeAttributesAsTags","parseNodeChildrenAsTags","isTagAttribute","getLocalName","getDescription","isNamespaceDefinition","getDescriptionOfArray","getDescriptionOfObject","XmpTagNames","item","descriptions","getClearTextKey","children","parseNodeAsTag","hasNestedSimpleRdfDescription","parseNodeAsSimpleRdfDescription","hasNestedStructureRdfDescription","parseNodeAttributes","parseNodeAsStructureRdfDescription","keys","isCompactStructure","parseNodeAsCompactStructure","getArrayChild","items","hasNestedArrayValue","parseArrayValue","parseNodeAsArray","getURIValue","parseNodeAsSimpleValue","parseNodeChildrenAsAttributes","parseRdfValue","iccTags","iccProfile","toCompany","8","12","toLowerCase","16","20","24","year","month","day","hours","seconds","Date","UTC","parseDate","toISOString","36","40","48","52","64","80","iccData","totalIccProfileLength","sum","icc","iccBinaryData","getBuffer","iccDataChunk","find","chunkData","iccProfileKeys","profileEntry","sliceToString","ICC_TAG_COUNT_OFFSET","iccDoesNotHaveTagCount","tagHeaderOffset","hasTagsData","tagSignature","tagOffset","tagValueSize","addTag","numRecords","recordSize","val","recordNum","languageCode","countryCode","textLength","textOffset","text","valObj","valIndex","getBitDepth","getColorType","getCompression","getFilter","getInterlace","COMPRESSION_JPEG","thumbnailTags","Compression","includes","JPEGInterchangeFormat","JPEGInterchangeFormatLength","MetadataMissingError","message","stack","errors","load","loadView","exifErrors","options","expanded","isNodeBuffer","getDataView","isBuffer","DataViewWrapper","foundMetaData","ImageHeader","hasFileData","FileTags","file","hasExifData","Tags","Thumbnail","exif","addGpsGroup","hasIptcData","readIptcTags","IptcTags","iptc","hasXmpData","readXmpTags","XmpTags","xmp","hasIccData","readIccTags","IccTags","hasMpfData","readMpfTags","mpf","hasPngFileData","PngFileTags","pngFile","thumbnail","GPSLatitude","GPSLatitudeRef","gps","Latitude","GPSLongitude","GPSLongitudeRef","Longitude","GPSAltitude","GPSAltitudeRef","Altitude","iccDataOffsets","pngFileDataOffset"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAoB,WAAID,IAExBD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AWpY,GAChB,OAAOtE,MAAMsJ,QAAQhF,IAAcA,EAAU/F,OAAS,EAG1D,SAASue,GAAWoB,GAChB,OAAOle,MAAMsJ,QAAQ4U,IAAmBA,EAAe3f,OAAS,EAGpE,SAAS0e,GAAWzY,GAChB,YAAyBlE,IAAlBkE,EAGX,SAAS4Y,GAAee,GACpB,YAA6B7d,IAAtB6d","file":"exif-reader.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ExifReader\"] = factory();\n\telse\n\t\troot[\"ExifReader\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nexport default {\n get\n};\n\nfunction get() {\n if (typeof DOMParser !== 'undefined') {\n return DOMParser;\n }\n try {\n return eval('require')('xmldom').DOMParser; // This stops Webpack from replacing the require with a generic import and bundling the module.\n } catch (error) {\n return undefined;\n }\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nexport function getStringFromDataView(dataView, offset, length) {\n const chars = [];\n for (let i = 0; i < length && offset + i < dataView.byteLength; i++) {\n chars.push(dataView.getUint8(offset + i));\n }\n return getStringValueFromArray(chars);\n}\n\nexport function getUnicodeStringFromDataView(dataView, offset, length) {\n const chars = [];\n for (let i = 0; i < length && offset + i < dataView.byteLength; i += 2) {\n chars.push(dataView.getUint16(offset + i));\n }\n return getStringValueFromArray(chars);\n}\n\nexport function getStringValueFromArray(charArray) {\n return charArray.map((charCode) => String.fromCharCode(charCode)).join('');\n}\n\nexport function getCharacterArray(string) {\n return string.split('').map((character) => character.charCodeAt(0));\n}\n\nexport function objectAssign() {\n for (let i = 1; i < arguments.length; i++) {\n for (const property in arguments[i]) {\n arguments[0][property] = arguments[i][property];\n }\n }\n\n return arguments[0];\n}\n\nexport function deferInit(object, key, initializer) {\n let initialized = false;\n Object.defineProperty(object, key, {\n get() {\n if (!initialized) {\n initialized = true;\n Object.defineProperty(object, key, {\n configurable: true,\n enumerable: true,\n value: initializer.apply(object),\n writable: true\n });\n }\n return object[key];\n },\n configurable: true,\n enumerable: true\n });\n}\n\nexport function getBase64Image(image) {\n if (typeof btoa !== 'undefined') {\n // IE11- does not implement reduce on the Uint8Array prototype.\n return btoa(Array.prototype.reduce.call(new Uint8Array(image), (data, byte) => data + String.fromCharCode(byte), ''));\n }\n if (typeof Buffer === 'undefined') {\n return undefined;\n }\n if (typeof Buffer.from !== undefined) { // eslint-disable-line no-undef\n return Buffer.from(image).toString('base64'); // eslint-disable-line no-undef\n }\n return (new Buffer(image)).toString('base64'); // eslint-disable-line no-undef\n}\n","export default class DataView {\n constructor(buffer) {\n if (bufferTypeIsUnsupported(buffer)) {\n throw new Error('DataView: Passed buffer type is unsupported.');\n }\n\n this.buffer = buffer;\n this.byteLength = this.buffer.length;\n }\n\n getUint8(offset) {\n return this.buffer.readUInt8(offset);\n }\n\n getUint16(offset, littleEndian) {\n if (littleEndian) {\n return this.buffer.readUInt16LE(offset);\n }\n return this.buffer.readUInt16BE(offset);\n }\n\n getUint32(offset, littleEndian) {\n if (littleEndian) {\n return this.buffer.readUInt32LE(offset);\n }\n return this.buffer.readUInt32BE(offset);\n }\n\n getInt32(offset, littleEndian) {\n if (littleEndian) {\n return this.buffer.readInt32LE(offset);\n }\n return this.buffer.readInt32BE(offset);\n }\n}\n\nfunction bufferTypeIsUnsupported(buffer) {\n return typeof buffer !== 'object'\n || buffer.length === undefined\n || buffer.readUInt8 === undefined\n || buffer.readUInt16LE === undefined\n || buffer.readUInt16BE === undefined\n || buffer.readUInt32LE === undefined\n || buffer.readUInt32BE === undefined\n || buffer.readInt32LE === undefined\n || buffer.readInt32BE === undefined;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nexport function getStringValue(value) {\n return value.map((charCode) => String.fromCharCode(charCode)).join('');\n}\n\nexport function getEncodedString(value) {\n if (value.length >= 8) {\n const encoding = getStringValue(value.slice(0, 8));\n\n if (encoding === 'ASCII\\x00\\x00\\x00') {\n return getStringValue(value.slice(8));\n } else if (encoding === 'JIS\\x00\\x00\\x00\\x00\\x00') {\n return '[JIS encoded text]';\n } else if (encoding === 'UNICODE\\x00') {\n return '[Unicode encoded text]';\n } else if (encoding === '\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00') {\n return '[Undefined encoding]';\n }\n }\n\n return 'Undefined';\n}\n\nexport function getCalculatedGpsValue(value) {\n return (value[0][0] / value[0][1]) + (value[1][0] / value[1][1]) / 60 + (value[2][0] / value[2][1]) / 3600;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nconst LITTLE_ENDIAN = 0x4949;\nconst BIG_ENDIAN = 0x4d4d;\n\nexport default {\n BIG_ENDIAN,\n LITTLE_ENDIAN,\n getByteOrder\n};\n\nfunction getByteOrder(dataView, tiffHeaderOffset) {\n if (dataView.getUint16(tiffHeaderOffset) === LITTLE_ENDIAN) {\n return LITTLE_ENDIAN;\n } else if (dataView.getUint16(tiffHeaderOffset) === BIG_ENDIAN) {\n return BIG_ENDIAN;\n }\n throw new Error('Illegal byte order value. Faulty image.');\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringFromDataView} from './utils.js';\nimport Constants from './constants.js';\n\nexport default {\n isJpegFile,\n findJpegOffsets\n};\n\nconst MIN_JPEG_DATA_BUFFER_LENGTH = 2;\nconst JPEG_ID = 0xffd8;\nconst JPEG_ID_SIZE = 2;\nconst APP_ID_OFFSET = 4;\nconst APP_MARKER_SIZE = 2;\nconst TIFF_HEADER_OFFSET = 10; // From start of APP1 marker.\nconst IPTC_DATA_OFFSET = 18; // From start of APP13 marker.\nconst XMP_DATA_OFFSET = 33; // From start of APP1 marker.\nconst XMP_EXTENDED_DATA_OFFSET = 79; // From start of APP1 marker including GUID, total length, and offset.\nconst APP2_ICC_DATA_OFFSET = 18; // From start of APP2 marker including marker and chunk/chunk total numbers.\nconst MPF_DATA_OFFSET = 8;\n\nconst APP2_ICC_IDENTIFIER = 'ICC_PROFILE\\0';\nconst ICC_CHUNK_NUMBER_OFFSET = APP_ID_OFFSET + APP2_ICC_IDENTIFIER.length;\nconst ICC_TOTAL_CHUNKS_OFFSET = ICC_CHUNK_NUMBER_OFFSET + 1;\n\nconst APP2_MPF_IDENTIFIER = 'MPF\\0';\n\nconst SOF0_MARKER = 0xffc0;\nconst SOF2_MARKER = 0xffc2;\nconst DHT_MARKER = 0xffc4;\nconst DQT_MARKER = 0xffdb;\nconst DRI_MARKER = 0xffdd;\nconst SOS_MARKER = 0xffda;\n\nconst APP0_MARKER = 0xffe0;\nconst APP1_MARKER = 0xffe1;\nconst APP2_MARKER = 0xffe2;\nconst APP13_MARKER = 0xffed;\nconst APP15_MARKER = 0xffef;\nconst COMMENT_MARKER = 0xfffe;\n\nconst APP1_EXIF_IDENTIFIER = 'Exif';\nconst APP1_XMP_IDENTIFIER = 'http://ns.adobe.com/xap/1.0/\\x00';\nconst APP1_XMP_EXTENDED_IDENTIFIER = 'http://ns.adobe.com/xmp/extension/\\x00';\nconst APP13_IPTC_IDENTIFIER = 'Photoshop 3.0';\n\nfunction isJpegFile(dataView) {\n return (dataView.byteLength >= MIN_JPEG_DATA_BUFFER_LENGTH) && (dataView.getUint16(0) === JPEG_ID);\n}\n\nfunction findJpegOffsets(dataView) {\n let appMarkerPosition = JPEG_ID_SIZE;\n let fieldLength;\n let sof0DataOffset;\n let sof2DataOffset;\n let tiffHeaderOffset;\n let iptcDataOffset;\n let xmpChunks;\n let iccChunks;\n let mpfDataOffset;\n\n while (appMarkerPosition + APP_ID_OFFSET + 5 <= dataView.byteLength) {\n if (Constants.USE_FILE && isSOF0Marker(dataView, appMarkerPosition)) {\n sof0DataOffset = appMarkerPosition + APP_MARKER_SIZE;\n } else if (Constants.USE_FILE && isSOF2Marker(dataView, appMarkerPosition)) {\n sof2DataOffset = appMarkerPosition + APP_MARKER_SIZE;\n } else if (Constants.USE_EXIF && isApp1ExifMarker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n tiffHeaderOffset = appMarkerPosition + TIFF_HEADER_OFFSET;\n } else if (Constants.USE_XMP && isApp1XmpMarker(dataView, appMarkerPosition)) {\n if (!xmpChunks) {\n xmpChunks = [];\n }\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n xmpChunks.push(getXmpChunkDetails(appMarkerPosition, fieldLength));\n } else if (Constants.USE_XMP && isApp1ExtendedXmpMarker(dataView, appMarkerPosition)) {\n if (!xmpChunks) {\n xmpChunks = [];\n }\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n xmpChunks.push(getExtendedXmpChunkDetails(appMarkerPosition, fieldLength));\n } else if (Constants.USE_IPTC && isApp13PhotoshopMarker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n iptcDataOffset = appMarkerPosition + IPTC_DATA_OFFSET;\n } else if (Constants.USE_ICC && isApp2ICCMarker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n const iccDataOffset = appMarkerPosition + APP2_ICC_DATA_OFFSET;\n const iccDataLength = fieldLength - (APP2_ICC_DATA_OFFSET - APP_MARKER_SIZE);\n\n const iccChunkNumber = dataView.getUint8(appMarkerPosition + ICC_CHUNK_NUMBER_OFFSET);\n const iccChunksTotal = dataView.getUint8(appMarkerPosition + ICC_TOTAL_CHUNKS_OFFSET);\n if (!iccChunks) {\n iccChunks = [];\n }\n iccChunks.push({offset: iccDataOffset, length: iccDataLength, chunkNumber: iccChunkNumber, chunksTotal: iccChunksTotal});\n } else if (Constants.USE_MPF && isApp2MPFMarker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n mpfDataOffset = appMarkerPosition + MPF_DATA_OFFSET;\n } else if (isAppMarker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n } else {\n break;\n }\n appMarkerPosition += APP_MARKER_SIZE + fieldLength;\n }\n\n return {\n hasAppMarkers: appMarkerPosition > JPEG_ID_SIZE,\n fileDataOffset: sof0DataOffset || sof2DataOffset,\n tiffHeaderOffset,\n iptcDataOffset,\n xmpChunks,\n iccChunks,\n mpfDataOffset\n };\n}\n\nfunction isSOF0Marker(dataView, appMarkerPosition) {\n return (dataView.getUint16(appMarkerPosition) === SOF0_MARKER);\n}\n\nfunction isSOF2Marker(dataView, appMarkerPosition) {\n return (dataView.getUint16(appMarkerPosition) === SOF2_MARKER);\n}\n\nfunction isApp2ICCMarker(dataView, appMarkerPosition) {\n const markerIdLength = APP2_ICC_IDENTIFIER.length;\n\n return (dataView.getUint16(appMarkerPosition) === APP2_MARKER)\n && (getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP2_ICC_IDENTIFIER);\n}\n\nfunction isApp2MPFMarker(dataView, appMarkerPosition) {\n const markerIdLength = APP2_MPF_IDENTIFIER.length;\n\n return (dataView.getUint16(appMarkerPosition) === APP2_MARKER)\n && (getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP2_MPF_IDENTIFIER);\n}\n\nfunction isApp1ExifMarker(dataView, appMarkerPosition) {\n const markerIdLength = APP1_EXIF_IDENTIFIER.length;\n\n return (dataView.getUint16(appMarkerPosition) === APP1_MARKER)\n && (getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP1_EXIF_IDENTIFIER)\n && (dataView.getUint8(appMarkerPosition + APP_ID_OFFSET + markerIdLength) === 0x00);\n}\n\nfunction isApp1XmpMarker(dataView, appMarkerPosition) {\n return (dataView.getUint16(appMarkerPosition) === APP1_MARKER)\n && isXmpIdentifier(dataView, appMarkerPosition);\n}\n\nfunction isXmpIdentifier(dataView, appMarkerPosition) {\n const markerIdLength = APP1_XMP_IDENTIFIER.length;\n return getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP1_XMP_IDENTIFIER;\n}\n\nfunction isApp1ExtendedXmpMarker(dataView, appMarkerPosition) {\n return (dataView.getUint16(appMarkerPosition) === APP1_MARKER)\n && isExtendedXmpIdentifier(dataView, appMarkerPosition);\n}\n\nfunction isExtendedXmpIdentifier(dataView, appMarkerPosition) {\n const markerIdLength = APP1_XMP_EXTENDED_IDENTIFIER.length;\n return getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP1_XMP_EXTENDED_IDENTIFIER;\n}\n\nfunction getXmpChunkDetails(appMarkerPosition, fieldLength) {\n return {\n dataOffset: appMarkerPosition + XMP_DATA_OFFSET,\n length: fieldLength - (XMP_DATA_OFFSET - APP_MARKER_SIZE)\n };\n}\n\nfunction getExtendedXmpChunkDetails(appMarkerPosition, fieldLength) {\n return {\n dataOffset: appMarkerPosition + XMP_EXTENDED_DATA_OFFSET,\n length: fieldLength - (XMP_EXTENDED_DATA_OFFSET - APP_MARKER_SIZE)\n };\n}\n\nfunction isApp13PhotoshopMarker(dataView, appMarkerPosition) {\n const markerIdLength = APP13_IPTC_IDENTIFIER.length;\n\n return (dataView.getUint16(appMarkerPosition) === APP13_MARKER)\n && (getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP13_IPTC_IDENTIFIER)\n && (dataView.getUint8(appMarkerPosition + APP_ID_OFFSET + markerIdLength) === 0x00);\n}\n\nfunction isAppMarker(dataView, appMarkerPosition) {\n const appMarker = dataView.getUint16(appMarkerPosition);\n return ((appMarker >= APP0_MARKER) && (appMarker <= APP15_MARKER))\n || (appMarker === COMMENT_MARKER)\n || (appMarker === SOF0_MARKER)\n || (appMarker === SOF2_MARKER)\n || (appMarker === DHT_MARKER)\n || (appMarker === DQT_MARKER)\n || (appMarker === DRI_MARKER)\n || (appMarker === SOS_MARKER);\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringFromDataView} from './utils.js';\nimport Constants from './constants.js';\n\nexport default {\n isPngFile,\n findPngOffsets\n};\n\nconst PNG_ID = '\\x89\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a';\nconst PNG_CHUNK_LENGTH_SIZE = 4;\nconst PNG_CHUNK_TYPE_SIZE = 4;\nconst PNG_CHUNK_LENGTH_OFFSET = 0;\nconst PNG_CHUNK_TYPE_OFFSET = PNG_CHUNK_LENGTH_SIZE;\nconst PNG_CHUNK_DATA_OFFSET = PNG_CHUNK_LENGTH_SIZE + PNG_CHUNK_TYPE_SIZE;\nconst PNG_XMP_PREFIX = 'XML:com.adobe.xmp\\x00';\n\nfunction isPngFile(dataView) {\n return getStringFromDataView(dataView, 0, PNG_ID.length) === PNG_ID;\n}\n\nfunction findPngOffsets(dataView) {\n const PNG_CRC_SIZE = 4;\n\n const offsets = {\n hasAppMarkers: false\n };\n\n let offset = PNG_ID.length;\n\n while (offset + PNG_CHUNK_LENGTH_SIZE + PNG_CHUNK_TYPE_SIZE <= dataView.byteLength) {\n if (Constants.USE_PNG_FILE && isPngImageHeaderChunk(dataView, offset)) {\n offsets.hasAppMarkers = true;\n offsets.pngHeaderOffset = offset + PNG_CHUNK_DATA_OFFSET;\n } else if (Constants.USE_XMP && isPngXmpChunk(dataView, offset)) {\n const dataOffset = getPngXmpDataOffset(dataView, offset);\n if (dataOffset !== undefined) {\n offsets.hasAppMarkers = true;\n offsets.xmpChunks = [{\n dataOffset,\n length: dataView.getUint32(offset + PNG_CHUNK_LENGTH_OFFSET) - (dataOffset - (offset + PNG_CHUNK_DATA_OFFSET))\n }];\n }\n }\n\n offset += dataView.getUint32(offset + PNG_CHUNK_LENGTH_OFFSET)\n + PNG_CHUNK_LENGTH_SIZE\n + PNG_CHUNK_TYPE_SIZE\n + PNG_CRC_SIZE;\n }\n\n return offsets;\n}\n\nfunction isPngImageHeaderChunk(dataView, offset) {\n const PNG_CHUNK_TYPE_IMAGE_HEADER = 'IHDR';\n return getStringFromDataView(dataView, offset + PNG_CHUNK_TYPE_OFFSET, PNG_CHUNK_TYPE_SIZE) === PNG_CHUNK_TYPE_IMAGE_HEADER;\n}\n\nfunction isPngXmpChunk(dataView, offset) {\n const PNG_CHUNK_TYPE_INTERNATIONAL_TEXT = 'iTXt';\n return (getStringFromDataView(dataView, offset + PNG_CHUNK_TYPE_OFFSET, PNG_CHUNK_TYPE_SIZE) === PNG_CHUNK_TYPE_INTERNATIONAL_TEXT)\n && (getStringFromDataView(dataView, offset + PNG_CHUNK_DATA_OFFSET, PNG_XMP_PREFIX.length) === PNG_XMP_PREFIX);\n}\n\nfunction getPngXmpDataOffset(dataView, offset) {\n const COMPRESSION_FLAG_SIZE = 1;\n const COMPRESSION_METHOD_SIZE = 1;\n\n offset += PNG_CHUNK_DATA_OFFSET + PNG_XMP_PREFIX.length + COMPRESSION_FLAG_SIZE + COMPRESSION_METHOD_SIZE;\n\n let numberOfNullSeparators = 0;\n while (numberOfNullSeparators < 2 && offset < dataView.byteLength) {\n if (dataView.getUint8(offset) === 0x00) {\n numberOfNullSeparators++;\n }\n offset++;\n }\n if (numberOfNullSeparators < 2) {\n return undefined;\n }\n return offset;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringFromDataView} from './utils.js';\nimport Constants from './constants.js';\n\nexport default {\n isHeicFile,\n findHeicOffsets\n};\n\nfunction isHeicFile(dataView) {\n const HEIC_ID = 'ftyp';\n const HEIC_ID_OFFSET = 4;\n const HEIC_MAJOR_BRANDS = ['heic', 'heix', 'hevc', 'hevx', 'heim', 'heis', 'hevm', 'hevs', 'mif1'];\n const HEIC_MAJOR_BRAND_LENGTH = 4;\n\n const heicMajorBrand = getStringFromDataView(dataView, HEIC_ID_OFFSET + HEIC_ID.length, HEIC_MAJOR_BRAND_LENGTH);\n\n return (getStringFromDataView(dataView, HEIC_ID_OFFSET, HEIC_ID.length) === HEIC_ID)\n && (HEIC_MAJOR_BRANDS.indexOf(heicMajorBrand) !== -1);\n}\n\nfunction findHeicOffsets(dataView) {\n if (Constants.USE_EXIF || Constants.USE_ICC) {\n const {offset: metaOffset, length: metaLength} = findMetaAtom(dataView);\n if (metaOffset === undefined) {\n return {hasAppMarkers: false};\n }\n\n const metaEndOffset = Math.min(metaOffset + metaLength, dataView.byteLength);\n const {exifItemOffset, ilocOffset, colrOffset} = findMetaItems(dataView, metaOffset, metaEndOffset);\n\n const exifOffset = findExifOffset(dataView, exifItemOffset, ilocOffset, metaEndOffset);\n const iccChunks = findIccChunks(dataView, colrOffset, metaEndOffset);\n return {\n hasAppMarkers: (exifOffset !== undefined) || (iccChunks !== undefined),\n tiffHeaderOffset: exifOffset,\n iccChunks\n };\n }\n\n return {hasAppMarkers: false};\n}\n\nfunction findMetaAtom(dataView) {\n const ATOM_LENGTH_SIZE = 4;\n const ATOM_TYPE_SIZE = 4;\n const ATOM_MIN_LENGTH = 8;\n const ATOM_TYPE_OFFSET = 4;\n\n let offset = 0;\n\n while (offset + ATOM_LENGTH_SIZE + ATOM_TYPE_SIZE <= dataView.byteLength) {\n const atomLength = getAtomLength(dataView, offset);\n if (atomLength >= ATOM_MIN_LENGTH) {\n const atomType = getStringFromDataView(dataView, offset + ATOM_TYPE_OFFSET, ATOM_TYPE_SIZE);\n if (atomType === 'meta') {\n return {\n offset,\n length: atomLength\n };\n }\n }\n\n offset += atomLength;\n }\n\n return {\n offset: undefined,\n length: 0\n };\n}\n\nfunction getAtomLength(dataView, offset) {\n const ATOM_EXTENDED_SIZE_LOW_OFFSET = 12;\n\n const atomLength = dataView.getUint32(offset);\n if (extendsToEndOfFile(atomLength)) {\n return dataView.byteLength - offset;\n }\n if (hasExtendedSize(atomLength)) {\n if (hasEmptyHighBits(dataView, offset)) {\n // It's a bit tricky to handle 64 bit numbers in JavaScript. Let's\n // wait until there are real-world examples where it is necessary.\n return dataView.getUint32(offset + ATOM_EXTENDED_SIZE_LOW_OFFSET);\n }\n }\n\n return atomLength;\n}\n\nfunction extendsToEndOfFile(atomLength) {\n return atomLength === 0;\n}\n\nfunction hasExtendedSize(atomLength) {\n return atomLength === 1;\n}\n\nfunction hasEmptyHighBits(dataView, offset) {\n const ATOM_EXTENDED_SIZE_OFFSET = 8;\n return dataView.getUint32(offset + ATOM_EXTENDED_SIZE_OFFSET) === 0;\n}\n\nfunction findMetaItems(dataView, offset, metaEndOffset) {\n const STRING_SIZE = 4;\n const ITEM_INDEX_REL_OFFSET = -4;\n const offsets = {\n ilocOffset: undefined,\n exifItemOffset: undefined,\n colrOffset: undefined\n };\n\n while ((offset + STRING_SIZE <= metaEndOffset)\n && (!offsets.ilocOffset || !offsets.exifItemOffset || !offsets.colrOffset)) {\n const itemName = getStringFromDataView(dataView, offset, STRING_SIZE);\n if (Constants.USE_EXIF && (itemName === 'iloc')) {\n offsets.ilocOffset = offset;\n } else if (Constants.USE_EXIF && (itemName === 'Exif')) {\n offsets.exifItemOffset = offset + ITEM_INDEX_REL_OFFSET;\n } else if (Constants.USE_ICC && (itemName === 'colr')) {\n offsets.colrOffset = offset + ITEM_INDEX_REL_OFFSET;\n }\n\n offset++;\n }\n\n return offsets;\n}\n\nfunction findExifOffset(dataView, exifItemOffset, offset, metaEndOffset) {\n const EXIF_ITEM_OFFSET_SIZE = 2;\n const ILOC_DATA_OFFSET = 12;\n const EXIF_POINTER_OFFSET = 8;\n const EXIF_POINTER_SIZE = 4;\n const EXIF_PREFIX_LENGTH_OFFSET = 4;\n const ILOC_ITEM_SIZE = 16;\n\n if (!offset || !exifItemOffset || (exifItemOffset + EXIF_ITEM_OFFSET_SIZE > metaEndOffset)) {\n return undefined;\n }\n\n const exifItemIndex = dataView.getUint16(exifItemOffset);\n offset += ILOC_DATA_OFFSET;\n\n while (offset + ILOC_ITEM_SIZE <= metaEndOffset) {\n const itemIndex = dataView.getUint16(offset);\n if (itemIndex === exifItemIndex) {\n const exifPointer = dataView.getUint32(offset + EXIF_POINTER_OFFSET);\n if (exifPointer + EXIF_POINTER_SIZE <= dataView.byteLength) {\n const exifOffset = dataView.getUint32(exifPointer);\n const prefixLength = exifOffset + EXIF_PREFIX_LENGTH_OFFSET;\n return exifPointer + prefixLength;\n }\n }\n offset += ILOC_ITEM_SIZE;\n }\n\n return undefined;\n}\n\nfunction findIccChunks(dataView, offset, metaEndOffset) {\n const ITEM_TYPE_OFFSET = 8;\n const ITEM_TYPE_SIZE = 4;\n const ITEM_CONTENT_OFFSET = 12;\n\n if (!offset || (offset + ITEM_CONTENT_OFFSET > metaEndOffset)) {\n return undefined;\n }\n\n const colorType = getStringFromDataView(dataView, offset + ITEM_TYPE_OFFSET, ITEM_TYPE_SIZE);\n if ((colorType !== 'prof') && (colorType !== 'rICC')) {\n return undefined;\n }\n\n return [{\n offset: offset + ITEM_CONTENT_OFFSET,\n length: getAtomLength(dataView, offset) - ITEM_CONTENT_OFFSET,\n chunkNumber: 1,\n chunksTotal: 1\n }];\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringFromDataView} from './utils.js';\nimport Constants from './constants.js';\n\nexport default {\n isWebpFile,\n findOffsets\n};\n\nfunction isWebpFile(dataView) {\n const RIFF_ID_OFFSET = 0;\n const RIFF_ID = 'RIFF';\n const WEBP_MARKER_OFFSET = 8;\n const WEBP_MARKER = 'WEBP';\n\n return getStringFromDataView(dataView, RIFF_ID_OFFSET, RIFF_ID.length) === RIFF_ID\n && getStringFromDataView(dataView, WEBP_MARKER_OFFSET, WEBP_MARKER.length) === WEBP_MARKER;\n}\n\nfunction findOffsets(dataView) {\n const SUB_CHUNK_START_OFFSET = 12;\n const CHUNK_SIZE_OFFSET = 4;\n const EXIF_IDENTIFIER = 'Exif\\x00\\x00';\n const CHUNK_HEADER_SIZE = 8;\n\n let offset = SUB_CHUNK_START_OFFSET;\n let hasAppMarkers = false;\n let tiffHeaderOffset;\n let xmpChunks;\n let iccChunks;\n\n while (offset + CHUNK_HEADER_SIZE < dataView.byteLength) {\n const chunkId = getStringFromDataView(dataView, offset, 4);\n const chunkSize = dataView.getUint32(offset + CHUNK_SIZE_OFFSET, true);\n\n if (Constants.USE_EXIF && (chunkId === 'EXIF')) {\n hasAppMarkers = true;\n if (getStringFromDataView(dataView, offset + CHUNK_HEADER_SIZE, EXIF_IDENTIFIER.length) === EXIF_IDENTIFIER) {\n tiffHeaderOffset = offset + CHUNK_HEADER_SIZE + EXIF_IDENTIFIER.length;\n } else {\n tiffHeaderOffset = offset + CHUNK_HEADER_SIZE;\n }\n } else if (Constants.USE_XMP && (chunkId === 'XMP ')) {\n hasAppMarkers = true;\n xmpChunks = [{\n dataOffset: offset + CHUNK_HEADER_SIZE,\n length: chunkSize\n }];\n } else if (Constants.USE_ICC && (chunkId === 'ICCP')) {\n hasAppMarkers = true;\n iccChunks = [{\n offset: offset + CHUNK_HEADER_SIZE,\n length: chunkSize,\n chunkNumber: 1,\n chunksTotal: 1\n }];\n }\n\n offset += CHUNK_HEADER_SIZE + (chunkSize % 2 === 0 ? chunkSize : chunkSize + 1);\n }\n\n return {\n hasAppMarkers,\n tiffHeaderOffset,\n xmpChunks,\n iccChunks\n };\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport Constants from './constants.js';\nimport Tiff from './image-header-tiff.js';\nimport Jpeg from './image-header-jpeg.js';\nimport Png from './image-header-png.js';\nimport Heic from './image-header-heic.js';\nimport Webp from './image-header-webp.js';\n\nexport default {\n parseAppMarkers\n};\n\nfunction parseAppMarkers(dataView) {\n if (Constants.USE_TIFF && Tiff.isTiffFile(dataView)) {\n return Tiff.findTiffOffsets();\n }\n\n if (Constants.USE_JPEG && Jpeg.isJpegFile(dataView)) {\n return Jpeg.findJpegOffsets(dataView);\n }\n\n if (Constants.USE_PNG && Png.isPngFile(dataView)) {\n return Png.findPngOffsets(dataView);\n }\n\n if (Constants.USE_HEIC && Heic.isHeicFile(dataView)) {\n return Heic.findHeicOffsets(dataView);\n }\n\n if (Constants.USE_WEBP && Webp.isWebpFile(dataView)) {\n return Webp.findOffsets(dataView);\n }\n\n throw new Error('Invalid image format');\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport ByteOrder from './byte-order.js';\nimport Constants from './constants.js';\n\nexport default {\n isTiffFile,\n findTiffOffsets\n};\n\nfunction isTiffFile(dataView) {\n const MIN_TIFF_DATA_BUFFER_LENGTH = 4;\n\n return (dataView.byteLength >= MIN_TIFF_DATA_BUFFER_LENGTH) && hasTiffMarker(dataView);\n}\n\nfunction hasTiffMarker(dataView) {\n const TIFF_ID = 0x2a;\n const TIFF_ID_OFFSET = 2;\n\n const littleEndian = dataView.getUint16(0) === ByteOrder.LITTLE_ENDIAN;\n return dataView.getUint16(TIFF_ID_OFFSET, littleEndian) === TIFF_ID;\n}\n\nfunction findTiffOffsets() {\n const TIFF_FILE_HEADER_OFFSET = 0;\n\n if (Constants.USE_EXIF) {\n return {\n hasAppMarkers: true,\n tiffHeaderOffset: TIFF_FILE_HEADER_OFFSET\n };\n }\n return {};\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport ByteOrder from './byte-order.js';\n\nconst typeSizes = {\n 1: 1, // BYTE\n 2: 1, // ASCII\n 3: 2, // SHORT\n 4: 4, // LONG\n 5: 8, // RATIONAL\n 7: 1, // UNDEFINED\n 9: 4, // SLONG\n 10: 8, // SRATIONAL\n 13: 4 // IFD\n};\n\nconst tagTypes = {\n 'BYTE': 1,\n 'ASCII': 2,\n 'SHORT': 3,\n 'LONG': 4,\n 'RATIONAL': 5,\n 'UNDEFINED': 7,\n 'SLONG': 9,\n 'SRATIONAL': 10,\n 'IFD': 13\n};\n\nexport default {\n getAsciiValue,\n getByteAt,\n getAsciiAt,\n getShortAt,\n getLongAt,\n getRationalAt,\n getUndefinedAt,\n getSlongAt,\n getSrationalAt,\n getIfdPointerAt,\n typeSizes,\n tagTypes,\n getTypeSize\n};\n\nfunction getAsciiValue(charArray) {\n return charArray.map((charCode) => String.fromCharCode(charCode));\n}\n\nfunction getByteAt(dataView, offset) {\n return dataView.getUint8(offset);\n}\n\nfunction getAsciiAt(dataView, offset) {\n return dataView.getUint8(offset);\n}\n\nfunction getShortAt(dataView, offset, byteOrder) {\n return dataView.getUint16(offset, byteOrder === ByteOrder.LITTLE_ENDIAN);\n}\n\nfunction getLongAt(dataView, offset, byteOrder) {\n return dataView.getUint32(offset, byteOrder === ByteOrder.LITTLE_ENDIAN);\n}\n\nfunction getRationalAt(dataView, offset, byteOrder) {\n return [getLongAt(dataView, offset, byteOrder), getLongAt(dataView, offset + 4, byteOrder)];\n}\n\nfunction getUndefinedAt(dataView, offset) {\n return getByteAt(dataView, offset);\n}\n\nfunction getSlongAt(dataView, offset, byteOrder) {\n return dataView.getInt32(offset, byteOrder === ByteOrder.LITTLE_ENDIAN);\n}\n\nfunction getSrationalAt(dataView, offset, byteOrder) {\n return [getSlongAt(dataView, offset, byteOrder), getSlongAt(dataView, offset + 4, byteOrder)];\n}\n\nfunction getIfdPointerAt(dataView, offset, byteOrder) {\n return getLongAt(dataView, offset, byteOrder);\n}\n\nfunction getTypeSize(typeName) {\n if (tagTypes[typeName] === undefined) {\n throw new Error('No such type found.');\n }\n\n return typeSizes[tagTypes[typeName]];\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nexport default {\n 'LightSource': (value) => {\n if (value === 1) {\n return 'Daylight';\n } else if (value === 2) {\n return 'Fluorescent';\n } else if (value === 3) {\n return 'Tungsten (incandescent light)';\n } else if (value === 4) {\n return 'Flash';\n } else if (value === 9) {\n return 'Fine weather';\n } else if (value === 10) {\n return 'Cloudy weather';\n } else if (value === 11) {\n return 'Shade';\n } else if (value === 12) {\n return 'Daylight fluorescent (D 5700 – 7100K)';\n } else if (value === 13) {\n return 'Day white fluorescent (N 4600 – 5400K)';\n } else if (value === 14) {\n return 'Cool white fluorescent (W 3900 – 4500K)';\n } else if (value === 15) {\n return 'White fluorescent (WW 3200 – 3700K)';\n } else if (value === 17) {\n return 'Standard light A';\n } else if (value === 18) {\n return 'Standard light B';\n } else if (value === 19) {\n return 'Standard light C';\n } else if (value === 20) {\n return 'D55';\n } else if (value === 21) {\n return 'D65';\n } else if (value === 22) {\n return 'D75';\n } else if (value === 23) {\n return 'D50';\n } else if (value === 24) {\n return 'ISO studio tungsten';\n } else if (value === 255) {\n return 'Other light source';\n }\n return 'Unknown';\n }\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getEncodedString, getCalculatedGpsValue} from './tag-names-utils.js';\n\nexport default {\n 0x0000: {\n 'name': 'GPSVersionID',\n 'description': (value) => {\n if (value[0] === 2 && value[1] === 2 && value[2] === 0 && value[3] === 0) {\n return 'Version 2.2';\n }\n return 'Unknown';\n }\n },\n 0x0001: {\n 'name': 'GPSLatitudeRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'N') {\n return 'North latitude';\n } else if (ref === 'S') {\n return 'South latitude';\n }\n return 'Unknown';\n }\n },\n 0x0002: {\n 'name': 'GPSLatitude',\n 'description': getCalculatedGpsValue\n },\n 0x0003: {\n 'name': 'GPSLongitudeRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'E') {\n return 'East longitude';\n } else if (ref === 'W') {\n return 'West longitude';\n }\n return 'Unknown';\n }\n },\n 0x0004: {\n 'name': 'GPSLongitude',\n 'description': getCalculatedGpsValue\n },\n 0x0005: {\n 'name': 'GPSAltitudeRef',\n 'description': (value) => {\n if (value === 0) {\n return 'Sea level';\n } else if (value === 1) {\n return 'Sea level reference (negative value)';\n }\n return 'Unknown';\n }\n },\n 0x0006: {\n 'name': 'GPSAltitude',\n 'description': (value) => {\n return (value[0] / value[1]) + ' m';\n }\n },\n 0x0007: {\n 'name': 'GPSTimeStamp',\n 'description': (values) => {\n return values.map(([numerator, denominator]) => {\n const num = numerator / denominator;\n if (/^\\d(\\.|$)/.test(`${num}`)) {\n return `0${num}`;\n }\n return num;\n }).join(':');\n }\n },\n 0x0008: 'GPSSatellites',\n 0x0009: {\n 'name': 'GPSStatus',\n 'description': (value) => {\n const status = value.join('');\n if (status === 'A') {\n return 'Measurement in progress';\n } else if (status === 'V') {\n return 'Measurement Interoperability';\n }\n return 'Unknown';\n }\n },\n 0x000a: {\n 'name': 'GPSMeasureMode',\n 'description': (value) => {\n const mode = value.join('');\n if (mode === '2') {\n return '2-dimensional measurement';\n } else if (mode === '3') {\n return '3-dimensional measurement';\n }\n return 'Unknown';\n }\n },\n 0x000b: 'GPSDOP',\n 0x000c: {\n 'name': 'GPSSpeedRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'K') {\n return 'Kilometers per hour';\n } else if (ref === 'M') {\n return 'Miles per hour';\n } else if (ref === 'N') {\n return 'Knots';\n }\n return 'Unknown';\n }\n },\n 0x000d: 'GPSSpeed',\n 0x000e: {\n 'name': 'GPSTrackRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'T') {\n return 'True direction';\n } else if (ref === 'M') {\n return 'Magnetic direction';\n }\n return 'Unknown';\n }\n },\n 0x000f: 'GPSTrack',\n 0x0010: {\n 'name': 'GPSImgDirectionRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'T') {\n return 'True direction';\n } else if (ref === 'M') {\n return 'Magnetic direction';\n }\n return 'Unknown';\n }\n },\n 0x0011: 'GPSImgDirection',\n 0x0012: 'GPSMapDatum',\n 0x0013: {\n 'name': 'GPSDestLatitudeRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'N') {\n return 'North latitude';\n } else if (ref === 'S') {\n return 'South latitude';\n }\n return 'Unknown';\n }\n },\n 0x0014: {\n 'name': 'GPSDestLatitude',\n 'description': (value) => {\n return (value[0][0] / value[0][1]) + (value[1][0] / value[1][1]) / 60 + (value[2][0] / value[2][1]) / 3600;\n }\n },\n 0x0015: {\n 'name': 'GPSDestLongitudeRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'E') {\n return 'East longitude';\n } else if (ref === 'W') {\n return 'West longitude';\n }\n return 'Unknown';\n }\n },\n 0x0016: {\n 'name': 'GPSDestLongitude',\n 'description': (value) => {\n return (value[0][0] / value[0][1]) + (value[1][0] / value[1][1]) / 60 + (value[2][0] / value[2][1]) / 3600;\n }\n },\n 0x0017: {\n 'name': 'GPSDestBearingRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'T') {\n return 'True direction';\n } else if (ref === 'M') {\n return 'Magnetic direction';\n }\n return 'Unknown';\n }\n },\n 0x0018: 'GPSDestBearing',\n 0x0019: {\n 'name': 'GPSDestDistanceRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'K') {\n return 'Kilometers';\n } else if (ref === 'M') {\n return 'Miles';\n } else if (ref === 'N') {\n return 'Knots';\n }\n return 'Unknown';\n }\n },\n 0x001a: 'GPSDestDistance',\n 0x001b: {\n 'name': 'GPSProcessingMethod',\n 'description': getEncodedString\n },\n 0x001c: {\n 'name': 'GPSAreaInformation',\n 'description': getEncodedString\n },\n 0x001d: 'GPSDateStamp',\n 0x001e: {\n 'name': 'GPSDifferential',\n 'description': (value) => {\n if (value === 0) {\n return 'Measurement without differential correction';\n } else if (value === 1) {\n return 'Differential correction applied';\n }\n return 'Unknown';\n }\n },\n 0x001f: 'GPSHPositioningError'\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringValue} from './tag-names-utils.js';\n\nexport default {\n 0x0001: 'InteroperabilityIndex',\n 0x0002: {\n name: 'InteroperabilityVersion',\n description: (value) => getStringValue(value)\n },\n 0x1000: 'RelatedImageFileFormat',\n 0x1001: 'RelatedImageWidth',\n 0x1002: 'RelatedImageHeight'\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringValue} from './tag-names-utils.js';\n\nexport default {\n 0xb000: {\n 'name': 'MPFVersion',\n 'description': (value) => getStringValue(value)\n },\n 0xb001: 'NumberOfImages',\n 0xb002: 'MPEntry',\n 0xb003: 'ImageUIDList',\n 0xb004: 'TotalFrames'\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {objectAssign} from './utils.js';\nimport Constants from './constants.js';\nimport TagNames0thIfd from './tag-names-0th-ifd.js';\nimport TagNamesExifIfd from './tag-names-exif-ifd.js';\nimport TagNamesGpsIfd from './tag-names-gps-ifd.js';\nimport TagNamesInteroperabilityIfd from './tag-names-interoperability-ifd.js';\nimport TagNamesMpfIfd from './tag-names-mpf-ifd.js';\n\nconst tagNames0thExifIfds = objectAssign({}, TagNames0thIfd, TagNamesExifIfd);\n\nexport default {\n '0th': tagNames0thExifIfds,\n 'exif': tagNames0thExifIfds,\n 'gps': TagNamesGpsIfd,\n 'interoperability': TagNamesInteroperabilityIfd,\n 'mpf': Constants.USE_MPF ? TagNamesMpfIfd : {},\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport TagNamesCommon from './tag-names-common.js';\n\nexport default {\n 0x000b: 'ProcessingSoftware',\n 0x00fe: {\n name: 'SubfileType',\n description: (value) => ({\n 0x0: 'Full-resolution image',\n 0x1: 'Reduced-resolution image',\n 0x2: 'Single page of multi-page image',\n 0x3: 'Single page of multi-page reduced-resolution image',\n 0x4: 'Transparency mask',\n 0x5: 'Transparency mask of reduced-resolution image',\n 0x6: 'Transparency mask of multi-page image',\n 0x7: 'Transparency mask of reduced-resolution multi-page image',\n 0x10001: 'Alternate reduced-resolution image',\n 0xffffffff: 'Invalid'\n })[value] || 'Unknown'\n },\n 0x00ff: {\n name: 'OldSubfileType',\n description: (value) => ({\n 0: 'Full-resolution image',\n 1: 'Reduced-resolution image',\n 2: 'Single page of multi-page image'\n })[value] || 'Unknown'\n },\n 0x0100: 'ImageWidth',\n 0x0101: 'ImageLength',\n 0x0102: 'BitsPerSample',\n 0x0103: 'Compression',\n 0x0106: 'PhotometricInterpretation',\n 0x0107: {\n name: 'Thresholding',\n description: (value) => ({\n 1: 'No dithering or halftoning',\n 2: 'Ordered dither or halfton',\n 3: 'Randomized dither'\n })[value] || 'Unknown'\n },\n 0x0108: 'CellWidth',\n 0x0109: 'CellLength',\n 0x010a: {\n name: 'FillOrder',\n description: (value) => ({\n 1: 'Normal',\n 2: 'Reversed'\n })[value] || 'Unknown'\n },\n 0x010d: 'DocumentName',\n 0x010e: 'ImageDescription',\n 0x010f: 'Make',\n 0x0110: 'Model',\n 0x0111: 'StripOffsets',\n 0x0112: {\n name: 'Orientation',\n description: (value) => {\n if (value === 1) {\n return 'top-left';\n }\n if (value === 2) {\n return 'top-right';\n }\n if (value === 3) {\n return 'bottom-right';\n }\n if (value === 4) {\n return 'bottom-left';\n }\n if (value === 5) {\n return 'left-top';\n }\n if (value === 6) {\n return 'right-top';\n }\n if (value === 7) {\n return 'right-bottom';\n }\n if (value === 8) {\n return 'left-bottom';\n }\n return 'Undefined';\n }\n },\n 0x0115: 'SamplesPerPixel',\n 0x0116: 'RowsPerStrip',\n 0x0117: 'StripByteCounts',\n 0x0118: 'MinSampleValue',\n 0x0119: 'MaxSampleValue',\n 0x011a: {\n 'name': 'XResolution',\n 'description': (value) => {\n return '' + Math.round(value[0] / value[1]);\n }\n },\n 0x011b: {\n 'name': 'YResolution',\n 'description': (value) => {\n return '' + Math.round(value[0] / value[1]);\n }\n },\n 0x011c: 'PlanarConfiguration',\n 0x011d: 'PageName',\n 0x011e: {\n 'name': 'XPosition',\n 'description': (value) => {\n return '' + Math.round(value[0] / value[1]);\n }\n },\n 0x011f: {\n 'name': 'YPosition',\n 'description': (value) => {\n return '' + Math.round(value[0] / value[1]);\n }\n },\n 0x0122: {\n name: 'GrayResponseUnit',\n description: (value) => ({\n 1: '0.1',\n 2: '0.001',\n 3: '0.0001',\n 4: '1e-05',\n 5: '1e-06'\n })[value] || 'Unknown'\n },\n 0x0128: {\n name: 'ResolutionUnit',\n description: (value) => {\n if (value === 2) {\n return 'inches';\n }\n if (value === 3) {\n return 'centimeters';\n }\n return 'Unknown';\n }\n },\n 0x0129: 'PageNumber',\n 0x012d: 'TransferFunction',\n 0x0131: 'Software',\n 0x0132: 'DateTime',\n 0x013b: 'Artist',\n 0x013c: 'HostComputer',\n 0x013d: 'Predictor',\n 0x013e: {\n 'name': 'WhitePoint',\n 'description': (values) => {\n return values.map((value) => `${value[0]}/${value[1]}`).join(', ');\n }\n },\n 0x013f: {\n 'name': 'PrimaryChromaticities',\n 'description': (values) => {\n return values.map((value) => `${value[0]}/${value[1]}`).join(', ');\n }\n },\n 0x0141: 'HalftoneHints',\n 0x0142: 'TileWidth',\n 0x0143: 'TileLength',\n 0x014a: 'A100DataOffset',\n 0x014c: {\n name: 'InkSet',\n description: (value) => ({\n 1: 'CMYK',\n 2: 'Not CMYK'\n })[value] || 'Unknown'\n },\n 0x0151: 'TargetPrinter',\n 0x0152: {\n name: 'ExtraSamples',\n description: (value) => ({\n 0: 'Unspecified',\n 1: 'Associated Alpha',\n 2: 'Unassociated Alpha',\n })[value] || 'Unknown'\n },\n 0x0153: {\n name: 'SampleFormat',\n description: (value) => {\n const formats = {\n 1: 'Unsigned',\n 2: 'Signed',\n 3: 'Float',\n 4: 'Undefined',\n 5: 'Complex int',\n 6: 'Complex float',\n };\n if (!Array.isArray(value)) {\n return 'Unknown';\n }\n return value.map((sample) => formats[sample] || 'Unknown').join(', ');\n }\n },\n 0x0201: 'JPEGInterchangeFormat',\n 0x0202: 'JPEGInterchangeFormatLength',\n 0x0211: {\n 'name': 'YCbCrCoefficients',\n 'description': (values) => {\n return values.map((value) => '' + value[0] / value[1]).join('/');\n }\n },\n 0x0212: 'YCbCrSubSampling',\n 0x0213: {\n name: 'YCbCrPositioning',\n description: (value) => {\n if (value === 1) {\n return 'centered';\n }\n if (value === 2) {\n return 'co-sited';\n }\n return 'undefined ' + value;\n }\n },\n 0x0214: {\n 'name': 'ReferenceBlackWhite',\n 'description': (values) => {\n return values.map((value) => '' + value[0] / value[1]).join(', ');\n }\n },\n 0x02bc: 'ApplicationNotes',\n 0x4746: 'Rating',\n 0x4749: 'RatingPercent',\n 0x8298: {\n name: 'Copyright',\n description: (value) => value.join('; ')\n },\n 0x830e: 'PixelScale',\n 0x83bb: 'IPTC-NAA',\n 0x8480: 'IntergraphMatrix',\n 0x8482: 'ModelTiePoint',\n 0x8546: 'SEMInfo',\n 0x85d8: 'ModelTransform',\n 0x8649: 'PhotoshopSettings',\n 0x8769: 'Exif IFD Pointer',\n 0x8773: 'ICC_Profile',\n 0x87af: 'GeoTiffDirectory',\n 0x87b0: 'GeoTiffDoubleParams',\n 0x87b1: 'GeoTiffAsciiParams',\n 0x8825: 'GPS Info IFD Pointer',\n 0x9c9b: 'XPTitle',\n 0x9c9c: 'XPComment',\n 0x9c9d: 'XPAuthor',\n 0x9c9e: 'XPKeywords',\n 0x9c9f: 'XPSubject',\n 0xa480: 'GDALMetadata',\n 0xa481: 'GDALNoData',\n 0xc4a5: 'PrintIM',\n 0xc613: 'DNGBackwardVersion',\n 0xc614: 'UniqueCameraModel',\n 0xc615: 'LocalizedCameraModel',\n 0xc621: 'ColorMatrix1',\n 0xc622: 'ColorMatrix2',\n 0xc623: 'CameraCalibration1',\n 0xc624: 'CameraCalibration2',\n 0xc625: 'ReductionMatrix1',\n 0xc626: 'ReductionMatrix2',\n 0xc627: 'AnalogBalance',\n 0xc628: 'AsShotNeutral',\n 0xc629: 'AsShotWhiteXY',\n 0xc62a: 'BaselineExposure',\n 0xc62b: 'BaselineNoise',\n 0xc62c: 'BaselineSharpness',\n 0xc62e: 'LinearResponseLimit',\n 0xc62f: 'CameraSerialNumber',\n 0xc630: 'DNGLensInfo',\n 0xc633: 'ShadowScale',\n 0xc635: {\n name: 'MakerNoteSafety',\n description: (value) => ({\n 0: 'Unsafe',\n 1: 'Safe'\n })[value] || 'Unknown'\n },\n 0xc65a: {\n name: 'CalibrationIlluminant1',\n description: TagNamesCommon['LightSource']\n },\n 0xc65b: {\n name: 'CalibrationIlluminant2',\n description: TagNamesCommon['LightSource']\n },\n 0xc65d: 'RawDataUniqueID',\n 0xc68b: 'OriginalRawFileName',\n 0xc68c: 'OriginalRawFileData',\n 0xc68f: 'AsShotICCProfile',\n 0xc690: 'AsShotPreProfileMatrix',\n 0xc691: 'CurrentICCProfile',\n 0xc692: 'CurrentPreProfileMatrix',\n 0xc6bf: 'ColorimetricReference',\n 0xc6c5: 'SRawType',\n 0xc6d2: 'PanasonicTitle',\n 0xc6d3: 'PanasonicTitle2',\n 0xc6f3: 'CameraCalibrationSig',\n 0xc6f4: 'ProfileCalibrationSig',\n 0xc6f5: 'ProfileIFD',\n 0xc6f6: 'AsShotProfileName',\n 0xc6f8: 'ProfileName',\n 0xc6f9: 'ProfileHueSatMapDims',\n 0xc6fa: 'ProfileHueSatMapData1',\n 0xc6fb: 'ProfileHueSatMapData2',\n 0xc6fc: 'ProfileToneCurve',\n 0xc6fd: {\n name: 'ProfileEmbedPolicy',\n description: (value) => ({\n 0: 'Allow Copying',\n 1: 'Embed if Used',\n 2: 'Never Embed',\n 3: 'No Restrictions'\n })[value] || 'Unknown'\n },\n 0xc6fe: 'ProfileCopyright',\n 0xc714: 'ForwardMatrix1',\n 0xc715: 'ForwardMatrix2',\n 0xc716: 'PreviewApplicationName',\n 0xc717: 'PreviewApplicationVersion',\n 0xc718: 'PreviewSettingsName',\n 0xc719: 'PreviewSettingsDigest',\n 0xc71a: {\n name: 'PreviewColorSpace',\n description: (value) => ({\n 1: 'Gray Gamma 2.2',\n 2: 'sRGB',\n 3: 'Adobe RGB',\n 4: 'ProPhoto RGB'\n })[value] || 'Unknown'\n },\n 0xc71b: 'PreviewDateTime',\n 0xc71c: 'RawImageDigest',\n 0xc71d: 'OriginalRawFileDigest',\n 0xc725: 'ProfileLookTableDims',\n 0xc726: 'ProfileLookTableData',\n 0xc763: 'TimeCodes',\n 0xc764: 'FrameRate',\n 0xc772: 'TStop',\n 0xc789: 'ReelName',\n 0xc791: 'OriginalDefaultFinalSize',\n 0xc792: 'OriginalBestQualitySize',\n 0xc793: 'OriginalDefaultCropSize',\n 0xc7a1: 'CameraLabel',\n 0xc7a3: {\n name: 'ProfileHueSatMapEncoding',\n description: (value) => ({\n 0: 'Linear',\n 1: 'sRGB'\n })[value] || 'Unknown'\n },\n 0xc7a4: {\n name: 'ProfileLookTableEncoding',\n description: (value) => ({\n 0: 'Linear',\n 1: 'sRGB'\n })[value] || 'Unknown'\n },\n 0xc7a5: 'BaselineExposureOffset',\n 0xc7a6: {\n name: 'DefaultBlackRender',\n description: (value) => ({\n 0: 'Auto',\n 1: 'None'\n })[value] || 'Unknown'\n },\n 0xc7a7: 'NewRawImageDigest',\n 0xc7a8: 'RawToPreviewGain'\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringValue, getEncodedString} from './tag-names-utils.js';\nimport TagNamesCommon from './tag-names-common.js';\n\nexport default {\n 0x829a: {\n 'name': 'ExposureTime',\n 'description': (value) => {\n if (value[0] !== 0) {\n return `1/${Math.round(value[1] / value[0])}`;\n }\n return `0/${value[1]}`;\n }\n },\n 0x829d: {\n 'name': 'FNumber',\n 'description': (value) => `f/${value[0] / value[1]}`\n },\n 0x8822: {\n 'name': 'ExposureProgram',\n 'description': (value) => {\n if (value === 0) {\n return 'Undefined';\n } else if (value === 1) {\n return 'Manual';\n } else if (value === 2) {\n return 'Normal program';\n } else if (value === 3) {\n return 'Aperture priority';\n } else if (value === 4) {\n return 'Shutter priority';\n } else if (value === 5) {\n return 'Creative program';\n } else if (value === 6) {\n return 'Action program';\n } else if (value === 7) {\n return 'Portrait mode';\n } else if (value === 8) {\n return 'Landscape mode';\n } else if (value === 9) {\n return 'Bulb';\n }\n return 'Unknown';\n }\n },\n 0x8824: 'SpectralSensitivity',\n 0x8827: 'ISOSpeedRatings',\n 0x8828: {\n 'name': 'OECF',\n 'description': () => '[Raw OECF table data]'\n },\n 0x882a: 'TimeZoneOffset',\n 0x882b: 'SelfTimerMode',\n 0x8830: {\n name: 'SensitivityType',\n description: (value) => ({\n 1: 'Standard Output Sensitivity',\n 2: 'Recommended Exposure Index',\n 3: 'ISO Speed',\n 4: 'Standard Output Sensitivity and Recommended Exposure Index',\n 5: 'Standard Output Sensitivity and ISO Speed',\n 6: 'Recommended Exposure Index and ISO Speed',\n 7: 'Standard Output Sensitivity, Recommended Exposure Index and ISO Speed'\n })[value] || 'Unknown'\n },\n 0x8831: 'StandardOutputSensitivity',\n 0x8832: 'RecommendedExposureIndex',\n 0x8833: 'ISOSpeed',\n 0x8834: 'ISOSpeedLatitudeyyy',\n 0x8835: 'ISOSpeedLatitudezzz',\n 0x9000: {\n 'name': 'ExifVersion',\n 'description': (value) => getStringValue(value)\n },\n 0x9003: 'DateTimeOriginal',\n 0x9004: 'DateTimeDigitized',\n 0x9009: 'GooglePlusUploadCode',\n 0x9010: 'OffsetTime',\n 0x9011: 'OffsetTimeOriginal',\n 0x9012: 'OffsetTimeDigitized',\n 0x9101: {\n 'name': 'ComponentsConfiguration',\n 'description': (value) => {\n return value.map((character) => {\n if (character === 0x31) {\n return 'Y';\n } else if (character === 0x32) {\n return 'Cb';\n } else if (character === 0x33) {\n return 'Cr';\n } else if (character === 0x34) {\n return 'R';\n } else if (character === 0x35) {\n return 'G';\n } else if (character === 0x36) {\n return 'B';\n }\n }).join('');\n }\n },\n 0x9102: 'CompressedBitsPerPixel',\n 0x9201: {\n 'name': 'ShutterSpeedValue',\n 'description': (value) => {\n return `1/${Math.round(Math.pow(2, value[0] / value[1]))}`;\n }\n },\n 0x9202: {\n 'name': 'ApertureValue',\n 'description': (value) => {\n return Math.pow(Math.sqrt(2), value[0] / value[1]).toFixed(2);\n }\n },\n 0x9203: 'BrightnessValue',\n 0x9204: 'ExposureBiasValue',\n 0x9205: {\n 'name': 'MaxApertureValue',\n 'description': (value) => {\n return Math.pow(Math.sqrt(2), value[0] / value[1]).toFixed(2);\n }\n },\n 0x9206: {\n 'name': 'SubjectDistance',\n 'description': (value) => (value[0] / value[1]) + ' m'\n },\n 0x9207: {\n 'name': 'MeteringMode',\n 'description': (value) => {\n if (value === 1) {\n return 'Average';\n } else if (value === 2) {\n return 'CenterWeightedAverage';\n } else if (value === 3) {\n return 'Spot';\n } else if (value === 4) {\n return 'MultiSpot';\n } else if (value === 5) {\n return 'Pattern';\n } else if (value === 6) {\n return 'Partial';\n } else if (value === 255) {\n return 'Other';\n }\n return 'Unknown';\n }\n },\n 0x9208: {\n 'name': 'LightSource',\n description: TagNamesCommon['LightSource']\n },\n 0x9209: {\n 'name': 'Flash',\n 'description': (value) => {\n if (value === 0x00) {\n return 'Flash did not fire';\n } else if (value === 0x01) {\n return 'Flash fired';\n } else if (value === 0x05) {\n return 'Strobe return light not detected';\n } else if (value === 0x07) {\n return 'Strobe return light detected';\n } else if (value === 0x09) {\n return 'Flash fired, compulsory flash mode';\n } else if (value === 0x0d) {\n return 'Flash fired, compulsory flash mode, return light not detected';\n } else if (value === 0x0f) {\n return 'Flash fired, compulsory flash mode, return light detected';\n } else if (value === 0x10) {\n return 'Flash did not fire, compulsory flash mode';\n } else if (value === 0x18) {\n return 'Flash did not fire, auto mode';\n } else if (value === 0x19) {\n return 'Flash fired, auto mode';\n } else if (value === 0x1d) {\n return 'Flash fired, auto mode, return light not detected';\n } else if (value === 0x1f) {\n return 'Flash fired, auto mode, return light detected';\n } else if (value === 0x20) {\n return 'No flash function';\n } else if (value === 0x41) {\n return 'Flash fired, red-eye reduction mode';\n } else if (value === 0x45) {\n return 'Flash fired, red-eye reduction mode, return light not detected';\n } else if (value === 0x47) {\n return 'Flash fired, red-eye reduction mode, return light detected';\n } else if (value === 0x49) {\n return 'Flash fired, compulsory flash mode, red-eye reduction mode';\n } else if (value === 0x4d) {\n return 'Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected';\n } else if (value === 0x4f) {\n return 'Flash fired, compulsory flash mode, red-eye reduction mode, return light detected';\n } else if (value === 0x59) {\n return 'Flash fired, auto mode, red-eye reduction mode';\n } else if (value === 0x5d) {\n return 'Flash fired, auto mode, return light not detected, red-eye reduction mode';\n } else if (value === 0x5f) {\n return 'Flash fired, auto mode, return light detected, red-eye reduction mode';\n }\n return 'Unknown';\n }\n },\n 0x920a: {\n 'name': 'FocalLength',\n 'description': (value) => (value[0] / value[1]) + ' mm'\n },\n 0x9211: 'ImageNumber',\n 0x9212: {\n name: 'SecurityClassification',\n description: (value) => ({\n 'C': 'Confidential',\n 'R': 'Restricted',\n 'S': 'Secret',\n 'T': 'Top Secret',\n 'U': 'Unclassified'\n })[value] || 'Unknown'\n },\n 0x9213: 'ImageHistory',\n 0x9214: {\n 'name': 'SubjectArea',\n 'description': (value) => {\n if (value.length === 2) {\n return `Location; X: ${value[0]}, Y: ${value[1]}`;\n } else if (value.length === 3) {\n return `Circle; X: ${value[0]}, Y: ${value[1]}, diameter: ${value[2]}`;\n } else if (value.length === 4) {\n return `Rectangle; X: ${value[0]}, Y: ${value[1]}, width: ${value[2]}, height: ${value[3]}`;\n }\n return 'Unknown';\n }\n },\n 0x927c: {\n 'name': 'MakerNote',\n 'description': () => '[Raw maker note data]'\n },\n 0x9286: {\n 'name': 'UserComment',\n 'description': getEncodedString\n },\n 0x9290: 'SubSecTime',\n 0x9291: 'SubSecTimeOriginal',\n 0x9292: 'SubSecTimeDigitized',\n 0x9400: {\n 'name': 'AmbientTemperature',\n 'description': (value) => (value[0] / value[1]) + ' °C'\n },\n 0x9401: {\n 'name': 'Humidity',\n 'description': (value) => (value[0] / value[1]) + ' %'\n },\n 0x9402: {\n 'name': 'Pressure',\n 'description': (value) => (value[0] / value[1]) + ' hPa'\n },\n 0x9403: {\n 'name': 'WaterDepth',\n 'description': (value) => (value[0] / value[1]) + ' m'\n },\n 0x9404: {\n 'name': 'Acceleration',\n 'description': (value) => (value[0] / value[1]) + ' mGal'\n },\n 0x9405: {\n 'name': 'CameraElevationAngle',\n 'description': (value) => (value[0] / value[1]) + ' °'\n },\n 0xa000: {\n 'name': 'FlashpixVersion',\n 'description': (value) => value.map((charCode) => String.fromCharCode(charCode)).join('')\n },\n 0xa001: {\n 'name': 'ColorSpace',\n 'description': (value) => {\n if (value === 1) {\n return 'sRGB';\n } else if (value === 0xffff) {\n return 'Uncalibrated';\n }\n return 'Unknown';\n }\n },\n 0xa002: 'PixelXDimension',\n 0xa003: 'PixelYDimension',\n 0xa004: 'RelatedSoundFile',\n 0xa005: 'Interoperability IFD Pointer',\n 0xa20b: 'FlashEnergy',\n 0xa20c: {\n 'name': 'SpatialFrequencyResponse',\n 'description': () => '[Raw SFR table data]'\n },\n 0xa20e: 'FocalPlaneXResolution',\n 0xa20f: 'FocalPlaneYResolution',\n 0xa210: {\n 'name': 'FocalPlaneResolutionUnit',\n 'description': (value) => {\n if (value === 2) {\n return 'inches';\n } else if (value === 3) {\n return 'centimeters';\n }\n return 'Unknown';\n }\n },\n 0xa214: {\n 'name': 'SubjectLocation',\n 'description': ([x, y]) => `X: ${x}, Y: ${y}`\n },\n 0xa215: 'ExposureIndex',\n 0xa217: {\n 'name': 'SensingMethod',\n 'description': (value) => {\n if (value === 1) {\n return 'Undefined';\n } else if (value === 2) {\n return 'One-chip color area sensor';\n } else if (value === 3) {\n return 'Two-chip color area sensor';\n } else if (value === 4) {\n return 'Three-chip color area sensor';\n } else if (value === 5) {\n return 'Color sequential area sensor';\n } else if (value === 7) {\n return 'Trilinear sensor';\n } else if (value === 8) {\n return 'Color sequential linear sensor';\n }\n return 'Unknown';\n }\n },\n 0xa300: {\n 'name': 'FileSource',\n 'description': (value) => {\n if (value === 3) {\n return 'DSC';\n }\n return 'Unknown';\n }\n },\n 0xa301: {\n 'name': 'SceneType',\n 'description': (value) => {\n if (value === 1) {\n return 'A directly photographed image';\n }\n return 'Unknown';\n }\n },\n 0xa302: {\n 'name': 'CFAPattern',\n 'description': () => '[Raw CFA pattern table data]'\n },\n 0xa401: {\n 'name': 'CustomRendered',\n 'description': (value) => {\n if (value === 0) {\n return 'Normal process';\n } else if (value === 1) {\n return 'Custom process';\n }\n return 'Unknown';\n }\n },\n 0xa402: {\n 'name': 'ExposureMode',\n 'description': (value) => {\n if (value === 0) {\n return 'Auto exposure';\n } else if (value === 1) {\n return 'Manual exposure';\n } else if (value === 2) {\n return 'Auto bracket';\n }\n return 'Unknown';\n }\n },\n 0xa403: {\n 'name': 'WhiteBalance',\n 'description': (value) => {\n if (value === 0) {\n return 'Auto white balance';\n } else if (value === 1) {\n return 'Manual white balance';\n }\n return 'Unknown';\n }\n },\n 0xa404: {\n 'name': 'DigitalZoomRatio',\n 'description': (value) => {\n if (value[0] === 0) {\n return 'Digital zoom was not used';\n }\n return '' + (value[0] / value[1]);\n }\n },\n 0xa405: {\n 'name': 'FocalLengthIn35mmFilm',\n 'description': (value) => {\n if (value === 0) {\n return 'Unknown';\n }\n return value;\n }\n },\n 0xa406: {\n 'name': 'SceneCaptureType',\n 'description': (value) => {\n if (value === 0) {\n return 'Standard';\n } else if (value === 1) {\n return 'Landscape';\n } else if (value === 2) {\n return 'Portrait';\n } else if (value === 3) {\n return 'Night scene';\n }\n return 'Unknown';\n }\n },\n 0xa407: {\n 'name': 'GainControl',\n 'description': (value) => {\n if (value === 0) {\n return 'None';\n } else if (value === 1) {\n return 'Low gain up';\n } else if (value === 2) {\n return 'High gain up';\n } else if (value === 3) {\n return 'Low gain down';\n } else if (value === 4) {\n return 'High gain down';\n }\n return 'Unknown';\n }\n },\n 0xa408: {\n 'name': 'Contrast',\n 'description': (value) => {\n if (value === 0) {\n return 'Normal';\n } else if (value === 1) {\n return 'Soft';\n } else if (value === 2) {\n return 'Hard';\n }\n return 'Unknown';\n }\n },\n 0xa409: {\n 'name': 'Saturation',\n 'description': (value) => {\n if (value === 0) {\n return 'Normal';\n } else if (value === 1) {\n return 'Low saturation';\n } else if (value === 2) {\n return 'High saturation';\n }\n return 'Unknown';\n }\n },\n 0xa40a: {\n 'name': 'Sharpness',\n 'description': (value) => {\n if (value === 0) {\n return 'Normal';\n } else if (value === 1) {\n return 'Soft';\n } else if (value === 2) {\n return 'Hard';\n }\n return 'Unknown';\n }\n },\n 0xa40b: {\n 'name': 'DeviceSettingDescription',\n 'description': () => '[Raw device settings table data]'\n },\n 0xa40c: {\n 'name': 'SubjectDistanceRange',\n 'description': (value) => {\n if (value === 1) {\n return 'Macro';\n } else if (value === 2) {\n return 'Close view';\n } else if (value === 3) {\n return 'Distant view';\n }\n return 'Unknown';\n }\n },\n 0xa420: 'ImageUniqueID',\n 0xa430: 'CameraOwnerName',\n 0xa431: 'BodySerialNumber',\n 0xa432: {\n 'name': 'LensSpecification',\n 'description': (value) => {\n const focalLengths = `${value[0][0] / value[0][1]}-${value[1][0] / value[1][1]} mm`;\n if (value[3][1] === 0) {\n return `${focalLengths} f/?`;\n }\n return `${focalLengths} f/${1 / ((value[2][1] / value[2][1]) / (value[3][0] / value[3][1]))}`;\n }\n },\n 0xa433: 'LensMake',\n 0xa434: 'LensModel',\n 0xa435: 'LensSerialNumber',\n 0xa460: {\n name: 'CompositeImage',\n description: (value) => ({\n 1: 'Not a Composite Image',\n 2: 'General Composite Image',\n 3: 'Composite Image Captured While Shooting',\n })[value] || 'Unknown'\n },\n 0xa461: 'SourceImageNumberOfCompositeImage',\n 0xa462: 'SourceExposureTimesOfCompositeImage',\n 0xa500: 'Gamma',\n 0xea1c: 'Padding',\n 0xea1d: 'OffsetSchema',\n 0xfde8: 'OwnerName',\n 0xfde9: 'SerialNumber',\n 0xfdea: 'Lens',\n 0xfe4c: 'RawFile',\n 0xfe4d: 'Converter',\n 0xfe4e: 'WhiteBalance',\n 0xfe51: 'Exposure',\n 0xfe52: 'Shadows',\n 0xfe53: 'Brightness',\n 0xfe54: 'Contrast',\n 0xfe55: 'Saturation',\n 0xfe56: 'Sharpness',\n 0xfe57: 'Smoothness',\n 0xfe58: 'MoireFilter'\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport Constants from './constants.js';\nimport {objectAssign} from './utils.js';\nimport ByteOrder from './byte-order.js';\nimport Types from './types.js';\nimport TagNames from './tag-names.js';\nimport {deferInit, getBase64Image} from './utils.js';\n\nconst EXIF_IFD_POINTER_KEY = 'Exif IFD Pointer';\nconst GPS_INFO_IFD_POINTER_KEY = 'GPS Info IFD Pointer';\nconst INTEROPERABILITY_IFD_POINTER_KEY = 'Interoperability IFD Pointer';\n\nconst getTagValueAt = {\n 1: Types.getByteAt,\n 2: Types.getAsciiAt,\n 3: Types.getShortAt,\n 4: Types.getLongAt,\n 5: Types.getRationalAt,\n 7: Types.getUndefinedAt,\n 9: Types.getSlongAt,\n 10: Types.getSrationalAt,\n 13: Types.getIfdPointerAt\n};\n\nexport default {\n read,\n readMpf\n};\n\nfunction read(dataView, tiffHeaderOffset) {\n const byteOrder = ByteOrder.getByteOrder(dataView, tiffHeaderOffset);\n let tags = read0thIfd(dataView, tiffHeaderOffset, byteOrder);\n tags = readExifIfd(tags, dataView, tiffHeaderOffset, byteOrder);\n tags = readGpsIfd(tags, dataView, tiffHeaderOffset, byteOrder);\n tags = readInteroperabilityIfd(tags, dataView, tiffHeaderOffset, byteOrder);\n\n return tags;\n}\n\nfunction read0thIfd(dataView, tiffHeaderOffset, byteOrder) {\n return readIfd(dataView, '0th', tiffHeaderOffset, get0thIfdOffset(dataView, tiffHeaderOffset, byteOrder), byteOrder);\n}\n\nfunction get0thIfdOffset(dataView, tiffHeaderOffset, byteOrder) {\n return tiffHeaderOffset + Types.getLongAt(dataView, tiffHeaderOffset + 4, byteOrder);\n}\n\nfunction readExifIfd(tags, dataView, tiffHeaderOffset, byteOrder) {\n if (tags[EXIF_IFD_POINTER_KEY] !== undefined) {\n return objectAssign(tags, readIfd(dataView, 'exif', tiffHeaderOffset, tiffHeaderOffset + tags[EXIF_IFD_POINTER_KEY].value, byteOrder));\n }\n\n return tags;\n}\n\nfunction readGpsIfd(tags, dataView, tiffHeaderOffset, byteOrder) {\n if (tags[GPS_INFO_IFD_POINTER_KEY] !== undefined) {\n return objectAssign(tags, readIfd(dataView, 'gps', tiffHeaderOffset, tiffHeaderOffset + tags[GPS_INFO_IFD_POINTER_KEY].value, byteOrder));\n }\n\n return tags;\n}\n\nfunction readInteroperabilityIfd(tags, dataView, tiffHeaderOffset, byteOrder) {\n if (tags[INTEROPERABILITY_IFD_POINTER_KEY] !== undefined) {\n return objectAssign(tags, readIfd(dataView, 'interoperability', tiffHeaderOffset, tiffHeaderOffset + tags[INTEROPERABILITY_IFD_POINTER_KEY].value, byteOrder));\n }\n\n return tags;\n}\n\nfunction readMpf(dataView, dataOffset) {\n const byteOrder = ByteOrder.getByteOrder(dataView, dataOffset);\n const tags = readIfd(dataView, 'mpf', dataOffset, get0thIfdOffset(dataView, dataOffset, byteOrder), byteOrder);\n return addMpfImages(dataView, dataOffset, tags, byteOrder);\n}\n\nfunction addMpfImages(dataView, dataOffset, tags, byteOrder) {\n const ENTRY_SIZE = 16;\n\n if (!tags['MPEntry']) {\n return tags;\n }\n\n const images = [];\n for (let i = 0; i < Math.ceil(tags['MPEntry'].value.length / ENTRY_SIZE); i++) {\n images[i] = {};\n\n const attributes = getImageNumberValue(tags['MPEntry'].value, i * ENTRY_SIZE, Types.getTypeSize('LONG'), byteOrder);\n images[i]['ImageFlags'] = getImageFlags(attributes);\n images[i]['ImageFormat'] = getImageFormat(attributes);\n images[i]['ImageType'] = getImageType(attributes);\n\n const imageSize = getImageNumberValue(tags['MPEntry'].value, i * ENTRY_SIZE + 4, Types.getTypeSize('LONG'), byteOrder);\n images[i]['ImageSize'] = {\n value: imageSize,\n description: '' + imageSize\n };\n\n const imageOffset = isFirstIndividualImage(i) ? 0 : getImageNumberValue(tags['MPEntry'].value, i * ENTRY_SIZE + 8, Types.getTypeSize('LONG'), byteOrder) + dataOffset;\n images[i]['ImageOffset'] = {\n value: imageOffset,\n description: '' + imageOffset\n };\n\n const dependentImage1EntryNumber =\n getImageNumberValue(tags['MPEntry'].value, i * ENTRY_SIZE + 12, Types.getTypeSize('SHORT'), byteOrder);\n images[i]['DependentImage1EntryNumber'] = {\n value: dependentImage1EntryNumber,\n description: '' + dependentImage1EntryNumber\n };\n\n const dependentImage2EntryNumber =\n getImageNumberValue(tags['MPEntry'].value, i * ENTRY_SIZE + 14, Types.getTypeSize('SHORT'), byteOrder);\n images[i]['DependentImage2EntryNumber'] = {\n value: dependentImage2EntryNumber,\n description: '' + dependentImage2EntryNumber\n };\n\n images[i].image = dataView.buffer.slice(imageOffset, imageOffset + imageSize);\n deferInit(images[i], 'base64', function () {\n return getBase64Image(this.image);\n });\n }\n\n tags['Images'] = images;\n\n return tags;\n}\n\nfunction getImageNumberValue(entries, offset, size, byteOrder) {\n if (byteOrder === ByteOrder.LITTLE_ENDIAN) {\n let value = 0;\n for (let i = 0; i < size; i++) {\n value += entries[offset + i] << (8 * i);\n }\n return value;\n }\n\n let value = 0;\n for (let i = 0; i < size; i++) {\n value += entries[offset + i] << (8 * (size - 1 - i));\n }\n return value;\n}\n\nfunction getImageFlags(attributes) {\n const flags = [\n (attributes >> 31) & 0x1,\n (attributes >> 30) & 0x1,\n (attributes >> 29) & 0x1\n ];\n\n const flagsDescription = [];\n\n if (flags[0]) {\n flagsDescription.push('Dependent Parent Image');\n }\n if (flags[1]) {\n flagsDescription.push('Dependent Child Image');\n }\n if (flags[2]) {\n flagsDescription.push('Representative Image');\n }\n\n return {\n value: flags,\n description: flagsDescription.join(', ') || 'None'\n };\n}\n\nfunction getImageFormat(attributes) {\n const imageFormat = attributes >> 24 & 0x7;\n return {\n value: imageFormat,\n description: imageFormat === 0 ? 'JPEG' : 'Unknown'\n };\n}\n\nfunction getImageType(attributes) {\n const type = attributes & 0xffffff;\n const descriptions = {\n 0x30000: 'Baseline MP Primary Image',\n 0x10001: 'Large Thumbnail (VGA equivalent)',\n 0x10002: 'Large Thumbnail (Full HD equivalent)',\n 0x20001: 'Multi-Frame Image (Panorama)',\n 0x20002: 'Multi-Frame Image (Disparity)',\n 0x20003: 'Multi-Frame Image (Multi-Angle)',\n 0x0: 'Undefined',\n };\n\n return {\n value: type,\n description: descriptions[type] || 'Unknown'\n };\n}\n\nfunction isFirstIndividualImage(i) {\n return i === 0;\n}\n\nfunction readIfd(dataView, ifdType, tiffHeaderOffset, offset, byteOrder) {\n const FIELD_COUNT_SIZE = Types.getTypeSize('SHORT');\n const FIELD_SIZE = 12;\n\n const tags = {};\n const numberOfFields = getNumberOfFields(dataView, offset, byteOrder);\n\n offset += FIELD_COUNT_SIZE;\n for (let fieldIndex = 0; fieldIndex < numberOfFields; fieldIndex++) {\n if (offset + FIELD_SIZE > dataView.byteLength) {\n break;\n }\n\n const tag = readTag(dataView, ifdType, tiffHeaderOffset, offset, byteOrder);\n if (tag !== undefined) {\n tags[tag.name] = {\n 'id': tag.id,\n 'value': tag.value,\n 'description': tag.description\n };\n }\n\n offset += FIELD_SIZE;\n }\n\n if (Constants.USE_THUMBNAIL && (offset < dataView.byteLength - Types.getTypeSize('LONG'))) {\n const nextIfdOffset = Types.getLongAt(dataView, offset, byteOrder);\n if (nextIfdOffset !== 0) {\n tags['Thumbnail'] = readIfd(dataView, ifdType, tiffHeaderOffset, tiffHeaderOffset + nextIfdOffset, byteOrder);\n }\n }\n\n return tags;\n}\n\nfunction getNumberOfFields(dataView, offset, byteOrder) {\n if (offset + Types.getTypeSize('SHORT') <= dataView.byteLength) {\n return Types.getShortAt(dataView, offset, byteOrder);\n }\n return 0;\n}\n\nfunction readTag(dataView, ifdType, tiffHeaderOffset, offset, byteOrder) {\n const TAG_CODE_IPTC_NAA = 0x83bb;\n const TAG_TYPE_OFFSET = Types.getTypeSize('SHORT');\n const TAG_COUNT_OFFSET = TAG_TYPE_OFFSET + Types.getTypeSize('SHORT');\n const TAG_VALUE_OFFSET = TAG_COUNT_OFFSET + Types.getTypeSize('LONG');\n\n const tagCode = Types.getShortAt(dataView, offset, byteOrder);\n const tagType = Types.getShortAt(dataView, offset + TAG_TYPE_OFFSET, byteOrder);\n const tagCount = Types.getLongAt(dataView, offset + TAG_COUNT_OFFSET, byteOrder);\n let tagValue;\n\n if (Types.typeSizes[tagType] === undefined) {\n return undefined;\n }\n\n if (tagValueFitsInOffsetSlot(tagType, tagCount)) {\n tagValue = getTagValue(dataView, offset + TAG_VALUE_OFFSET, tagType, tagCount, byteOrder);\n } else {\n const tagValueOffset = Types.getLongAt(dataView, offset + TAG_VALUE_OFFSET, byteOrder);\n if (tagValueFitsInDataView(dataView, tiffHeaderOffset, tagValueOffset, tagType, tagCount)) {\n const forceByteType = tagCode === TAG_CODE_IPTC_NAA;\n tagValue = getTagValue(dataView, tiffHeaderOffset + tagValueOffset, tagType, tagCount, byteOrder, forceByteType);\n } else {\n tagValue = '';\n }\n }\n\n if (tagType === Types.tagTypes['ASCII']) {\n tagValue = splitNullSeparatedAsciiString(tagValue);\n tagValue = decodeAsciiValue(tagValue);\n }\n\n let tagName = `undefined-${tagCode}`;\n let tagDescription = tagValue;\n\n if (TagNames[ifdType][tagCode] !== undefined) {\n if ((TagNames[ifdType][tagCode]['name'] !== undefined) && (TagNames[ifdType][tagCode]['description'] !== undefined)) {\n tagName = TagNames[ifdType][tagCode]['name'];\n try {\n tagDescription = TagNames[ifdType][tagCode]['description'](tagValue);\n } catch (error) {\n tagDescription = getDescriptionFromTagValue(tagValue);\n }\n } else if ((tagType === Types.tagTypes['RATIONAL']) || (tagType === Types.tagTypes['SRATIONAL'])) {\n tagName = TagNames[ifdType][tagCode];\n tagDescription = '' + (tagValue[0] / tagValue[1]);\n } else {\n tagName = TagNames[ifdType][tagCode];\n tagDescription = getDescriptionFromTagValue(tagValue);\n }\n }\n\n return {\n id: tagCode,\n name: tagName,\n value: tagValue,\n description: tagDescription\n };\n}\n\nfunction tagValueFitsInOffsetSlot(tagType, tagCount) {\n return Types.typeSizes[tagType] * tagCount <= Types.getTypeSize('LONG');\n}\n\nfunction getTagValue(dataView, offset, type, count, byteOrder, forceByteType = false) {\n let value = [];\n\n if (forceByteType) {\n count = count * Types.typeSizes[type];\n type = Types.tagTypes['BYTE'];\n }\n for (let valueIndex = 0; valueIndex < count; valueIndex++) {\n value.push(getTagValueAt[type](dataView, offset, byteOrder));\n offset += Types.typeSizes[type];\n }\n\n if (type === Types.tagTypes['ASCII']) {\n value = Types.getAsciiValue(value);\n } else if (value.length === 1) {\n value = value[0];\n }\n\n return value;\n}\n\nfunction tagValueFitsInDataView(dataView, tiffHeaderOffset, tagValueOffset, tagType, tagCount) {\n return tiffHeaderOffset + tagValueOffset + Types.typeSizes[tagType] * tagCount <= dataView.byteLength;\n}\n\nfunction splitNullSeparatedAsciiString(string) {\n const tagValue = [];\n let i = 0;\n\n for (let j = 0; j < string.length; j++) {\n if (string[j] === '\\x00') {\n i++;\n continue;\n }\n if (tagValue[i] === undefined) {\n tagValue[i] = '';\n }\n tagValue[i] += string[j];\n }\n\n return tagValue;\n}\n\nfunction decodeAsciiValue(asciiValue) {\n try {\n return asciiValue.map((value) => decodeURIComponent(escape(value)));\n } catch (error) {\n return asciiValue;\n }\n}\n\nfunction getDescriptionFromTagValue(tagValue) {\n if (tagValue instanceof Array) {\n return tagValue.join(', ');\n }\n return tagValue;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport Types from './types.js';\n\nexport default {\n read\n};\n\nfunction read(dataView, fileDataOffset) {\n const length = getLength(dataView, fileDataOffset);\n const numberOfColorComponents = getNumberOfColorComponents(dataView, fileDataOffset, length);\n return {\n 'Bits Per Sample': getDataPrecision(dataView, fileDataOffset, length),\n 'Image Height': getImageHeight(dataView, fileDataOffset, length),\n 'Image Width': getImageWidth(dataView, fileDataOffset, length),\n 'Color Components': numberOfColorComponents,\n 'Subsampling': numberOfColorComponents && getSubsampling(dataView, fileDataOffset, numberOfColorComponents.value, length)\n };\n}\n\nfunction getLength(dataView, fileDataOffset) {\n return Types.getShortAt(dataView, fileDataOffset);\n}\n\nfunction getDataPrecision(dataView, fileDataOffset, length) {\n const OFFSET = 2;\n const SIZE = 1;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: '' + value\n };\n}\n\nfunction getImageHeight(dataView, fileDataOffset, length) {\n const OFFSET = 3;\n const SIZE = 2;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getShortAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: `${value}px`\n };\n}\n\nfunction getImageWidth(dataView, fileDataOffset, length) {\n const OFFSET = 5;\n const SIZE = 2;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getShortAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: `${value}px`\n };\n}\n\nfunction getNumberOfColorComponents(dataView, fileDataOffset, length) {\n const OFFSET = 7;\n const SIZE = 1;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: '' + value\n };\n}\n\nfunction getSubsampling(dataView, fileDataOffset, numberOfColorComponents, length) {\n const OFFSET = 8;\n const SIZE = 3 * numberOfColorComponents;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const components = [];\n\n for (let i = 0; i < numberOfColorComponents; i++) {\n const componentOffset = fileDataOffset + OFFSET + i * 3;\n components.push([\n Types.getByteAt(dataView, componentOffset),\n Types.getByteAt(dataView, componentOffset + 1),\n Types.getByteAt(dataView, componentOffset + 2)\n ]);\n }\n\n return {\n value: components,\n description: components.length > 1 ? getComponentIds(components) + getSamplingType(components) : ''\n };\n}\n\nfunction getComponentIds(components) {\n const ids = {\n 0x01: 'Y',\n 0x02: 'Cb',\n 0x03: 'Cr',\n 0x04: 'I',\n 0x05: 'Q',\n };\n\n return components.map((compontent) => ids[compontent[0]]).join('');\n}\n\nfunction getSamplingType(components) {\n const types = {\n 0x11: '4:4:4 (1 1)',\n 0x12: '4:4:0 (1 2)',\n 0x14: '4:4:1 (1 4)',\n 0x21: '4:2:2 (2 1)',\n 0x22: '4:2:0 (2 2)',\n 0x24: '4:2:1 (2 4)',\n 0x41: '4:1:1 (4 1)',\n 0x42: '4:1:0 (4 2)'\n };\n\n if (components.length === 0 || components[0][1] === undefined || types[components[0][1]] === undefined) {\n return '';\n }\n\n return types[components[0][1]];\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringValue} from './tag-names-utils.js';\n\nexport default {\n 'iptc': {\n 0x0100: {\n 'name': 'Model Version',\n 'description': (value) => {\n return ((value[0] << 8) + value[1]).toString();\n }\n },\n 0x0105: {\n 'name': 'Destination',\n 'repeatable': true\n },\n 0x0114: {\n 'name': 'File Format',\n 'description': (value) => {\n return ((value[0] << 8) + value[1]).toString();\n }\n },\n 0x0116: {\n 'name': 'File Format Version',\n 'description': (value) => {\n return ((value[0] << 8) + value[1]).toString();\n }\n },\n 0x011e: 'Service Identifier',\n 0x0128: 'Envelope Number',\n 0x0132: 'Product ID',\n 0x013c: 'Envelope Priority',\n 0x0146: {\n 'name': 'Date Sent',\n 'description': getCreationDate\n },\n 0x0150: {\n 'name': 'Time Sent',\n 'description': getCreationTime\n },\n 0x015a: {\n 'name': 'Coded Character Set',\n 'description': getEncodingName,\n 'encoding_name': getEncodingName,\n },\n 0x0164: 'UNO',\n 0x0178: {\n 'name': 'ARM Identifier',\n 'description': (value) => {\n return ((value[0] << 8) + value[1]).toString();\n }\n },\n 0x017a: {\n 'name': 'ARM Version',\n 'description': (value) => {\n return ((value[0] << 8) + value[1]).toString();\n }\n },\n 0x0200: {\n 'name': 'Record Version',\n 'description': (value) => {\n return ((value[0] << 8) + value[1]).toString();\n }\n },\n 0x0203: 'Object Type Reference',\n 0x0204: 'Object Attribute Reference',\n 0x0205: 'Object Name',\n 0x0207: 'Edit Status',\n 0x0208: {\n 'name': 'Editorial Update',\n 'description': (value) => {\n if (getStringValue(value) === '01') {\n return 'Additional Language';\n }\n return 'Unknown';\n }\n },\n 0x020a: 'Urgency',\n 0x020c: {\n 'name': 'Subject Reference',\n 'repeatable': true,\n 'description': (value) => {\n const parts = getStringValue(value).split(':');\n return parts[2] + (parts[3] ? '/' + parts[3] : '') + (parts[4] ? '/' + parts[4] : '');\n }\n },\n 0x020f: 'Category',\n 0x0214: {\n 'name': 'Supplemental Category',\n 'repeatable': true\n },\n 0x0216: 'Fixture Identifier',\n 0x0219: {\n 'name': 'Keywords',\n 'repeatable': true\n },\n 0x021a: {\n 'name': 'Content Location Code',\n 'repeatable': true\n },\n 0x021b: {\n 'name': 'Content Location Name',\n 'repeatable': true\n },\n 0x021e: 'Release Date',\n 0x0223: 'Release Time',\n 0x0225: 'Expiration Date',\n 0x0226: 'Expiration Time',\n 0x0228: 'Special Instructions',\n 0x022a: {\n 'name': 'Action Advised',\n 'description': (value) => {\n const string = getStringValue(value);\n if (string === '01') {\n return 'Object Kill';\n } else if (string === '02') {\n return 'Object Replace';\n } else if (string === '03') {\n return 'Object Append';\n } else if (string === '04') {\n return 'Object Reference';\n }\n return 'Unknown';\n }\n },\n 0x022d: {\n 'name': 'Reference Service',\n 'repeatable': true\n },\n 0x022f: {\n 'name': 'Reference Date',\n 'repeatable': true\n },\n 0x0232: {\n 'name': 'Reference Number',\n 'repeatable': true\n },\n 0x0237: {\n 'name': 'Date Created',\n 'description': getCreationDate\n },\n 0x023c: {\n 'name': 'Time Created',\n 'description': getCreationTime\n },\n 0x023e: {\n 'name': 'Digital Creation Date',\n 'description': getCreationDate\n },\n 0x023f: {\n 'name': 'Digital Creation Time',\n 'description': getCreationTime\n },\n 0x0241: 'Originating Program',\n 0x0246: 'Program Version',\n 0x024b: {\n 'name': 'Object Cycle',\n 'description': (value) => {\n const string = getStringValue(value);\n if (string === 'a') {\n return 'morning';\n } else if (string === 'p') {\n return 'evening';\n } else if (string === 'b') {\n return 'both';\n }\n return 'Unknown';\n }\n },\n 0x0250: {\n 'name': 'By-line',\n 'repeatable': true\n },\n 0x0255: {\n 'name': 'By-line Title',\n 'repeatable': true\n },\n 0x025a: 'City',\n 0x025c: 'Sub-location',\n 0x025f: 'Province/State',\n 0x0264: 'Country/Primary Location Code',\n 0x0265: 'Country/Primary Location Name',\n 0x0267: 'Original Transmission Reference',\n 0x0269: 'Headline',\n 0x026e: 'Credit',\n 0x0273: 'Source',\n 0x0274: 'Copyright Notice',\n 0x0276: {\n 'name': 'Contact',\n 'repeatable': true\n },\n 0x0278: 'Caption/Abstract',\n 0x027a: {\n 'name': 'Writer/Editor',\n 'repeatable': true\n },\n 0x027d: {\n 'name': 'Rasterized Caption',\n 'description': (value) => value\n },\n 0x0282: 'Image Type',\n 0x0283: {\n 'name': 'Image Orientation',\n 'description': (value) => {\n const string = getStringValue(value);\n if (string === 'P') {\n return 'Portrait';\n } else if (string === 'L') {\n return 'Landscape';\n } else if (string === 'S') {\n return 'Square';\n }\n return 'Unknown';\n }\n },\n 0x0287: 'Language Identifier',\n 0x0296: {\n 'name': 'Audio Type',\n 'description': (value) => {\n const stringValue = getStringValue(value);\n const character0 = stringValue.charAt(0);\n const character1 = stringValue.charAt(1);\n let description = '';\n\n if (character0 === '1') {\n description += 'Mono';\n } else if (character0 === '2') {\n description += 'Stereo';\n }\n\n if (character1 === 'A') {\n description += ', actuality';\n } else if (character1 === 'C') {\n description += ', question and answer session';\n } else if (character1 === 'M') {\n description += ', music, transmitted by itself';\n } else if (character1 === 'Q') {\n description += ', response to a question';\n } else if (character1 === 'R') {\n description += ', raw sound';\n } else if (character1 === 'S') {\n description += ', scener';\n } else if (character1 === 'V') {\n description += ', voicer';\n } else if (character1 === 'W') {\n description += ', wrap';\n }\n\n if (description !== '') {\n return description;\n }\n return stringValue;\n }\n },\n 0x0297: {\n 'name': 'Audio Sampling Rate',\n 'description': (value) => parseInt(getStringValue(value), 10) + ' Hz'\n },\n 0x0298: {\n 'name': 'Audio Sampling Resolution',\n 'description': (value) => {\n const bits = parseInt(getStringValue(value), 10);\n return bits + (bits === 1 ? ' bit' : ' bits');\n }\n },\n 0x0299: {\n 'name': 'Audio Duration',\n 'description': (value) => {\n const duration = getStringValue(value);\n if (duration.length >= 6) {\n return duration.substr(0, 2) + ':' + duration.substr(2, 2) + ':' + duration.substr(4, 2);\n }\n return duration;\n }\n },\n 0x029a: 'Audio Outcue',\n 0x02ba: 'Short Document ID',\n 0x02bb: 'Unique Document ID',\n 0x02bc: 'Owner ID',\n 0x02c8: {\n 'name': (value) => {\n if (value.length === 2) {\n return 'ObjectData Preview File Format';\n }\n return 'Record 2 destination';\n },\n 'description': (value) => {\n if (value.length === 2) {\n const intValue = (value[0] << 8) + value[1];\n if (intValue === 0) {\n return 'No ObjectData';\n } else if (intValue === 1) {\n return 'IPTC-NAA Digital Newsphoto Parameter Record';\n } else if (intValue === 2) {\n return 'IPTC7901 Recommended Message Format';\n } else if (intValue === 3) {\n return 'Tagged Image File Format (Adobe/Aldus Image data)';\n } else if (intValue === 4) {\n return 'Illustrator (Adobe Graphics data)';\n } else if (intValue === 5) {\n return 'AppleSingle (Apple Computer Inc)';\n } else if (intValue === 6) {\n return 'NAA 89-3 (ANPA 1312)';\n } else if (intValue === 7) {\n return 'MacBinary II';\n } else if (intValue === 8) {\n return 'IPTC Unstructured Character Oriented File Format (UCOFF)';\n } else if (intValue === 9) {\n return 'United Press International ANPA 1312 variant';\n } else if (intValue === 10) {\n return 'United Press International Down-Load Message';\n } else if (intValue === 11) {\n return 'JPEG File Interchange (JFIF)';\n } else if (intValue === 12) {\n return 'Photo-CD Image-Pac (Eastman Kodak)';\n } else if (intValue === 13) {\n return 'Microsoft Bit Mapped Graphics File [*.BMP]';\n } else if (intValue === 14) {\n return 'Digital Audio File [*.WAV] (Microsoft & Creative Labs)';\n } else if (intValue === 15) {\n return 'Audio plus Moving Video [*.AVI] (Microsoft)';\n } else if (intValue === 16) {\n return 'PC DOS/Windows Executable Files [*.COM][*.EXE]';\n } else if (intValue === 17) {\n return 'Compressed Binary File [*.ZIP] (PKWare Inc)';\n } else if (intValue === 18) {\n return 'Audio Interchange File Format AIFF (Apple Computer Inc)';\n } else if (intValue === 19) {\n return 'RIFF Wave (Microsoft Corporation)';\n } else if (intValue === 20) {\n return 'Freehand (Macromedia/Aldus)';\n } else if (intValue === 21) {\n return 'Hypertext Markup Language \"HTML\" (The Internet Society)';\n } else if (intValue === 22) {\n return 'MPEG 2 Audio Layer 2 (Musicom), ISO/IEC';\n } else if (intValue === 23) {\n return 'MPEG 2 Audio Layer 3, ISO/IEC';\n } else if (intValue === 24) {\n return 'Portable Document File (*.PDF) Adobe';\n } else if (intValue === 25) {\n return 'News Industry Text Format (NITF)';\n } else if (intValue === 26) {\n return 'Tape Archive (*.TAR)';\n } else if (intValue === 27) {\n return 'Tidningarnas Telegrambyrå NITF version (TTNITF DTD)';\n } else if (intValue === 28) {\n return 'Ritzaus Bureau NITF version (RBNITF DTD)';\n } else if (intValue === 29) {\n return 'Corel Draw [*.CDR]';\n }\n return `Unknown format ${intValue}`;\n }\n return getStringValue(value);\n }\n },\n 0x02c9: {\n 'name': 'ObjectData Preview File Format Version',\n 'description': (value, tags) => {\n // Format ID, Version ID, Version Description\n const formatVersions = {\n '00': {'00': '1'},\n '01': {'01': '1', '02': '2', '03': '3', '04': '4'},\n '02': {'04': '4'},\n '03': {'01': '5.0', '02': '6.0'},\n '04': {'01': '1.40'},\n '05': {'01': '2'},\n '06': {'01': '1'},\n '11': {'01': '1.02'},\n '20': {'01': '3.1', '02': '4.0', '03': '5.0', '04': '5.5'},\n '21': {'02': '2.0'}\n };\n const stringValue = getStringValue(value);\n\n if (tags['ObjectData Preview File Format']) {\n const objectDataPreviewFileFormat = getStringValue(tags['ObjectData Preview File Format'].value);\n if (formatVersions[objectDataPreviewFileFormat]\n && formatVersions[objectDataPreviewFileFormat][stringValue]) {\n return formatVersions[objectDataPreviewFileFormat][stringValue];\n }\n }\n\n return stringValue;\n }\n },\n 0x02ca: 'ObjectData Preview Data',\n 0x070a: {\n 'name': 'Size Mode',\n 'description': (value) => {\n return (value[0]).toString();\n }\n },\n 0x0714: {\n 'name': 'Max Subfile Size',\n 'description': (value) => {\n let n = 0;\n for (let i = 0; i < value.length; i++) {\n n = (n << 8) + value[i];\n }\n return n.toString();\n }\n },\n 0x075a: {\n 'name': 'ObjectData Size Announced',\n 'description': (value) => {\n let n = 0;\n for (let i = 0; i < value.length; i++) {\n n = (n << 8) + value[i];\n }\n return n.toString();\n }\n },\n 0x075f: {\n 'name': 'Maximum ObjectData Size',\n 'description': (value) => {\n let n = 0;\n for (let i = 0; i < value.length; i++) {\n n = (n << 8) + value[i];\n }\n return n.toString();\n }\n }\n }\n};\n\nfunction getCreationDate(value) {\n const date = getStringValue(value);\n\n if (date.length >= 8) {\n return date.substr(0, 4) + '-' + date.substr(4, 2) + '-' + date.substr(6, 2);\n }\n\n return date;\n}\n\nfunction getCreationTime(value) {\n const time = getStringValue(value);\n let parsedTime = time;\n\n if (time.length >= 6) {\n parsedTime = time.substr(0, 2) + ':' + time.substr(2, 2) + ':' + time.substr(4, 2);\n if (time.length === 11) {\n parsedTime += time.substr(6, 1) + time.substr(7, 2) + ':' + time.substr(9, 2);\n }\n }\n\n return parsedTime;\n}\n\nfunction getEncodingName(value) {\n const string = getStringValue(value);\n if (string === '\\x1b%G') {\n return 'UTF-8';\n } else if (string === '\\x1b%5') {\n return 'Windows-1252';\n } else if (string === '\\x1b%/G') {\n return 'UTF-8 Level 1';\n } else if (string === '\\x1b%/H') {\n return 'UTF-8 Level 2';\n } else if (string === '\\x1b%/I') {\n return 'UTF-8 Level 3';\n } else if (string === '\\x1B/A') {\n return 'ISO-8859-1';\n } else if (string === '\\x1B/B') {\n return 'ISO-8859-2';\n } else if (string === '\\x1B/C') {\n return 'ISO-8859-3';\n } else if (string === '\\x1B/D') {\n return 'ISO-8859-4';\n } else if (string === '\\x1B/@') {\n return 'ISO-8859-5';\n } else if (string === '\\x1B/G') {\n return 'ISO-8859-6';\n } else if (string === '\\x1B/F') {\n return 'ISO-8859-7';\n } else if (string === '\\x1B/H') {\n return 'ISO-8859-8';\n }\n return 'Unknown';\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nexport default {\n get\n};\n\nfunction get() {\n if (typeof TextDecoder !== 'undefined') {\n return TextDecoder;\n }\n\n return undefined;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport TextDecoder from './text-decoder.js';\n\nconst TAG_HEADER_SIZE = 5;\n\nexport default {\n decode,\n TAG_HEADER_SIZE\n};\n\nfunction decode(encoding, tagValue) {\n const Decoder = TextDecoder.get();\n if ((typeof Decoder !== 'undefined') && (encoding !== undefined)) {\n try {\n return new Decoder(encoding).decode(Uint8Array.from(tagValue));\n } catch (error) {\n // Pass through and fall back to ASCII decoding.\n }\n }\n\n const stringValue = tagValue.map((charCode) => String.fromCharCode(charCode)).join('');\n return decodeAsciiValue(stringValue);\n}\n\nfunction decodeAsciiValue(asciiValue) {\n try {\n return decodeURIComponent(escape(asciiValue));\n } catch (error) {\n return asciiValue;\n }\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport IptcTagNames from './iptc-tag-names.js';\nimport TagDecoder from './tag-decoder.js';\n\nconst BYTES_8BIM = 0x3842494d;\nconst BYTES_8BIM_SIZE = 4;\nconst RESOURCE_BLOCK_HEADER_SIZE = BYTES_8BIM_SIZE + 8;\nconst NAA_RESOURCE_BLOCK_TYPE = 0x0404;\nconst TAG_HEADER_SIZE = 5;\n\nexport default {\n read\n};\n\nfunction read(dataView, dataOffset) {\n try {\n if (Array.isArray(dataView)) {\n return parseTags(new DataView(Uint8Array.from(dataView).buffer), {size: dataView.length}, 0);\n }\n const {naaBlock, dataOffset: newDataOffset} = getNaaResourceBlock(dataView, dataOffset);\n return parseTags(dataView, naaBlock, newDataOffset);\n } catch (error) {\n return {};\n }\n}\n\nfunction getNaaResourceBlock(dataView, dataOffset) {\n while (dataOffset + RESOURCE_BLOCK_HEADER_SIZE <= dataView.byteLength) {\n const resourceBlock = getResourceBlock(dataView, dataOffset);\n if (isNaaResourceBlock(resourceBlock)) {\n return {naaBlock: resourceBlock, dataOffset: dataOffset + RESOURCE_BLOCK_HEADER_SIZE};\n }\n dataOffset += RESOURCE_BLOCK_HEADER_SIZE + resourceBlock.size + getBlockPadding(resourceBlock);\n }\n throw new Error('No IPTC NAA resource block.');\n}\n\nfunction getResourceBlock(dataView, dataOffset) {\n const RESOURCE_BLOCK_SIZE_OFFSET = 10;\n\n if (dataView.getUint32(dataOffset, false) !== BYTES_8BIM) {\n throw new Error('Not an IPTC resource block.');\n }\n\n return {\n type: dataView.getUint16(dataOffset + BYTES_8BIM_SIZE),\n size: dataView.getUint16(dataOffset + RESOURCE_BLOCK_SIZE_OFFSET)\n };\n}\n\nfunction isNaaResourceBlock(resourceBlock) {\n return resourceBlock.type === NAA_RESOURCE_BLOCK_TYPE;\n}\n\nfunction getBlockPadding(resourceBlock) {\n if (resourceBlock.size % 2 !== 0) {\n return 1;\n }\n return 0;\n}\n\nfunction parseTags(dataView, naaBlock, dataOffset) {\n const tags = {};\n let encoding = undefined;\n\n const endOfBlockOffset = dataOffset + naaBlock['size'];\n\n while ((dataOffset < endOfBlockOffset) && (dataOffset < dataView.byteLength)) {\n const {tag, tagSize} = readTag(dataView, dataOffset, tags, encoding);\n\n if (tag === null) {\n break;\n }\n\n if ('encoding' in tag) {\n encoding = tag.encoding;\n }\n\n if ((tags[tag.name] === undefined) || (tag['repeatable'] === undefined)) {\n tags[tag.name] = {\n id: tag.id,\n value: tag.value,\n description: tag.description\n };\n } else {\n if (!(tags[tag.name] instanceof Array)) {\n tags[tag.name] = [{\n id: tags[tag.name].id,\n value: tags[tag.name].value,\n description: tags[tag.name].description\n }];\n }\n tags[tag.name].push({\n id: tag.id,\n value: tag.value,\n description: tag.description\n });\n }\n\n dataOffset += TAG_HEADER_SIZE + tagSize;\n }\n\n return tags;\n}\n\nfunction readTag(dataView, dataOffset, tags, encoding) {\n const TAG_CODE_OFFSET = 1;\n const TAG_SIZE_OFFSET = 3;\n\n if (leadByteIsMissing(dataView, dataOffset)) {\n return {tag: null, tagSize: 0};\n }\n\n const tagCode = dataView.getUint16(dataOffset + TAG_CODE_OFFSET);\n const tagSize = dataView.getUint16(dataOffset + TAG_SIZE_OFFSET);\n const tagValue = getTagValue(dataView, dataOffset + TAG_HEADER_SIZE, tagSize);\n\n const tag = {\n id: tagCode,\n name: getTagName(IptcTagNames['iptc'][tagCode], tagCode, tagValue),\n value: tagValue,\n description: getTagDescription(IptcTagNames['iptc'][tagCode], tagValue, tags, encoding)\n };\n if (tagIsRepeatable(tagCode)) {\n tag['repeatable'] = true;\n }\n if (tagContainsEncoding(tagCode)) {\n tag['encoding'] = IptcTagNames['iptc'][tagCode]['encoding_name'](tagValue);\n }\n\n return {tag, tagSize};\n}\n\nfunction leadByteIsMissing(dataView, dataOffset) {\n const TAG_LEAD_BYTE = 0x1c;\n return dataView.getUint8(dataOffset) !== TAG_LEAD_BYTE;\n}\n\nfunction getTagValue(dataView, offset, size) {\n const value = [];\n\n for (let valueIndex = 0; valueIndex < size; valueIndex++) {\n value.push(dataView.getUint8(offset + valueIndex));\n }\n\n return value;\n}\n\nfunction getTagName(tag, tagCode, tagValue) {\n if (!tag) {\n return `undefined-${tagCode}`;\n }\n if (tagIsName(tag)) {\n return tag;\n }\n if (hasDynamicName(tag)) {\n return tag['name'](tagValue);\n }\n return tag['name'];\n}\n\nfunction tagIsName(tag) {\n return typeof tag === 'string';\n}\n\nfunction hasDynamicName(tag) {\n return typeof (tag['name']) === 'function';\n}\n\nfunction getTagDescription(tag, tagValue, tags, encoding) {\n if (hasDescriptionProperty(tag)) {\n try {\n return tag['description'](tagValue, tags);\n } catch (error) {\n // Fall through to next handler.\n }\n }\n if (tagValueIsText(tag, tagValue)) {\n return TagDecoder.decode(encoding, tagValue);\n }\n return tagValue;\n}\n\nfunction tagValueIsText(tag, tagValue) {\n return tag && tagValue instanceof Array;\n}\n\nfunction hasDescriptionProperty(tag) {\n return tag && tag['description'] !== undefined;\n}\n\nfunction tagIsRepeatable(tagCode) {\n return IptcTagNames['iptc'][tagCode] && IptcTagNames['iptc'][tagCode]['repeatable'];\n}\n\nfunction tagContainsEncoding(tagCode) {\n return IptcTagNames['iptc'][tagCode] && IptcTagNames['iptc'][tagCode]['encoding_name'] !== undefined;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nexport default {\n 'tiff:Orientation'(value) {\n if (value === '1') {\n return 'Horizontal (normal)';\n }\n if (value === '2') {\n return 'Mirror horizontal';\n }\n if (value === '3') {\n return 'Rotate 180';\n }\n if (value === '4') {\n return 'Mirror vertical';\n }\n if (value === '5') {\n return 'Mirror horizontal and rotate 270 CW';\n }\n if (value === '6') {\n return 'Rotate 90 CW';\n }\n if (value === '7') {\n return 'Mirror horizontal and rotate 90 CW';\n }\n if (value === '8') {\n return 'Rotate 270 CW';\n }\n return value;\n },\n 'exif:GPSLatitude': calculateGPSValue,\n 'exif:GPSLongitude': calculateGPSValue\n};\n\nfunction calculateGPSValue(value) {\n const [degreesString, minutesString] = value.split(',');\n if ((degreesString !== undefined) && (minutesString !== undefined)) {\n const degrees = parseFloat(degreesString);\n const minutes = parseFloat(minutesString);\n const ref = minutesString.charAt(minutesString.length - 1);\n if ((!Number.isNaN(degrees)) && (!Number.isNaN(minutes))) {\n return '' + (degrees + minutes / 60) + ref;\n }\n }\n return value;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringFromDataView, objectAssign} from './utils.js';\nimport XmpTagNames from './xmp-tag-names.js';\nimport DOMParser from './dom-parser.js';\n\nexport default {\n read\n};\n\nfunction read(dataView, chunks) {\n if (typeof dataView === 'string') {\n return readTags({}, dataView);\n }\n return extractCompleteChunks(dataView, chunks).reduce(readTags, {});\n}\n\n// The first chunk is always the regular XMP document. Then there is something\n// called extended XMP. The extended XMP is also a single XMP document but it\n// can be divided into multiple chunks that need to be combined into one.\nfunction extractCompleteChunks(dataView, chunks) {\n if (chunks.length === 0) {\n return [];\n }\n\n const completeChunks = [combineChunks(dataView, chunks.slice(0, 1))];\n if (chunks.length > 1) {\n completeChunks.push(combineChunks(dataView, chunks.slice(1)));\n }\n\n return completeChunks;\n}\n\nfunction combineChunks(dataView, chunks) {\n const totalLength = chunks.reduce((size, chunk) => size + chunk.length, 0);\n const combinedChunks = new Uint8Array(totalLength);\n let offset = 0;\n\n for (let i = 0; i < chunks.length; i++) {\n const chunk = chunks[i];\n const slice = dataView.buffer.slice(chunk.dataOffset, chunk.dataOffset + chunk.length);\n combinedChunks.set(new Uint8Array(slice), offset);\n offset += chunk.length;\n }\n\n return new DataView(combinedChunks.buffer);\n}\n\nfunction readTags(tags, chunkDataView) {\n try {\n const doc = getDocument(chunkDataView);\n const rdf = getRDF(doc);\n\n return objectAssign(tags, parseXMPObject(convertToObject(rdf, true)));\n } catch (error) {\n return tags;\n }\n}\n\nfunction getDocument(chunkDataView) {\n const Parser = DOMParser.get();\n if (!Parser) {\n console.warn('Warning: DOMParser is not available. It is needed to be able to parse XMP tags.'); // eslint-disable-line no-console\n throw new Error();\n }\n\n const domParser = new Parser();\n const xmlString = typeof chunkDataView === 'string' ? chunkDataView : getStringFromDataView(chunkDataView, 0, chunkDataView.byteLength);\n const doc = domParser.parseFromString(trimXmlSource(xmlString), 'application/xml');\n\n if (doc.documentElement.nodeName === 'parsererror') {\n throw new Error(doc.documentElement.textContent);\n }\n\n return doc;\n}\n\nfunction trimXmlSource(xmlSource) {\n return xmlSource.replace(/^.+(<\\?xpacket begin)/, '$1').replace(/(<\\?xpacket end=\".*\"\\?>).+$/, '$1');\n}\n\nfunction getRDF(node) {\n for (let i = 0; i < node.childNodes.length; i++) {\n if (node.childNodes[i].tagName === 'x:xmpmeta') {\n return getRDF(node.childNodes[i]);\n }\n if (node.childNodes[i].tagName === 'rdf:RDF') {\n return node.childNodes[i];\n }\n }\n\n throw new Error();\n}\n\nfunction convertToObject(node, isTopNode = false) {\n const childNodes = getChildNodes(node);\n\n if (hasTextOnlyContent(childNodes)) {\n if (isTopNode) {\n return {};\n }\n return getTextValue(childNodes[0]);\n }\n\n return getElementsFromNodes(childNodes);\n}\n\nfunction getChildNodes(node) {\n const elements = [];\n\n for (let i = 0; i < node.childNodes.length; i++) {\n elements.push(node.childNodes[i]);\n }\n\n return elements;\n}\n\nfunction hasTextOnlyContent(nodes) {\n return (nodes.length === 1) && (nodes[0].nodeName === '#text');\n}\n\nfunction getTextValue(node) {\n return node.nodeValue;\n}\n\nfunction getElementsFromNodes(nodes) {\n const elements = {};\n\n nodes.forEach((node) => {\n if (isElement(node)) {\n const nodeElement = getElementFromNode(node);\n\n if (elements[node.nodeName] !== undefined) {\n if (!Array.isArray(elements[node.nodeName])) {\n elements[node.nodeName] = [elements[node.nodeName]];\n }\n elements[node.nodeName].push(nodeElement);\n } else {\n elements[node.nodeName] = nodeElement;\n }\n }\n });\n\n return elements;\n}\n\nfunction isElement(node) {\n return (node.nodeName) && (node.nodeName !== '#text');\n}\n\nfunction getElementFromNode(node) {\n return {\n attributes: getAttributes(node),\n value: convertToObject(node)\n };\n}\n\nfunction getAttributes(element) {\n const attributes = {};\n\n for (let i = 0; i < element.attributes.length; i++) {\n attributes[element.attributes[i].nodeName] = decodeURIComponent(escape(element.attributes[i].value));\n }\n\n return attributes;\n}\n\nfunction parseXMPObject(xmpObject) {\n const tags = {};\n\n if (typeof xmpObject === 'string') {\n return xmpObject;\n }\n\n for (const nodeName in xmpObject) {\n let nodes = xmpObject[nodeName];\n\n if (!Array.isArray(nodes)) {\n nodes = [nodes];\n }\n\n nodes.forEach((node) => {\n objectAssign(tags, parseNodeAttributesAsTags(node.attributes));\n if (typeof node.value === 'object') {\n objectAssign(tags, parseNodeChildrenAsTags(node.value));\n }\n });\n }\n\n return tags;\n}\n\nfunction parseNodeAttributesAsTags(attributes) {\n const tags = {};\n\n for (const name in attributes) {\n if (isTagAttribute(name)) {\n tags[getLocalName(name)] = {\n value: attributes[name],\n attributes: {},\n description: getDescription(attributes[name], name)\n };\n }\n }\n\n return tags;\n}\n\nfunction isTagAttribute(name) {\n return (name !== 'rdf:parseType') && (!isNamespaceDefinition(name));\n}\n\nfunction isNamespaceDefinition(name) {\n return name.split(':')[0] === 'xmlns';\n}\n\nfunction getLocalName(name) {\n return name.split(':')[1];\n}\n\nfunction getDescription(value, name = undefined) {\n if (Array.isArray(value)) {\n return getDescriptionOfArray(value);\n }\n if (typeof value === 'object') {\n return getDescriptionOfObject(value);\n }\n\n try {\n if ((name) && (typeof XmpTagNames[name] === 'function')) {\n return XmpTagNames[name](value);\n }\n return decodeURIComponent(escape(value));\n } catch (error) {\n return value;\n }\n}\n\nfunction getDescriptionOfArray(value) {\n return value.map((item) => {\n if (item.value !== undefined) {\n return getDescription(item.value);\n }\n return getDescription(item);\n }).join(', ');\n}\n\nfunction getDescriptionOfObject(value) {\n const descriptions = [];\n\n for (const key in value) {\n descriptions.push(`${getClearTextKey(key)}: ${value[key].value}`);\n }\n\n return descriptions.join('; ');\n}\n\nfunction getClearTextKey(key) {\n if (key === 'CiAdrCity') {\n return 'CreatorCity';\n }\n if (key === 'CiAdrCtry') {\n return 'CreatorCountry';\n }\n if (key === 'CiAdrExtadr') {\n return 'CreatorAddress';\n }\n if (key === 'CiAdrPcode') {\n return 'CreatorPostalCode';\n }\n if (key === 'CiAdrRegion') {\n return 'CreatorRegion';\n }\n if (key === 'CiEmailWork') {\n return 'CreatorWorkEmail';\n }\n if (key === 'CiTelWork') {\n return 'CreatorWorkPhone';\n }\n if (key === 'CiUrlWork') {\n return 'CreatorWorkUrl';\n }\n return key;\n}\n\nfunction parseNodeChildrenAsTags(children) {\n const tags = {};\n\n for (const name in children) {\n if (!isNamespaceDefinition(name)) {\n tags[getLocalName(name)] = parseNodeAsTag(children[name], name);\n }\n }\n\n return tags;\n}\n\nfunction parseNodeAsTag(node, name) {\n if (hasNestedSimpleRdfDescription(node)) {\n return parseNodeAsSimpleRdfDescription(node, name);\n } else if (hasNestedStructureRdfDescription(node)) {\n return parseNodeAsStructureRdfDescription(node, name);\n } else if (isCompactStructure(node)) {\n return parseNodeAsCompactStructure(node, name);\n } else if (isArray(node)) {\n return parseNodeAsArray(node, name);\n }\n return parseNodeAsSimpleValue(node, name);\n}\n\nfunction hasNestedSimpleRdfDescription(node) {\n return ((node.attributes['rdf:parseType'] === 'Resource') && (node.value['rdf:value'] !== undefined))\n || ((node.value['rdf:Description'] !== undefined) && (node.value['rdf:Description'].value['rdf:value'] !== undefined));\n}\n\nfunction parseNodeAsSimpleRdfDescription(node, name) {\n const attributes = parseNodeAttributes(node);\n\n if (node.value['rdf:Description'] !== undefined) {\n node = node.value['rdf:Description'];\n }\n\n objectAssign(attributes, parseNodeAttributes(node), parseNodeChildrenAsAttributes(node));\n\n const value = parseRdfValue(node);\n\n return {\n value,\n attributes,\n description: getDescription(value, name)\n };\n}\n\nfunction parseNodeAttributes(node) {\n const attributes = {};\n\n for (const name in node.attributes) {\n if ((name !== 'rdf:parseType') && (name !== 'rdf:resource') && (!isNamespaceDefinition(name))) {\n attributes[getLocalName(name)] = node.attributes[name];\n }\n }\n\n return attributes;\n}\n\nfunction parseNodeChildrenAsAttributes(node) {\n const attributes = {};\n\n for (const name in node.value) {\n if ((name !== 'rdf:value') && (!isNamespaceDefinition(name))) {\n attributes[getLocalName(name)] = node.value[name].value;\n }\n }\n\n return attributes;\n}\n\nfunction parseRdfValue(node) {\n return getURIValue(node.value['rdf:value']) || node.value['rdf:value'].value;\n}\n\nfunction hasNestedStructureRdfDescription(node) {\n return (node.attributes['rdf:parseType'] === 'Resource')\n || ((node.value['rdf:Description'] !== undefined) && (node.value['rdf:Description'].value['rdf:value'] === undefined));\n}\n\nfunction parseNodeAsStructureRdfDescription(node, name) {\n const tag = {\n value: {},\n attributes: {}\n };\n\n if (node.value['rdf:Description'] !== undefined) {\n objectAssign(tag.value, parseNodeAttributesAsTags(node.value['rdf:Description'].attributes));\n objectAssign(tag.attributes, parseNodeAttributes(node));\n node = node.value['rdf:Description'];\n }\n\n objectAssign(tag.value, parseNodeChildrenAsTags(node.value));\n\n tag.description = getDescription(tag.value, name);\n\n return tag;\n}\n\nfunction isCompactStructure(node) {\n return (Object.keys(node.value).length === 0)\n && (node.attributes['rdf:resource'] === undefined);\n}\n\nfunction parseNodeAsCompactStructure(node, name) {\n const value = parseNodeAttributesAsTags(node.attributes);\n\n return {\n value,\n attributes: {},\n description: getDescription(value, name)\n };\n}\n\nfunction isArray(node) {\n return getArrayChild(node.value) !== undefined;\n}\n\nfunction getArrayChild(value) {\n return value['rdf:Bag'] || value['rdf:Seq'] || value['rdf:Alt'];\n}\n\nfunction parseNodeAsArray(node, name) {\n let items = getArrayChild(node.value).value['rdf:li'];\n const attributes = parseNodeAttributes(node);\n const value = [];\n\n if (items === undefined) {\n items = [];\n } else if (!Array.isArray(items)) {\n items = [items];\n }\n\n items.forEach((item) => {\n value.push(parseArrayValue(item));\n });\n\n return {\n value,\n attributes,\n description: getDescription(value, name)\n };\n}\n\nfunction parseArrayValue(item) {\n if (hasNestedSimpleRdfDescription(item)) {\n return parseNodeAsSimpleRdfDescription(item);\n }\n\n if (hasNestedArrayValue(item)) {\n return parseNodeChildrenAsTags(item.value);\n }\n\n return {\n value: item.value,\n attributes: parseNodeAttributes(item),\n description: getDescription(item.value)\n };\n}\n\nfunction hasNestedArrayValue(node) {\n return node.attributes['rdf:parseType'] === 'Resource';\n}\n\nfunction parseNodeAsSimpleValue(node, name) {\n const value = getURIValue(node) || parseXMPObject(node.value);\n\n return {\n value,\n attributes: parseNodeAttributes(node),\n description: getDescription(value, name)\n };\n}\n\nfunction getURIValue(node) {\n return node.attributes && node.attributes['rdf:resource'];\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringFromDataView} from './utils.js';\n\nexport const iccTags = {\n 'desc': {\n 'name': 'ICC Description',\n },\n 'cprt': {\n 'name': 'ICC Copyright',\n },\n 'dmdd': {\n 'name': 'ICC Device Model Description',\n },\n 'vued': {\n 'name': 'ICC Viewing Conditions Description',\n },\n 'dmnd': {\n 'name': 'ICC Device Manufacturer for Display',\n },\n 'tech': {\n 'name': 'Technology',\n },\n};\n\nexport const iccProfile = {\n 4: {\n 'name': 'Preferred CMM type',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4),\n 'description': (value) => value !== null ? toCompany(value) : '',\n },\n 8: {\n 'name': 'Profile Version',\n 'value': (dataView, offset) => {\n return (dataView.getUint8(offset)).toString(10) + '.'\n + (dataView.getUint8(offset + 1) >> 4).toString(10) + '.'\n + (dataView.getUint8(offset + 1) % 16).toString(10);\n }\n },\n 12: {\n 'name': 'Profile/Device class',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4),\n 'description': (value) => {\n switch (value.toLowerCase()) {\n case 'scnr': return 'Input Device profile';\n case 'mntr': return 'Display Device profile';\n case 'prtr': return 'Output Device profile';\n case 'link': return 'DeviceLink profile';\n case 'abst': return 'Abstract profile';\n case 'spac': return 'ColorSpace profile';\n case 'nmcl': return 'NamedColor profile';\n case 'cenc': return 'ColorEncodingSpace profile';\n case 'mid ': return 'MultiplexIdentification profile';\n case 'mlnk': return 'MultiplexLink profile';\n case 'mvis': return 'MultiplexVisualization profile';\n default: return value;\n }\n }\n },\n 16: {\n 'name': 'Color Space',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4)\n },\n 20: {\n 'name': 'Connection Space',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4)\n },\n 24: {\n 'name': 'ICC Profile Date',\n 'value': (dataView, offset) => parseDate(dataView, offset).toISOString()\n },\n 36: {\n 'name': 'ICC Signature',\n 'value': (dataView, offset) => sliceToString(dataView.buffer.slice(offset, offset + 4))\n },\n 40: {\n 'name': 'Primary Platform',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4),\n 'description': (value) => toCompany(value)\n },\n 48: {\n 'name': 'Device Manufacturer',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4),\n 'description': (value) => toCompany(value)\n },\n 52: {\n 'name': 'Device Model Number',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4)\n },\n 64: {\n 'name': 'Rendering Intent',\n 'value': (dataView, offset) => dataView.getUint32(offset),\n 'description': (value) => {\n switch (value) {\n case 0: return 'Perceptual';\n case 1: return 'Relative Colorimetric';\n case 2: return 'Saturation';\n case 3: return 'Absolute Colorimetric';\n default: return value;\n }\n }\n },\n\n 80: {\n 'name': 'Profile Creator',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4)\n },\n};\n\nfunction parseDate(dataView, offset) {\n const year = dataView.getUint16(offset);\n const month = dataView.getUint16(offset + 2) - 1;\n const day = dataView.getUint16(offset + 4);\n const hours = dataView.getUint16(offset + 6);\n const minutes = dataView.getUint16(offset + 8);\n const seconds = dataView.getUint16(offset + 10);\n return new Date(Date.UTC(year, month, day, hours, minutes, seconds));\n}\n\nfunction sliceToString(slice) {\n return String.fromCharCode.apply(null, new Uint8Array(slice));\n}\n\nfunction toCompany(value) {\n switch (value.toLowerCase()) {\n case 'appl': return 'Apple';\n case 'adbe': return 'Adobe';\n case 'msft': return 'Microsoft';\n case 'sunw': return 'Sun Microsystems';\n case 'sgi': return 'Silicon Graphics';\n case 'tgnt': return 'Taligent';\n default: return value;\n }\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\nimport {iccTags, iccProfile} from './icc-tag-names.js';\nimport {getStringFromDataView, getUnicodeStringFromDataView} from './utils.js';\n\nexport default {\n read\n};\n\nconst PROFILE_HEADER_LENGTH = 84;\nconst ICC_TAG_COUNT_OFFSET = 128;\nconst ICC_SIGNATURE = 'acsp';\nconst TAG_TYPE_DESC = 'desc';\nconst TAG_TYPE_MULTI_LOCALIZED_UNICODE_TYPE = 'mluc';\nconst TAG_TYPE_TEXT = 'text';\nconst TAG_TYPE_SIGNATURE = 'sig ';\nconst TAG_TABLE_SINGLE_TAG_DATA = 12;\n\n// ICC profile data can be longer than application segment max length of ~64k.\n// so it can be split into multiple APP2 segments. Each segment includes\n// total chunk count and chunk number.\n// Here we read all chunks into single continious array of bytes.\nfunction read(dataView, iccData) {\n try {\n const totalIccProfileLength = iccData.reduce((sum, icc) => sum + icc.length, 0);\n\n const iccBinaryData = new Uint8Array(totalIccProfileLength);\n let offset = 0;\n const buffer = getBuffer(dataView);\n\n for (let chunkNumber = 1; chunkNumber <= iccData.length; chunkNumber++) {\n const iccDataChunk = iccData.find((x) => x.chunkNumber === chunkNumber);\n if (!iccDataChunk) {\n throw new Error(`ICC chunk ${chunkNumber} not found`);\n }\n\n const data = buffer.slice(iccDataChunk.offset, iccDataChunk.offset + iccDataChunk.length);\n const chunkData = new Uint8Array(data);\n\n iccBinaryData.set(chunkData, offset);\n offset += chunkData.length;\n }\n\n return parseTags(new DataView(iccBinaryData.buffer));\n } catch (error) {\n return {};\n }\n}\n\nfunction getBuffer(dataView) {\n if (Array.isArray(dataView)) {\n return (new DataView(Uint8Array.from(dataView).buffer)).buffer;\n }\n return dataView.buffer;\n}\n\nfunction iccDoesNotHaveTagCount(buffer) {\n return buffer.length < (ICC_TAG_COUNT_OFFSET + 4);\n}\n\nfunction hasTagsData(buffer, tagHeaderOffset) {\n return buffer.length < tagHeaderOffset + TAG_TABLE_SINGLE_TAG_DATA;\n}\n\nexport function parseTags(dataView) {\n const buffer = dataView.buffer;\n\n const length = dataView.getUint32();\n if (dataView.byteLength !== length) {\n throw new Error('ICC profile length not matching');\n }\n\n if (dataView.length < PROFILE_HEADER_LENGTH) {\n throw new Error('ICC profile too short');\n }\n\n const tags = {};\n\n const iccProfileKeys = Object.keys(iccProfile);\n for (let i = 0; i < iccProfileKeys.length; i++) {\n const offset = iccProfileKeys[i];\n const profileEntry = iccProfile[offset];\n const value = profileEntry.value(dataView, parseInt(offset, 10));\n let description = value;\n if (profileEntry.description) {\n description = profileEntry.description(value);\n }\n\n tags[profileEntry.name] = {\n value,\n description\n };\n }\n\n const signature = sliceToString(buffer.slice(36, 40));\n if (signature !== ICC_SIGNATURE) {\n throw new Error('ICC profile: missing signature');\n }\n\n /* ICC data is incomplete but we have header parsed so lets return it */\n if (iccDoesNotHaveTagCount(buffer)) {\n return tags;\n }\n\n const tagCount = dataView.getUint32(128);\n let tagHeaderOffset = 132;\n\n for (let i = 0; i < tagCount; i++) {\n if (hasTagsData(buffer, tagHeaderOffset)) {\n // Tags are corrupted (offset too far), return what we parsed until now\n return tags;\n }\n const tagSignature = getStringFromDataView(dataView, tagHeaderOffset, 4);\n const tagOffset = dataView.getUint32(tagHeaderOffset + 4);\n const tagSize = dataView.getUint32(tagHeaderOffset + 8);\n\n if (tagOffset > buffer.length) {\n // Tag data is invalid, lets return what we managed to parse\n return tags;\n }\n const tagType = getStringFromDataView(dataView, tagOffset, 4);\n\n if (tagType === TAG_TYPE_DESC) {\n const tagValueSize = dataView.getUint32(tagOffset + 8);\n if (tagValueSize > tagSize) {\n // Tag data is invalid, lets return what we managed to parse\n return tags;\n }\n\n const val = sliceToString(buffer.slice(tagOffset + 12, tagOffset + tagValueSize + 11));\n addTag(tags, tagSignature, val);\n } else if (tagType === TAG_TYPE_MULTI_LOCALIZED_UNICODE_TYPE) {\n const numRecords = dataView.getUint32(tagOffset + 8);\n const recordSize = dataView.getUint32(tagOffset + 12);\n let offset = tagOffset + 16;\n const val = [];\n for (let recordNum = 0; recordNum < numRecords; recordNum++) {\n const languageCode = getStringFromDataView(dataView, offset + 0, 2);\n const countryCode = getStringFromDataView(dataView, offset + 2, 2);\n const textLength = dataView.getUint32(offset + 4);\n const textOffset = dataView.getUint32(offset + 8);\n\n const text = getUnicodeStringFromDataView(dataView, tagOffset + textOffset, textLength);\n val.push({languageCode, countryCode, text});\n offset += recordSize;\n }\n if (numRecords === 1) {\n addTag(tags, tagSignature, val[0].text);\n } else {\n const valObj = {};\n for (let valIndex = 0; valIndex < val.length; valIndex++) {\n valObj[`${val[valIndex].languageCode}-${val[valIndex].countryCode}`] = val[valIndex].text;\n }\n addTag(tags, tagSignature, valObj);\n }\n } else if (tagType === TAG_TYPE_TEXT) {\n const val = sliceToString(buffer.slice(tagOffset + 8, tagOffset + tagSize - 7));\n addTag(tags, tagSignature, val);\n } else if (tagType === TAG_TYPE_SIGNATURE) {\n const val = sliceToString(buffer.slice(tagOffset + 8, tagOffset + 12));\n addTag(tags, tagSignature, val);\n }\n tagHeaderOffset = tagHeaderOffset + 12;\n }\n\n return tags;\n}\n\nfunction sliceToString(slice) {\n return String.fromCharCode.apply(null, new Uint8Array(slice));\n}\n\nfunction addTag(tags, tagSignature, value) {\n if (iccTags[tagSignature]) {\n tags[iccTags[tagSignature].name] = {value, description: value};\n } else {\n tags[tagSignature] = {value, description: value};\n }\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport Types from './types.js';\n\nexport default {\n read\n};\n\nfunction read(dataView, fileDataOffset) {\n return {\n 'Image Width': getImageWidth(dataView, fileDataOffset),\n 'Image Height': getImageHeight(dataView, fileDataOffset),\n 'Bit Depth': getBitDepth(dataView, fileDataOffset),\n 'Color Type': getColorType(dataView, fileDataOffset),\n 'Compression': getCompression(dataView, fileDataOffset),\n 'Filter': getFilter(dataView, fileDataOffset),\n 'Interlace': getInterlace(dataView, fileDataOffset)\n };\n}\n\nfunction getImageWidth(dataView, fileDataOffset) {\n const OFFSET = 0;\n const SIZE = 4;\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getLongAt(dataView, fileDataOffset);\n return {\n value,\n description: `${value}px`\n };\n}\n\nfunction getImageHeight(dataView, fileDataOffset) {\n const OFFSET = 4;\n const SIZE = 4;\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getLongAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: `${value}px`\n };\n}\n\nfunction getBitDepth(dataView, fileDataOffset) {\n const OFFSET = 8;\n const SIZE = 1;\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: `${value}`\n };\n}\n\nfunction getColorType(dataView, fileDataOffset) {\n const OFFSET = 9;\n const SIZE = 1;\n const COLOR_TYPES = {\n 0: 'Grayscale',\n 2: 'RGB',\n 3: 'Palette',\n 4: 'Grayscale with Alpha',\n 6: 'RGB with Alpha'\n };\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: COLOR_TYPES[value] || 'Unknown'\n };\n}\n\nfunction getCompression(dataView, fileDataOffset) {\n const OFFSET = 10;\n const SIZE = 1;\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: value === 0 ? 'Deflate/Inflate' : 'Unknown'\n };\n}\n\nfunction getFilter(dataView, fileDataOffset) {\n const OFFSET = 11;\n const SIZE = 1;\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: value === 0 ? 'Adaptive' : 'Unknown'\n };\n}\n\nfunction getInterlace(dataView, fileDataOffset) {\n const OFFSET = 12;\n const SIZE = 1;\n const INTERLACE_TYPES = {\n 0: 'Noninterlaced',\n 1: 'Adam7 Interlace'\n };\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: INTERLACE_TYPES[value] || 'Unknown'\n };\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {deferInit, getBase64Image} from './utils.js';\n\n// https://exiftool.org/TagNames/EXIF.html#Compression\nconst COMPRESSION_JPEG = [6, 7, 99];\n\nexport default {\n get,\n};\n\nfunction get(dataView, thumbnailTags, tiffHeaderOffset) {\n if (hasJpegThumbnail(thumbnailTags)) {\n thumbnailTags.type = 'image/jpeg';\n const offset = tiffHeaderOffset + thumbnailTags.JPEGInterchangeFormat.value;\n thumbnailTags.image = dataView.buffer.slice(offset, offset + thumbnailTags.JPEGInterchangeFormatLength.value);\n deferInit(thumbnailTags, 'base64', function () {\n return getBase64Image(this.image);\n });\n }\n\n // There is a small possibility of thumbnails in TIFF format but they are\n // not stored as a self-contained image file and would be much more\n // difficult to extract.\n // https://exiftool.org/forum/index.php?topic=3273.msg14778#msg14778\n\n return thumbnailTags;\n}\n\nfunction hasJpegThumbnail(tags) {\n return tags && ((tags.Compression === undefined) || (COMPRESSION_JPEG.includes(tags.Compression.value)))\n && tags.JPEGInterchangeFormat && tags.JPEGInterchangeFormat.value\n && tags.JPEGInterchangeFormatLength && tags.JPEGInterchangeFormatLength.value;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\n/**\n * Thrown when no Exif metadata was found for the given image.\n *\n * @param {string} message The error message.\n */\nfunction MetadataMissingError(message) {\n this.name = 'MetadataMissingError';\n this.message = message || 'No Exif data';\n this.stack = (new Error()).stack;\n}\n\nMetadataMissingError.prototype = new Error;\n\nexport default {\n MetadataMissingError,\n};\n","/**\n * ExifReader\n * http://github.com/mattiasw/exifreader\n * Copyright (C) 2011-2020 Mattias Wallander \n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\n\nimport {objectAssign} from './utils.js';\nimport DataViewWrapper from './dataview.js';\nimport Constants from './constants.js';\nimport {getStringValueFromArray} from './utils.js';\nimport {getCalculatedGpsValue} from './tag-names-utils.js';\nimport ImageHeader from './image-header.js';\nimport Tags from './tags.js';\nimport FileTags from './file-tags.js';\nimport IptcTags from './iptc-tags.js';\nimport XmpTags from './xmp-tags.js';\nimport IccTags from './icc-tags.js';\nimport PngFileTags from './png-file-tags.js';\nimport Thumbnail from './thumbnail.js';\nimport exifErrors from './errors.js';\n\nexport default {\n load,\n loadView,\n errors: exifErrors,\n};\n\nexport const errors = exifErrors;\n\nexport function load(data, options = {expanded: false}) {\n if (isNodeBuffer(data)) {\n // File data read in Node can share the underlying buffer with other\n // data. Therefore it's safest to get a new one to avoid weird bugs.\n data = (new Uint8Array(data)).buffer;\n }\n return loadView(getDataView(data), options);\n}\n\nfunction isNodeBuffer(data) {\n try {\n return Buffer.isBuffer(data); // eslint-disable-line no-undef\n } catch (error) {\n return false;\n }\n}\n\nfunction getDataView(data) {\n try {\n return new DataView(data);\n } catch (error) {\n return new DataViewWrapper(data);\n }\n}\n\nexport function loadView(dataView, options = {expanded: false}) {\n let foundMetaData = false;\n let tags = {};\n\n const {\n fileDataOffset,\n tiffHeaderOffset,\n iptcDataOffset,\n xmpChunks,\n iccChunks,\n mpfDataOffset,\n pngHeaderOffset\n } = ImageHeader.parseAppMarkers(dataView);\n\n if (Constants.USE_JPEG && Constants.USE_FILE && hasFileData(fileDataOffset)) {\n foundMetaData = true;\n const readTags = FileTags.read(dataView, fileDataOffset);\n if (options.expanded) {\n tags.file = readTags;\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n if (Constants.USE_EXIF && hasExifData(tiffHeaderOffset)) {\n foundMetaData = true;\n const readTags = Tags.read(dataView, tiffHeaderOffset);\n if (readTags.Thumbnail) {\n tags.Thumbnail = readTags.Thumbnail;\n delete readTags.Thumbnail;\n }\n\n if (options.expanded) {\n tags.exif = readTags;\n addGpsGroup(tags);\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n\n if (Constants.USE_TIFF && Constants.USE_IPTC && readTags['IPTC-NAA'] && !hasIptcData(iptcDataOffset)) {\n const readIptcTags = IptcTags.read(readTags['IPTC-NAA'].value, 0);\n if (options.expanded) {\n tags.iptc = readIptcTags;\n } else {\n tags = objectAssign({}, tags, readIptcTags);\n }\n }\n\n if (Constants.USE_TIFF && Constants.USE_XMP && readTags['ApplicationNotes'] && !hasXmpData(xmpChunks)) {\n const readXmpTags = XmpTags.read(getStringValueFromArray(readTags['ApplicationNotes'].value));\n if (options.expanded) {\n tags.xmp = readXmpTags;\n } else {\n tags = objectAssign({}, tags, readXmpTags);\n }\n }\n\n if (Constants.USE_TIFF && Constants.USE_ICC && readTags['ICC_Profile'] && !hasIccData(iccChunks)) {\n const readIccTags = IccTags.read(\n readTags['ICC_Profile'].value,\n [{\n offset: 0,\n length: readTags['ICC_Profile'].value.length,\n chunkNumber: 1,\n chunksTotal: 1\n }]\n );\n if (options.expanded) {\n tags.icc = readIccTags;\n } else {\n tags = objectAssign({}, tags, readIccTags);\n }\n }\n }\n\n if (Constants.USE_JPEG && Constants.USE_IPTC && hasIptcData(iptcDataOffset)) {\n foundMetaData = true;\n const readTags = IptcTags.read(dataView, iptcDataOffset);\n if (options.expanded) {\n tags.iptc = readTags;\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n if (Constants.USE_XMP && hasXmpData(xmpChunks)) {\n foundMetaData = true;\n const readTags = XmpTags.read(dataView, xmpChunks);\n if (options.expanded) {\n tags.xmp = readTags;\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n if ((Constants.USE_JPEG || Constants.USE_WEBP) && Constants.USE_ICC && hasIccData(iccChunks)) {\n foundMetaData = true;\n const readTags = IccTags.read(dataView, iccChunks);\n if (options.expanded) {\n tags.icc = readTags;\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n if (Constants.USE_MPF && hasMpfData(mpfDataOffset)) {\n foundMetaData = true;\n const readMpfTags = Tags.readMpf(dataView, mpfDataOffset);\n if (options.expanded) {\n tags.mpf = readMpfTags;\n } else {\n tags = objectAssign({}, tags, readMpfTags);\n }\n }\n\n if (Constants.USE_PNG && Constants.USE_PNG_FILE && hasPngFileData(pngHeaderOffset)) {\n foundMetaData = true;\n const readTags = PngFileTags.read(dataView, pngHeaderOffset);\n if (options.expanded) {\n tags.pngFile = readTags;\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n const thumbnail = (Constants.USE_JPEG || Constants.USE_WEBP)\n && Constants.USE_EXIF\n && Constants.USE_THUMBNAIL\n && Thumbnail.get(dataView, tags.Thumbnail, tiffHeaderOffset);\n if (thumbnail) {\n foundMetaData = true;\n tags.Thumbnail = thumbnail;\n } else {\n delete tags.Thumbnail;\n }\n\n if (!foundMetaData) {\n throw new exifErrors.MetadataMissingError();\n }\n\n return tags;\n}\n\nfunction hasFileData(fileDataOffset) {\n return fileDataOffset !== undefined;\n}\n\nfunction hasExifData(tiffHeaderOffset) {\n return tiffHeaderOffset !== undefined;\n}\n\nfunction addGpsGroup(tags) {\n if (tags.exif) {\n if (tags.exif.GPSLatitude && tags.exif.GPSLatitudeRef) {\n try {\n tags.gps = tags.gps || {};\n tags.gps.Latitude = getCalculatedGpsValue(tags.exif.GPSLatitude.value);\n if (tags.exif.GPSLatitudeRef.value.join('') === 'S') {\n tags.gps.Latitude = -tags.gps.Latitude;\n }\n } catch (error) {\n // Ignore.\n }\n }\n\n if (tags.exif.GPSLongitude && tags.exif.GPSLongitudeRef) {\n try {\n tags.gps = tags.gps || {};\n tags.gps.Longitude = getCalculatedGpsValue(tags.exif.GPSLongitude.value);\n if (tags.exif.GPSLongitudeRef.value.join('') === 'W') {\n tags.gps.Longitude = -tags.gps.Longitude;\n }\n } catch (error) {\n // Ignore.\n }\n }\n\n if (tags.exif.GPSAltitude && tags.exif.GPSAltitudeRef) {\n try {\n tags.gps = tags.gps || {};\n tags.gps.Altitude = tags.exif.GPSAltitude.value[0] / tags.exif.GPSAltitude.value[1];\n if (tags.exif.GPSAltitudeRef.value === 1) {\n tags.gps.Altitude = -tags.gps.Altitude;\n }\n } catch (error) {\n // Ignore.\n }\n }\n }\n}\n\nfunction hasIptcData(iptcDataOffset) {\n return iptcDataOffset !== undefined;\n}\n\nfunction hasXmpData(xmpChunks) {\n return Array.isArray(xmpChunks) && xmpChunks.length > 0;\n}\n\nfunction hasIccData(iccDataOffsets) {\n return Array.isArray(iccDataOffsets) && iccDataOffsets.length > 0;\n}\n\nfunction hasMpfData(mpfDataOffset) {\n return mpfDataOffset !== undefined;\n}\n\nfunction hasPngFileData(pngFileDataOffset) {\n return pngFileDataOffset !== undefined;\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://ExifReader/webpack/universalModuleDefinition","webpack://ExifReader/webpack/bootstrap","webpack://ExifReader/./src/dom-parser.js","webpack://ExifReader/./src/utils.js","webpack://ExifReader/./src/dataview.js","webpack://ExifReader/./src/tag-names-utils.js","webpack://ExifReader/./src/byte-order.js","webpack://ExifReader/./src/image-header-jpeg.js","webpack://ExifReader/./src/image-header-png.js","webpack://ExifReader/./src/image-header-heic.js","webpack://ExifReader/./src/image-header-webp.js","webpack://ExifReader/./src/image-header.js","webpack://ExifReader/./src/image-header-tiff.js","webpack://ExifReader/./src/types.js","webpack://ExifReader/./src/tag-names-common.js","webpack://ExifReader/./src/tag-names-gps-ifd.js","webpack://ExifReader/./src/tag-names-interoperability-ifd.js","webpack://ExifReader/./src/tag-names-mpf-ifd.js","webpack://ExifReader/./src/tag-names.js","webpack://ExifReader/./src/tag-names-0th-ifd.js","webpack://ExifReader/./src/tag-names-exif-ifd.js","webpack://ExifReader/./src/tags.js","webpack://ExifReader/./src/file-tags.js","webpack://ExifReader/./src/iptc-tag-names.js","webpack://ExifReader/./src/text-decoder.js","webpack://ExifReader/./src/tag-decoder.js","webpack://ExifReader/./src/iptc-tags.js","webpack://ExifReader/./src/xmp-tag-names.js","webpack://ExifReader/./src/xmp-tags.js","webpack://ExifReader/./src/icc-tag-names.js","webpack://ExifReader/./src/icc-tags.js","webpack://ExifReader/./src/png-file-tags.js","webpack://ExifReader/./src/thumbnail.js","webpack://ExifReader/./src/errors.js","webpack://ExifReader/./src/exif-reader.js"],"names":["root","factory","exports","module","define","amd","self","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","DOMParser","eval","error","getStringFromDataView","dataView","offset","length","chars","byteLength","push","getUint8","getStringValueFromArray","getUnicodeStringFromDataView","getUint16","charArray","map","charCode","String","fromCharCode","join","objectAssign","arguments","deferInit","initializer","initialized","configurable","apply","writable","getBase64Image","image","btoa","Array","reduce","Uint8Array","data","byte","Buffer","undefined","from","toString","DataView","buffer","readUInt8","readUInt16LE","readUInt16BE","readUInt32LE","readUInt32BE","readInt32LE","readInt32BE","bufferTypeIsUnsupported","Error","littleEndian","getStringValue","getEncodedString","encoding","slice","getCalculatedGpsValue","LITTLE_ENDIAN","tiffHeaderOffset","APP1_MARKER","isSOF0Marker","appMarkerPosition","isSOF2Marker","isApp2ICCMarker","APP2_ICC_IDENTIFIER","isApp2MPFMarker","APP2_MPF_IDENTIFIER","isApp1ExifMarker","APP1_EXIF_IDENTIFIER","isApp1XmpMarker","APP1_XMP_IDENTIFIER","isXmpIdentifier","isApp1ExtendedXmpMarker","APP1_XMP_EXTENDED_IDENTIFIER","isExtendedXmpIdentifier","getXmpChunkDetails","fieldLength","dataOffset","getExtendedXmpChunkDetails","isApp13PhotoshopMarker","APP13_IPTC_IDENTIFIER","isAppMarker","appMarker","PNG_ID","isPngImageHeaderChunk","isPngXmpChunk","PNG_CHUNK_LENGTH_SIZE","PNG_XMP_PREFIX","getPngXmpDataOffset","PNG_CHUNK_DATA_OFFSET","numberOfNullSeparators","getAtomLength","atomLength","getUint32","extendsToEndOfFile","hasExtendedSize","hasEmptyHighBits","ByteOrder","hasTiffMarker","Tiff","hasAppMarkers","Jpeg","sof0DataOffset","sof2DataOffset","iptcDataOffset","xmpChunks","iccChunks","mpfDataOffset","iccDataOffset","iccDataLength","iccChunkNumber","APP_ID_OFFSET","iccChunksTotal","ICC_CHUNK_NUMBER_OFFSET","chunkNumber","chunksTotal","fileDataOffset","Png","offsets","pngHeaderOffset","heicMajorBrand","HEIC_ID_OFFSET","HEIC_ID","indexOf","Heic","findMetaAtom","metaOffset","metaLength","metaEndOffset","Math","min","ilocOffset","exifItemOffset","colrOffset","itemName","findMetaItems","exifOffset","exifItemIndex","exifPointer","findExifOffset","colorType","findIccChunks","RIFF_ID","WEBP_MARKER","Webp","chunkId","chunkSize","EXIF_IDENTIFIER","typeSizes","1","2","3","4","5","7","9","10","13","tagTypes","getAsciiValue","getByteAt","getAsciiAt","getShortAt","byteOrder","getLongAt","getRationalAt","getUndefinedAt","getSlongAt","getSrationalAt","getIfdPointerAt","getTypeSize","typeName","getInt32","0","ref","values","num","test","status","description","tagNames0thExifIfds","round","formats","6","isArray","sample","TagNamesCommon","character","pow","sqrt","toFixed","x","y","focalLengths","TagNamesGpsIfd","TagNamesInteroperabilityIfd","TagNamesMpfIfd","getTagValueAt","Types","tags","readIfd","get0thIfdOffset","read0thIfd","INTEROPERABILITY_IFD_POINTER_KEY","readInteroperabilityIfd","GPS_INFO_IFD_POINTER_KEY","readGpsIfd","EXIF_IFD_POINTER_KEY","readExifIfd","ENTRY_SIZE","images","ceil","attributes","getImageNumberValue","getImageFlags","getImageFormat","getImageType","imageSize","imageOffset","isFirstIndividualImage","dependentImage1EntryNumber","dependentImage2EntryNumber","addMpfImages","entries","size","flags","flagsDescription","imageFormat","type","ifdType","FIELD_COUNT_SIZE","numberOfFields","getNumberOfFields","fieldIndex","tag","readTag","id","nextIfdOffset","tagValue","TAG_TYPE_OFFSET","TAG_COUNT_OFFSET","TAG_VALUE_OFFSET","tagCode","tagType","tagCount","tagValueFitsInOffsetSlot","getTagValue","tagValueOffset","tagValueFitsInDataView","asciiValue","decodeURIComponent","escape","decodeAsciiValue","string","j","splitNullSeparatedAsciiString","tagName","tagDescription","TagNames","getDescriptionFromTagValue","count","forceByteType","valueIndex","getLength","numberOfColorComponents","OFFSET","getNumberOfColorComponents","getDataPrecision","getImageHeight","getImageWidth","getSubsampling","components","componentOffset","getComponentIds","getSamplingType","ids","compontent","types","getCreationDate","getCreationTime","getEncodingName","parts","split","stringValue","character0","charAt","character1","parseInt","bits","duration","substr","intValue","formatVersions","objectDataPreviewFileFormat","date","time","parsedTime","Decoder","TextDecoder","decode","parseTags","BYTES_8BIM_SIZE","resourceBlock","getResourceBlock","isNaaResourceBlock","naaBlock","getBlockPadding","getNaaResourceBlock","endOfBlockOffset","tagSize","leadByteIsMissing","getTagName","IptcTagNames","getTagDescription","tagIsRepeatable","tagContainsEncoding","tagIsName","hasDynamicName","hasDescriptionProperty","tagValueIsText","TagDecoder","calculateGPSValue","degreesString","minutesString","degrees","parseFloat","minutes","Number","isNaN","chunks","readTags","completeChunks","combineChunks","extractCompleteChunks","totalLength","chunk","combinedChunks","set","chunkDataView","parseXMPObject","convertToObject","getRDF","Parser","console","warn","domParser","xmlString","doc","parseFromString","replace","documentElement","nodeName","textContent","getDocument","node","childNodes","isTopNode","getChildNodes","hasTextOnlyContent","getTextValue","getElementsFromNodes","elements","nodes","nodeValue","forEach","isElement","nodeElement","getAttributes","getElementFromNode","element","xmpObject","parseNodeAttributesAsTags","parseNodeChildrenAsTags","isTagAttribute","getLocalName","getDescription","isNamespaceDefinition","getDescriptionOfArray","getDescriptionOfObject","XmpTagNames","item","descriptions","getClearTextKey","children","parseNodeAsTag","hasNestedSimpleRdfDescription","parseNodeAsSimpleRdfDescription","hasNestedStructureRdfDescription","parseNodeAttributes","parseNodeAsStructureRdfDescription","keys","isCompactStructure","parseNodeAsCompactStructure","getArrayChild","items","hasNestedArrayValue","parseArrayValue","parseNodeAsArray","getURIValue","parseNodeAsSimpleValue","parseNodeChildrenAsAttributes","parseRdfValue","iccTags","iccProfile","toCompany","8","12","toLowerCase","16","20","24","year","month","day","hours","seconds","Date","UTC","parseDate","toISOString","36","40","48","52","64","80","iccData","totalIccProfileLength","sum","icc","iccBinaryData","getBuffer","iccDataChunk","find","chunkData","iccProfileKeys","profileEntry","sliceToString","ICC_SIGNATURE","ICC_TAG_COUNT_OFFSET","iccDoesNotHaveTagCount","tagHeaderOffset","hasTagsData","tagSignature","tagOffset","TAG_TYPE_DESC","tagValueSize","addTag","TAG_TYPE_MULTI_LOCALIZED_UNICODE_TYPE","numRecords","recordSize","val","recordNum","languageCode","countryCode","textLength","textOffset","text","valObj","valIndex","TAG_TYPE_TEXT","TAG_TYPE_SIGNATURE","getBitDepth","getColorType","getCompression","getFilter","getInterlace","COMPRESSION_JPEG","thumbnailTags","Compression","includes","JPEGInterchangeFormat","JPEGInterchangeFormatLength","MetadataMissingError","message","stack","errors","load","loadView","exifErrors","options","expanded","isNodeBuffer","getDataView","isBuffer","DataViewWrapper","foundMetaData","ImageHeader","hasFileData","FileTags","file","hasExifData","Tags","Thumbnail","exif","addGpsGroup","hasIptcData","readIptcTags","IptcTags","iptc","hasXmpData","readXmpTags","XmpTags","xmp","hasIccData","readIccTags","IccTags","hasMpfData","readMpfTags","mpf","hasPngFileData","PngFileTags","pngFile","thumbnail","GPSLatitude","GPSLatitudeRef","gps","Latitude","GPSLongitude","GPSLongitudeRef","Longitude","GPSAltitude","GPSAltitudeRef","Altitude","iccDataOffsets","pngFileDataOffset"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAoB,WAAID,IAExBD,EAAiB,WAAIC,IARvB,CASmB,oBAATK,KAAuBA,KAAOC,MAAM,WAC9C,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUR,QAGnC,IAAIC,EAASK,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,EAAG,EACHV,QAAS,IAUV,OANAW,EAAQH,GAAUI,KAAKX,EAAOD,QAASC,EAAQA,EAAOD,QAASO,GAG/DN,EAAOS,EAAI,EAGJT,EAAOD,QA0Df,OArDAO,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASf,EAASgB,EAAMC,GAC3CV,EAAoBW,EAAElB,EAASgB,IAClCG,OAAOC,eAAepB,EAASgB,EAAM,CAAEK,WAAY,EAAMC,IAAKL,KAKhEV,EAAoBgB,EAAI,SAASvB,GACX,oBAAXwB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAepB,EAASwB,OAAOC,YAAa,CAAEC,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W7c,EAAsB+I,EAAKuS,KAAKoB,YAAYjhB,OAChB,MAA5CsN,EAAKuS,KAAKqB,eAAelhB,MAAMkC,KAAK,MACpCoL,EAAK6T,IAAIC,UAAY9T,EAAK6T,IAAIC,UAEpC,MAAOngB,IAKb,GAAIqM,EAAKuS,KAAKwB,cAAgB/T,EAAKuS,KAAKyB,gBACpC,IACIhU,EAAK6T,IAAM7T,EAAK6T,KAAO,GACvB7T,EAAK6T,IAAII,UAAYhd,EAAsB+I,EAAKuS,KAAKwB,aAAarhB,OACjB,MAA7CsN,EAAKuS,KAAKyB,gBAAgBthB,MAAMkC,KAAK,MACrCoL,EAAK6T,IAAII,WAAajU,EAAK6T,IAAII,WAErC,MAAOtgB,IAKb,GAAIqM,EAAKuS,KAAK2B,aAAelU,EAAKuS,KAAK4B,eACnC,IACInU,EAAK6T,IAAM7T,EAAK6T,KAAO,GACvB7T,EAAK6T,IAAIO,SAAWpU,EAAKuS,KAAK2B,YAAYxhB,MAAM,GAAKsN,EAAKuS,KAAK2B,YAAYxhB,MAAM,GAC1C,IAAnCsN,EAAKuS,KAAK4B,eAAezhB,QACzBsN,EAAK6T,IAAIO,UAAYpU,EAAK6T,IAAIO,UAEpC,MAAOzgB,MAOrB,SAAS8e,GAAYxY,GACjB,YAA0BnE,IAAnBmE,EAGX,SAAS4Y,GAAW3Y,GAChB,OAAO1E,MAAMyJ,QAAQ/E,IAAcA,EAAUnG,OAAS,EAG1D,SAASkf,GAAWoB,GAChB,OAAO7e,MAAMyJ,QAAQoV,IAAmBA,EAAetgB,OAAS,EAGpE,SAASqf,GAAWhZ,GAChB,YAAyBtE,IAAlBsE,EAGX,SAASmZ,GAAee,GACpB,YAA6Bxe,IAAtBwe","file":"exif-reader.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ExifReader\"] = factory();\n\telse\n\t\troot[\"ExifReader\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nexport default {\n get\n};\n\nfunction get() {\n if (typeof DOMParser !== 'undefined') {\n return DOMParser;\n }\n try {\n return eval('require')('xmldom').DOMParser; // This stops Webpack from replacing the require with a generic import and bundling the module.\n } catch (error) {\n return undefined;\n }\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nexport function getStringFromDataView(dataView, offset, length) {\n const chars = [];\n for (let i = 0; i < length && offset + i < dataView.byteLength; i++) {\n chars.push(dataView.getUint8(offset + i));\n }\n return getStringValueFromArray(chars);\n}\n\nexport function getUnicodeStringFromDataView(dataView, offset, length) {\n const chars = [];\n for (let i = 0; i < length && offset + i < dataView.byteLength; i += 2) {\n chars.push(dataView.getUint16(offset + i));\n }\n return getStringValueFromArray(chars);\n}\n\nexport function getStringValueFromArray(charArray) {\n return charArray.map((charCode) => String.fromCharCode(charCode)).join('');\n}\n\nexport function getCharacterArray(string) {\n return string.split('').map((character) => character.charCodeAt(0));\n}\n\nexport function objectAssign() {\n for (let i = 1; i < arguments.length; i++) {\n for (const property in arguments[i]) {\n arguments[0][property] = arguments[i][property];\n }\n }\n\n return arguments[0];\n}\n\nexport function deferInit(object, key, initializer) {\n let initialized = false;\n Object.defineProperty(object, key, {\n get() {\n if (!initialized) {\n initialized = true;\n Object.defineProperty(object, key, {\n configurable: true,\n enumerable: true,\n value: initializer.apply(object),\n writable: true\n });\n }\n return object[key];\n },\n configurable: true,\n enumerable: true\n });\n}\n\nexport function getBase64Image(image) {\n if (typeof btoa !== 'undefined') {\n // IE11- does not implement reduce on the Uint8Array prototype.\n return btoa(Array.prototype.reduce.call(new Uint8Array(image), (data, byte) => data + String.fromCharCode(byte), ''));\n }\n if (typeof Buffer === 'undefined') {\n return undefined;\n }\n if (typeof Buffer.from !== undefined) { // eslint-disable-line no-undef\n return Buffer.from(image).toString('base64'); // eslint-disable-line no-undef\n }\n return (new Buffer(image)).toString('base64'); // eslint-disable-line no-undef\n}\n","export default class DataView {\n constructor(buffer) {\n if (bufferTypeIsUnsupported(buffer)) {\n throw new Error('DataView: Passed buffer type is unsupported.');\n }\n\n this.buffer = buffer;\n this.byteLength = this.buffer.length;\n }\n\n getUint8(offset) {\n return this.buffer.readUInt8(offset);\n }\n\n getUint16(offset, littleEndian) {\n if (littleEndian) {\n return this.buffer.readUInt16LE(offset);\n }\n return this.buffer.readUInt16BE(offset);\n }\n\n getUint32(offset, littleEndian) {\n if (littleEndian) {\n return this.buffer.readUInt32LE(offset);\n }\n return this.buffer.readUInt32BE(offset);\n }\n\n getInt32(offset, littleEndian) {\n if (littleEndian) {\n return this.buffer.readInt32LE(offset);\n }\n return this.buffer.readInt32BE(offset);\n }\n}\n\nfunction bufferTypeIsUnsupported(buffer) {\n return typeof buffer !== 'object'\n || buffer.length === undefined\n || buffer.readUInt8 === undefined\n || buffer.readUInt16LE === undefined\n || buffer.readUInt16BE === undefined\n || buffer.readUInt32LE === undefined\n || buffer.readUInt32BE === undefined\n || buffer.readInt32LE === undefined\n || buffer.readInt32BE === undefined;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nexport function getStringValue(value) {\n return value.map((charCode) => String.fromCharCode(charCode)).join('');\n}\n\nexport function getEncodedString(value) {\n if (value.length >= 8) {\n const encoding = getStringValue(value.slice(0, 8));\n\n if (encoding === 'ASCII\\x00\\x00\\x00') {\n return getStringValue(value.slice(8));\n } else if (encoding === 'JIS\\x00\\x00\\x00\\x00\\x00') {\n return '[JIS encoded text]';\n } else if (encoding === 'UNICODE\\x00') {\n return '[Unicode encoded text]';\n } else if (encoding === '\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00') {\n return '[Undefined encoding]';\n }\n }\n\n return 'Undefined';\n}\n\nexport function getCalculatedGpsValue(value) {\n return (value[0][0] / value[0][1]) + (value[1][0] / value[1][1]) / 60 + (value[2][0] / value[2][1]) / 3600;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nconst LITTLE_ENDIAN = 0x4949;\nconst BIG_ENDIAN = 0x4d4d;\n\nexport default {\n BIG_ENDIAN,\n LITTLE_ENDIAN,\n getByteOrder\n};\n\nfunction getByteOrder(dataView, tiffHeaderOffset) {\n if (dataView.getUint16(tiffHeaderOffset) === LITTLE_ENDIAN) {\n return LITTLE_ENDIAN;\n } else if (dataView.getUint16(tiffHeaderOffset) === BIG_ENDIAN) {\n return BIG_ENDIAN;\n }\n throw new Error('Illegal byte order value. Faulty image.');\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringFromDataView} from './utils.js';\nimport Constants from './constants.js';\n\nexport default {\n isJpegFile,\n findJpegOffsets\n};\n\nconst MIN_JPEG_DATA_BUFFER_LENGTH = 2;\nconst JPEG_ID = 0xffd8;\nconst JPEG_ID_SIZE = 2;\nconst APP_ID_OFFSET = 4;\nconst APP_MARKER_SIZE = 2;\nconst TIFF_HEADER_OFFSET = 10; // From start of APP1 marker.\nconst IPTC_DATA_OFFSET = 18; // From start of APP13 marker.\nconst XMP_DATA_OFFSET = 33; // From start of APP1 marker.\nconst XMP_EXTENDED_DATA_OFFSET = 79; // From start of APP1 marker including GUID, total length, and offset.\nconst APP2_ICC_DATA_OFFSET = 18; // From start of APP2 marker including marker and chunk/chunk total numbers.\nconst MPF_DATA_OFFSET = 8;\n\nconst APP2_ICC_IDENTIFIER = 'ICC_PROFILE\\0';\nconst ICC_CHUNK_NUMBER_OFFSET = APP_ID_OFFSET + APP2_ICC_IDENTIFIER.length;\nconst ICC_TOTAL_CHUNKS_OFFSET = ICC_CHUNK_NUMBER_OFFSET + 1;\n\nconst APP2_MPF_IDENTIFIER = 'MPF\\0';\n\nconst SOF0_MARKER = 0xffc0;\nconst SOF2_MARKER = 0xffc2;\nconst DHT_MARKER = 0xffc4;\nconst DQT_MARKER = 0xffdb;\nconst DRI_MARKER = 0xffdd;\nconst SOS_MARKER = 0xffda;\n\nconst APP0_MARKER = 0xffe0;\nconst APP1_MARKER = 0xffe1;\nconst APP2_MARKER = 0xffe2;\nconst APP13_MARKER = 0xffed;\nconst APP15_MARKER = 0xffef;\nconst COMMENT_MARKER = 0xfffe;\n\nconst APP1_EXIF_IDENTIFIER = 'Exif';\nconst APP1_XMP_IDENTIFIER = 'http://ns.adobe.com/xap/1.0/\\x00';\nconst APP1_XMP_EXTENDED_IDENTIFIER = 'http://ns.adobe.com/xmp/extension/\\x00';\nconst APP13_IPTC_IDENTIFIER = 'Photoshop 3.0';\n\nfunction isJpegFile(dataView) {\n return (dataView.byteLength >= MIN_JPEG_DATA_BUFFER_LENGTH) && (dataView.getUint16(0) === JPEG_ID);\n}\n\nfunction findJpegOffsets(dataView) {\n let appMarkerPosition = JPEG_ID_SIZE;\n let fieldLength;\n let sof0DataOffset;\n let sof2DataOffset;\n let tiffHeaderOffset;\n let iptcDataOffset;\n let xmpChunks;\n let iccChunks;\n let mpfDataOffset;\n\n while (appMarkerPosition + APP_ID_OFFSET + 5 <= dataView.byteLength) {\n if (Constants.USE_FILE && isSOF0Marker(dataView, appMarkerPosition)) {\n sof0DataOffset = appMarkerPosition + APP_MARKER_SIZE;\n } else if (Constants.USE_FILE && isSOF2Marker(dataView, appMarkerPosition)) {\n sof2DataOffset = appMarkerPosition + APP_MARKER_SIZE;\n } else if (Constants.USE_EXIF && isApp1ExifMarker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n tiffHeaderOffset = appMarkerPosition + TIFF_HEADER_OFFSET;\n } else if (Constants.USE_XMP && isApp1XmpMarker(dataView, appMarkerPosition)) {\n if (!xmpChunks) {\n xmpChunks = [];\n }\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n xmpChunks.push(getXmpChunkDetails(appMarkerPosition, fieldLength));\n } else if (Constants.USE_XMP && isApp1ExtendedXmpMarker(dataView, appMarkerPosition)) {\n if (!xmpChunks) {\n xmpChunks = [];\n }\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n xmpChunks.push(getExtendedXmpChunkDetails(appMarkerPosition, fieldLength));\n } else if (Constants.USE_IPTC && isApp13PhotoshopMarker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n iptcDataOffset = appMarkerPosition + IPTC_DATA_OFFSET;\n } else if (Constants.USE_ICC && isApp2ICCMarker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n const iccDataOffset = appMarkerPosition + APP2_ICC_DATA_OFFSET;\n const iccDataLength = fieldLength - (APP2_ICC_DATA_OFFSET - APP_MARKER_SIZE);\n\n const iccChunkNumber = dataView.getUint8(appMarkerPosition + ICC_CHUNK_NUMBER_OFFSET);\n const iccChunksTotal = dataView.getUint8(appMarkerPosition + ICC_TOTAL_CHUNKS_OFFSET);\n if (!iccChunks) {\n iccChunks = [];\n }\n iccChunks.push({offset: iccDataOffset, length: iccDataLength, chunkNumber: iccChunkNumber, chunksTotal: iccChunksTotal});\n } else if (Constants.USE_MPF && isApp2MPFMarker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n mpfDataOffset = appMarkerPosition + MPF_DATA_OFFSET;\n } else if (isAppMarker(dataView, appMarkerPosition)) {\n fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);\n } else {\n break;\n }\n appMarkerPosition += APP_MARKER_SIZE + fieldLength;\n }\n\n return {\n hasAppMarkers: appMarkerPosition > JPEG_ID_SIZE,\n fileDataOffset: sof0DataOffset || sof2DataOffset,\n tiffHeaderOffset,\n iptcDataOffset,\n xmpChunks,\n iccChunks,\n mpfDataOffset\n };\n}\n\nfunction isSOF0Marker(dataView, appMarkerPosition) {\n return (dataView.getUint16(appMarkerPosition) === SOF0_MARKER);\n}\n\nfunction isSOF2Marker(dataView, appMarkerPosition) {\n return (dataView.getUint16(appMarkerPosition) === SOF2_MARKER);\n}\n\nfunction isApp2ICCMarker(dataView, appMarkerPosition) {\n const markerIdLength = APP2_ICC_IDENTIFIER.length;\n\n return (dataView.getUint16(appMarkerPosition) === APP2_MARKER)\n && (getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP2_ICC_IDENTIFIER);\n}\n\nfunction isApp2MPFMarker(dataView, appMarkerPosition) {\n const markerIdLength = APP2_MPF_IDENTIFIER.length;\n\n return (dataView.getUint16(appMarkerPosition) === APP2_MARKER)\n && (getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP2_MPF_IDENTIFIER);\n}\n\nfunction isApp1ExifMarker(dataView, appMarkerPosition) {\n const markerIdLength = APP1_EXIF_IDENTIFIER.length;\n\n return (dataView.getUint16(appMarkerPosition) === APP1_MARKER)\n && (getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP1_EXIF_IDENTIFIER)\n && (dataView.getUint8(appMarkerPosition + APP_ID_OFFSET + markerIdLength) === 0x00);\n}\n\nfunction isApp1XmpMarker(dataView, appMarkerPosition) {\n return (dataView.getUint16(appMarkerPosition) === APP1_MARKER)\n && isXmpIdentifier(dataView, appMarkerPosition);\n}\n\nfunction isXmpIdentifier(dataView, appMarkerPosition) {\n const markerIdLength = APP1_XMP_IDENTIFIER.length;\n return getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP1_XMP_IDENTIFIER;\n}\n\nfunction isApp1ExtendedXmpMarker(dataView, appMarkerPosition) {\n return (dataView.getUint16(appMarkerPosition) === APP1_MARKER)\n && isExtendedXmpIdentifier(dataView, appMarkerPosition);\n}\n\nfunction isExtendedXmpIdentifier(dataView, appMarkerPosition) {\n const markerIdLength = APP1_XMP_EXTENDED_IDENTIFIER.length;\n return getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP1_XMP_EXTENDED_IDENTIFIER;\n}\n\nfunction getXmpChunkDetails(appMarkerPosition, fieldLength) {\n return {\n dataOffset: appMarkerPosition + XMP_DATA_OFFSET,\n length: fieldLength - (XMP_DATA_OFFSET - APP_MARKER_SIZE)\n };\n}\n\nfunction getExtendedXmpChunkDetails(appMarkerPosition, fieldLength) {\n return {\n dataOffset: appMarkerPosition + XMP_EXTENDED_DATA_OFFSET,\n length: fieldLength - (XMP_EXTENDED_DATA_OFFSET - APP_MARKER_SIZE)\n };\n}\n\nfunction isApp13PhotoshopMarker(dataView, appMarkerPosition) {\n const markerIdLength = APP13_IPTC_IDENTIFIER.length;\n\n return (dataView.getUint16(appMarkerPosition) === APP13_MARKER)\n && (getStringFromDataView(dataView, appMarkerPosition + APP_ID_OFFSET, markerIdLength) === APP13_IPTC_IDENTIFIER)\n && (dataView.getUint8(appMarkerPosition + APP_ID_OFFSET + markerIdLength) === 0x00);\n}\n\nfunction isAppMarker(dataView, appMarkerPosition) {\n const appMarker = dataView.getUint16(appMarkerPosition);\n return ((appMarker >= APP0_MARKER) && (appMarker <= APP15_MARKER))\n || (appMarker === COMMENT_MARKER)\n || (appMarker === SOF0_MARKER)\n || (appMarker === SOF2_MARKER)\n || (appMarker === DHT_MARKER)\n || (appMarker === DQT_MARKER)\n || (appMarker === DRI_MARKER)\n || (appMarker === SOS_MARKER);\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringFromDataView} from './utils.js';\nimport Constants from './constants.js';\n\nexport default {\n isPngFile,\n findPngOffsets\n};\n\nconst PNG_ID = '\\x89\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a';\nconst PNG_CHUNK_LENGTH_SIZE = 4;\nconst PNG_CHUNK_TYPE_SIZE = 4;\nconst PNG_CHUNK_LENGTH_OFFSET = 0;\nconst PNG_CHUNK_TYPE_OFFSET = PNG_CHUNK_LENGTH_SIZE;\nconst PNG_CHUNK_DATA_OFFSET = PNG_CHUNK_LENGTH_SIZE + PNG_CHUNK_TYPE_SIZE;\nconst PNG_XMP_PREFIX = 'XML:com.adobe.xmp\\x00';\n\nfunction isPngFile(dataView) {\n return getStringFromDataView(dataView, 0, PNG_ID.length) === PNG_ID;\n}\n\nfunction findPngOffsets(dataView) {\n const PNG_CRC_SIZE = 4;\n\n const offsets = {\n hasAppMarkers: false\n };\n\n let offset = PNG_ID.length;\n\n while (offset + PNG_CHUNK_LENGTH_SIZE + PNG_CHUNK_TYPE_SIZE <= dataView.byteLength) {\n if (Constants.USE_PNG_FILE && isPngImageHeaderChunk(dataView, offset)) {\n offsets.hasAppMarkers = true;\n offsets.pngHeaderOffset = offset + PNG_CHUNK_DATA_OFFSET;\n } else if (Constants.USE_XMP && isPngXmpChunk(dataView, offset)) {\n const dataOffset = getPngXmpDataOffset(dataView, offset);\n if (dataOffset !== undefined) {\n offsets.hasAppMarkers = true;\n offsets.xmpChunks = [{\n dataOffset,\n length: dataView.getUint32(offset + PNG_CHUNK_LENGTH_OFFSET) - (dataOffset - (offset + PNG_CHUNK_DATA_OFFSET))\n }];\n }\n }\n\n offset += dataView.getUint32(offset + PNG_CHUNK_LENGTH_OFFSET)\n + PNG_CHUNK_LENGTH_SIZE\n + PNG_CHUNK_TYPE_SIZE\n + PNG_CRC_SIZE;\n }\n\n return offsets;\n}\n\nfunction isPngImageHeaderChunk(dataView, offset) {\n const PNG_CHUNK_TYPE_IMAGE_HEADER = 'IHDR';\n return getStringFromDataView(dataView, offset + PNG_CHUNK_TYPE_OFFSET, PNG_CHUNK_TYPE_SIZE) === PNG_CHUNK_TYPE_IMAGE_HEADER;\n}\n\nfunction isPngXmpChunk(dataView, offset) {\n const PNG_CHUNK_TYPE_INTERNATIONAL_TEXT = 'iTXt';\n return (getStringFromDataView(dataView, offset + PNG_CHUNK_TYPE_OFFSET, PNG_CHUNK_TYPE_SIZE) === PNG_CHUNK_TYPE_INTERNATIONAL_TEXT)\n && (getStringFromDataView(dataView, offset + PNG_CHUNK_DATA_OFFSET, PNG_XMP_PREFIX.length) === PNG_XMP_PREFIX);\n}\n\nfunction getPngXmpDataOffset(dataView, offset) {\n const COMPRESSION_FLAG_SIZE = 1;\n const COMPRESSION_METHOD_SIZE = 1;\n\n offset += PNG_CHUNK_DATA_OFFSET + PNG_XMP_PREFIX.length + COMPRESSION_FLAG_SIZE + COMPRESSION_METHOD_SIZE;\n\n let numberOfNullSeparators = 0;\n while (numberOfNullSeparators < 2 && offset < dataView.byteLength) {\n if (dataView.getUint8(offset) === 0x00) {\n numberOfNullSeparators++;\n }\n offset++;\n }\n if (numberOfNullSeparators < 2) {\n return undefined;\n }\n return offset;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringFromDataView} from './utils.js';\nimport Constants from './constants.js';\n\nexport default {\n isHeicFile,\n findHeicOffsets\n};\n\nfunction isHeicFile(dataView) {\n const HEIC_ID = 'ftyp';\n const HEIC_ID_OFFSET = 4;\n const HEIC_MAJOR_BRANDS = ['heic', 'heix', 'hevc', 'hevx', 'heim', 'heis', 'hevm', 'hevs', 'mif1'];\n const HEIC_MAJOR_BRAND_LENGTH = 4;\n\n const heicMajorBrand = getStringFromDataView(dataView, HEIC_ID_OFFSET + HEIC_ID.length, HEIC_MAJOR_BRAND_LENGTH);\n\n return (getStringFromDataView(dataView, HEIC_ID_OFFSET, HEIC_ID.length) === HEIC_ID)\n && (HEIC_MAJOR_BRANDS.indexOf(heicMajorBrand) !== -1);\n}\n\nfunction findHeicOffsets(dataView) {\n if (Constants.USE_EXIF || Constants.USE_ICC) {\n const {offset: metaOffset, length: metaLength} = findMetaAtom(dataView);\n if (metaOffset === undefined) {\n return {hasAppMarkers: false};\n }\n\n const metaEndOffset = Math.min(metaOffset + metaLength, dataView.byteLength);\n const {exifItemOffset, ilocOffset, colrOffset} = findMetaItems(dataView, metaOffset, metaEndOffset);\n\n const exifOffset = findExifOffset(dataView, exifItemOffset, ilocOffset, metaEndOffset);\n const iccChunks = findIccChunks(dataView, colrOffset, metaEndOffset);\n return {\n hasAppMarkers: (exifOffset !== undefined) || (iccChunks !== undefined),\n tiffHeaderOffset: exifOffset,\n iccChunks\n };\n }\n\n return {hasAppMarkers: false};\n}\n\nfunction findMetaAtom(dataView) {\n const ATOM_LENGTH_SIZE = 4;\n const ATOM_TYPE_SIZE = 4;\n const ATOM_MIN_LENGTH = 8;\n const ATOM_TYPE_OFFSET = 4;\n\n let offset = 0;\n\n while (offset + ATOM_LENGTH_SIZE + ATOM_TYPE_SIZE <= dataView.byteLength) {\n const atomLength = getAtomLength(dataView, offset);\n if (atomLength >= ATOM_MIN_LENGTH) {\n const atomType = getStringFromDataView(dataView, offset + ATOM_TYPE_OFFSET, ATOM_TYPE_SIZE);\n if (atomType === 'meta') {\n return {\n offset,\n length: atomLength\n };\n }\n }\n\n offset += atomLength;\n }\n\n return {\n offset: undefined,\n length: 0\n };\n}\n\nfunction getAtomLength(dataView, offset) {\n const ATOM_EXTENDED_SIZE_LOW_OFFSET = 12;\n\n const atomLength = dataView.getUint32(offset);\n if (extendsToEndOfFile(atomLength)) {\n return dataView.byteLength - offset;\n }\n if (hasExtendedSize(atomLength)) {\n if (hasEmptyHighBits(dataView, offset)) {\n // It's a bit tricky to handle 64 bit numbers in JavaScript. Let's\n // wait until there are real-world examples where it is necessary.\n return dataView.getUint32(offset + ATOM_EXTENDED_SIZE_LOW_OFFSET);\n }\n }\n\n return atomLength;\n}\n\nfunction extendsToEndOfFile(atomLength) {\n return atomLength === 0;\n}\n\nfunction hasExtendedSize(atomLength) {\n return atomLength === 1;\n}\n\nfunction hasEmptyHighBits(dataView, offset) {\n const ATOM_EXTENDED_SIZE_OFFSET = 8;\n return dataView.getUint32(offset + ATOM_EXTENDED_SIZE_OFFSET) === 0;\n}\n\nfunction findMetaItems(dataView, offset, metaEndOffset) {\n const STRING_SIZE = 4;\n const ITEM_INDEX_REL_OFFSET = -4;\n const offsets = {\n ilocOffset: undefined,\n exifItemOffset: undefined,\n colrOffset: undefined\n };\n\n while ((offset + STRING_SIZE <= metaEndOffset)\n && (!offsets.ilocOffset || !offsets.exifItemOffset || !offsets.colrOffset)) {\n const itemName = getStringFromDataView(dataView, offset, STRING_SIZE);\n if (Constants.USE_EXIF && (itemName === 'iloc')) {\n offsets.ilocOffset = offset;\n } else if (Constants.USE_EXIF && (itemName === 'Exif')) {\n offsets.exifItemOffset = offset + ITEM_INDEX_REL_OFFSET;\n } else if (Constants.USE_ICC && (itemName === 'colr')) {\n offsets.colrOffset = offset + ITEM_INDEX_REL_OFFSET;\n }\n\n offset++;\n }\n\n return offsets;\n}\n\nfunction findExifOffset(dataView, exifItemOffset, offset, metaEndOffset) {\n const EXIF_ITEM_OFFSET_SIZE = 2;\n const ILOC_DATA_OFFSET = 12;\n const EXIF_POINTER_OFFSET = 8;\n const EXIF_POINTER_SIZE = 4;\n const EXIF_PREFIX_LENGTH_OFFSET = 4;\n const ILOC_ITEM_SIZE = 16;\n\n if (!offset || !exifItemOffset || (exifItemOffset + EXIF_ITEM_OFFSET_SIZE > metaEndOffset)) {\n return undefined;\n }\n\n const exifItemIndex = dataView.getUint16(exifItemOffset);\n offset += ILOC_DATA_OFFSET;\n\n while (offset + ILOC_ITEM_SIZE <= metaEndOffset) {\n const itemIndex = dataView.getUint16(offset);\n if (itemIndex === exifItemIndex) {\n const exifPointer = dataView.getUint32(offset + EXIF_POINTER_OFFSET);\n if (exifPointer + EXIF_POINTER_SIZE <= dataView.byteLength) {\n const exifOffset = dataView.getUint32(exifPointer);\n const prefixLength = exifOffset + EXIF_PREFIX_LENGTH_OFFSET;\n return exifPointer + prefixLength;\n }\n }\n offset += ILOC_ITEM_SIZE;\n }\n\n return undefined;\n}\n\nfunction findIccChunks(dataView, offset, metaEndOffset) {\n const ITEM_TYPE_OFFSET = 8;\n const ITEM_TYPE_SIZE = 4;\n const ITEM_CONTENT_OFFSET = 12;\n\n if (!offset || (offset + ITEM_CONTENT_OFFSET > metaEndOffset)) {\n return undefined;\n }\n\n const colorType = getStringFromDataView(dataView, offset + ITEM_TYPE_OFFSET, ITEM_TYPE_SIZE);\n if ((colorType !== 'prof') && (colorType !== 'rICC')) {\n return undefined;\n }\n\n return [{\n offset: offset + ITEM_CONTENT_OFFSET,\n length: getAtomLength(dataView, offset) - ITEM_CONTENT_OFFSET,\n chunkNumber: 1,\n chunksTotal: 1\n }];\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringFromDataView} from './utils.js';\nimport Constants from './constants.js';\n\nexport default {\n isWebpFile,\n findOffsets\n};\n\nfunction isWebpFile(dataView) {\n const RIFF_ID_OFFSET = 0;\n const RIFF_ID = 'RIFF';\n const WEBP_MARKER_OFFSET = 8;\n const WEBP_MARKER = 'WEBP';\n\n return getStringFromDataView(dataView, RIFF_ID_OFFSET, RIFF_ID.length) === RIFF_ID\n && getStringFromDataView(dataView, WEBP_MARKER_OFFSET, WEBP_MARKER.length) === WEBP_MARKER;\n}\n\nfunction findOffsets(dataView) {\n const SUB_CHUNK_START_OFFSET = 12;\n const CHUNK_SIZE_OFFSET = 4;\n const EXIF_IDENTIFIER = 'Exif\\x00\\x00';\n const CHUNK_HEADER_SIZE = 8;\n\n let offset = SUB_CHUNK_START_OFFSET;\n let hasAppMarkers = false;\n let tiffHeaderOffset;\n let xmpChunks;\n let iccChunks;\n\n while (offset + CHUNK_HEADER_SIZE < dataView.byteLength) {\n const chunkId = getStringFromDataView(dataView, offset, 4);\n const chunkSize = dataView.getUint32(offset + CHUNK_SIZE_OFFSET, true);\n\n if (Constants.USE_EXIF && (chunkId === 'EXIF')) {\n hasAppMarkers = true;\n if (getStringFromDataView(dataView, offset + CHUNK_HEADER_SIZE, EXIF_IDENTIFIER.length) === EXIF_IDENTIFIER) {\n tiffHeaderOffset = offset + CHUNK_HEADER_SIZE + EXIF_IDENTIFIER.length;\n } else {\n tiffHeaderOffset = offset + CHUNK_HEADER_SIZE;\n }\n } else if (Constants.USE_XMP && (chunkId === 'XMP ')) {\n hasAppMarkers = true;\n xmpChunks = [{\n dataOffset: offset + CHUNK_HEADER_SIZE,\n length: chunkSize\n }];\n } else if (Constants.USE_ICC && (chunkId === 'ICCP')) {\n hasAppMarkers = true;\n iccChunks = [{\n offset: offset + CHUNK_HEADER_SIZE,\n length: chunkSize,\n chunkNumber: 1,\n chunksTotal: 1\n }];\n }\n\n offset += CHUNK_HEADER_SIZE + (chunkSize % 2 === 0 ? chunkSize : chunkSize + 1);\n }\n\n return {\n hasAppMarkers,\n tiffHeaderOffset,\n xmpChunks,\n iccChunks\n };\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport Constants from './constants.js';\nimport Tiff from './image-header-tiff.js';\nimport Jpeg from './image-header-jpeg.js';\nimport Png from './image-header-png.js';\nimport Heic from './image-header-heic.js';\nimport Webp from './image-header-webp.js';\n\nexport default {\n parseAppMarkers\n};\n\nfunction parseAppMarkers(dataView) {\n if (Constants.USE_TIFF && Tiff.isTiffFile(dataView)) {\n return Tiff.findTiffOffsets();\n }\n\n if (Constants.USE_JPEG && Jpeg.isJpegFile(dataView)) {\n return Jpeg.findJpegOffsets(dataView);\n }\n\n if (Constants.USE_PNG && Png.isPngFile(dataView)) {\n return Png.findPngOffsets(dataView);\n }\n\n if (Constants.USE_HEIC && Heic.isHeicFile(dataView)) {\n return Heic.findHeicOffsets(dataView);\n }\n\n if (Constants.USE_WEBP && Webp.isWebpFile(dataView)) {\n return Webp.findOffsets(dataView);\n }\n\n throw new Error('Invalid image format');\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport ByteOrder from './byte-order.js';\nimport Constants from './constants.js';\n\nexport default {\n isTiffFile,\n findTiffOffsets\n};\n\nfunction isTiffFile(dataView) {\n const MIN_TIFF_DATA_BUFFER_LENGTH = 4;\n\n return (dataView.byteLength >= MIN_TIFF_DATA_BUFFER_LENGTH) && hasTiffMarker(dataView);\n}\n\nfunction hasTiffMarker(dataView) {\n const TIFF_ID = 0x2a;\n const TIFF_ID_OFFSET = 2;\n\n const littleEndian = dataView.getUint16(0) === ByteOrder.LITTLE_ENDIAN;\n return dataView.getUint16(TIFF_ID_OFFSET, littleEndian) === TIFF_ID;\n}\n\nfunction findTiffOffsets() {\n const TIFF_FILE_HEADER_OFFSET = 0;\n\n if (Constants.USE_EXIF) {\n return {\n hasAppMarkers: true,\n tiffHeaderOffset: TIFF_FILE_HEADER_OFFSET\n };\n }\n return {};\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport ByteOrder from './byte-order.js';\n\nconst typeSizes = {\n 1: 1, // BYTE\n 2: 1, // ASCII\n 3: 2, // SHORT\n 4: 4, // LONG\n 5: 8, // RATIONAL\n 7: 1, // UNDEFINED\n 9: 4, // SLONG\n 10: 8, // SRATIONAL\n 13: 4 // IFD\n};\n\nconst tagTypes = {\n 'BYTE': 1,\n 'ASCII': 2,\n 'SHORT': 3,\n 'LONG': 4,\n 'RATIONAL': 5,\n 'UNDEFINED': 7,\n 'SLONG': 9,\n 'SRATIONAL': 10,\n 'IFD': 13\n};\n\nexport default {\n getAsciiValue,\n getByteAt,\n getAsciiAt,\n getShortAt,\n getLongAt,\n getRationalAt,\n getUndefinedAt,\n getSlongAt,\n getSrationalAt,\n getIfdPointerAt,\n typeSizes,\n tagTypes,\n getTypeSize\n};\n\nfunction getAsciiValue(charArray) {\n return charArray.map((charCode) => String.fromCharCode(charCode));\n}\n\nfunction getByteAt(dataView, offset) {\n return dataView.getUint8(offset);\n}\n\nfunction getAsciiAt(dataView, offset) {\n return dataView.getUint8(offset);\n}\n\nfunction getShortAt(dataView, offset, byteOrder) {\n return dataView.getUint16(offset, byteOrder === ByteOrder.LITTLE_ENDIAN);\n}\n\nfunction getLongAt(dataView, offset, byteOrder) {\n return dataView.getUint32(offset, byteOrder === ByteOrder.LITTLE_ENDIAN);\n}\n\nfunction getRationalAt(dataView, offset, byteOrder) {\n return [getLongAt(dataView, offset, byteOrder), getLongAt(dataView, offset + 4, byteOrder)];\n}\n\nfunction getUndefinedAt(dataView, offset) {\n return getByteAt(dataView, offset);\n}\n\nfunction getSlongAt(dataView, offset, byteOrder) {\n return dataView.getInt32(offset, byteOrder === ByteOrder.LITTLE_ENDIAN);\n}\n\nfunction getSrationalAt(dataView, offset, byteOrder) {\n return [getSlongAt(dataView, offset, byteOrder), getSlongAt(dataView, offset + 4, byteOrder)];\n}\n\nfunction getIfdPointerAt(dataView, offset, byteOrder) {\n return getLongAt(dataView, offset, byteOrder);\n}\n\nfunction getTypeSize(typeName) {\n if (tagTypes[typeName] === undefined) {\n throw new Error('No such type found.');\n }\n\n return typeSizes[tagTypes[typeName]];\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nexport default {\n 'LightSource': (value) => {\n if (value === 1) {\n return 'Daylight';\n } else if (value === 2) {\n return 'Fluorescent';\n } else if (value === 3) {\n return 'Tungsten (incandescent light)';\n } else if (value === 4) {\n return 'Flash';\n } else if (value === 9) {\n return 'Fine weather';\n } else if (value === 10) {\n return 'Cloudy weather';\n } else if (value === 11) {\n return 'Shade';\n } else if (value === 12) {\n return 'Daylight fluorescent (D 5700 – 7100K)';\n } else if (value === 13) {\n return 'Day white fluorescent (N 4600 – 5400K)';\n } else if (value === 14) {\n return 'Cool white fluorescent (W 3900 – 4500K)';\n } else if (value === 15) {\n return 'White fluorescent (WW 3200 – 3700K)';\n } else if (value === 17) {\n return 'Standard light A';\n } else if (value === 18) {\n return 'Standard light B';\n } else if (value === 19) {\n return 'Standard light C';\n } else if (value === 20) {\n return 'D55';\n } else if (value === 21) {\n return 'D65';\n } else if (value === 22) {\n return 'D75';\n } else if (value === 23) {\n return 'D50';\n } else if (value === 24) {\n return 'ISO studio tungsten';\n } else if (value === 255) {\n return 'Other light source';\n }\n return 'Unknown';\n }\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getEncodedString, getCalculatedGpsValue} from './tag-names-utils.js';\n\nexport default {\n 0x0000: {\n 'name': 'GPSVersionID',\n 'description': (value) => {\n if (value[0] === 2 && value[1] === 2 && value[2] === 0 && value[3] === 0) {\n return 'Version 2.2';\n }\n return 'Unknown';\n }\n },\n 0x0001: {\n 'name': 'GPSLatitudeRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'N') {\n return 'North latitude';\n } else if (ref === 'S') {\n return 'South latitude';\n }\n return 'Unknown';\n }\n },\n 0x0002: {\n 'name': 'GPSLatitude',\n 'description': getCalculatedGpsValue\n },\n 0x0003: {\n 'name': 'GPSLongitudeRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'E') {\n return 'East longitude';\n } else if (ref === 'W') {\n return 'West longitude';\n }\n return 'Unknown';\n }\n },\n 0x0004: {\n 'name': 'GPSLongitude',\n 'description': getCalculatedGpsValue\n },\n 0x0005: {\n 'name': 'GPSAltitudeRef',\n 'description': (value) => {\n if (value === 0) {\n return 'Sea level';\n } else if (value === 1) {\n return 'Sea level reference (negative value)';\n }\n return 'Unknown';\n }\n },\n 0x0006: {\n 'name': 'GPSAltitude',\n 'description': (value) => {\n return (value[0] / value[1]) + ' m';\n }\n },\n 0x0007: {\n 'name': 'GPSTimeStamp',\n 'description': (values) => {\n return values.map(([numerator, denominator]) => {\n const num = numerator / denominator;\n if (/^\\d(\\.|$)/.test(`${num}`)) {\n return `0${num}`;\n }\n return num;\n }).join(':');\n }\n },\n 0x0008: 'GPSSatellites',\n 0x0009: {\n 'name': 'GPSStatus',\n 'description': (value) => {\n const status = value.join('');\n if (status === 'A') {\n return 'Measurement in progress';\n } else if (status === 'V') {\n return 'Measurement Interoperability';\n }\n return 'Unknown';\n }\n },\n 0x000a: {\n 'name': 'GPSMeasureMode',\n 'description': (value) => {\n const mode = value.join('');\n if (mode === '2') {\n return '2-dimensional measurement';\n } else if (mode === '3') {\n return '3-dimensional measurement';\n }\n return 'Unknown';\n }\n },\n 0x000b: 'GPSDOP',\n 0x000c: {\n 'name': 'GPSSpeedRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'K') {\n return 'Kilometers per hour';\n } else if (ref === 'M') {\n return 'Miles per hour';\n } else if (ref === 'N') {\n return 'Knots';\n }\n return 'Unknown';\n }\n },\n 0x000d: 'GPSSpeed',\n 0x000e: {\n 'name': 'GPSTrackRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'T') {\n return 'True direction';\n } else if (ref === 'M') {\n return 'Magnetic direction';\n }\n return 'Unknown';\n }\n },\n 0x000f: 'GPSTrack',\n 0x0010: {\n 'name': 'GPSImgDirectionRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'T') {\n return 'True direction';\n } else if (ref === 'M') {\n return 'Magnetic direction';\n }\n return 'Unknown';\n }\n },\n 0x0011: 'GPSImgDirection',\n 0x0012: 'GPSMapDatum',\n 0x0013: {\n 'name': 'GPSDestLatitudeRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'N') {\n return 'North latitude';\n } else if (ref === 'S') {\n return 'South latitude';\n }\n return 'Unknown';\n }\n },\n 0x0014: {\n 'name': 'GPSDestLatitude',\n 'description': (value) => {\n return (value[0][0] / value[0][1]) + (value[1][0] / value[1][1]) / 60 + (value[2][0] / value[2][1]) / 3600;\n }\n },\n 0x0015: {\n 'name': 'GPSDestLongitudeRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'E') {\n return 'East longitude';\n } else if (ref === 'W') {\n return 'West longitude';\n }\n return 'Unknown';\n }\n },\n 0x0016: {\n 'name': 'GPSDestLongitude',\n 'description': (value) => {\n return (value[0][0] / value[0][1]) + (value[1][0] / value[1][1]) / 60 + (value[2][0] / value[2][1]) / 3600;\n }\n },\n 0x0017: {\n 'name': 'GPSDestBearingRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'T') {\n return 'True direction';\n } else if (ref === 'M') {\n return 'Magnetic direction';\n }\n return 'Unknown';\n }\n },\n 0x0018: 'GPSDestBearing',\n 0x0019: {\n 'name': 'GPSDestDistanceRef',\n 'description': (value) => {\n const ref = value.join('');\n if (ref === 'K') {\n return 'Kilometers';\n } else if (ref === 'M') {\n return 'Miles';\n } else if (ref === 'N') {\n return 'Knots';\n }\n return 'Unknown';\n }\n },\n 0x001a: 'GPSDestDistance',\n 0x001b: {\n 'name': 'GPSProcessingMethod',\n 'description': getEncodedString\n },\n 0x001c: {\n 'name': 'GPSAreaInformation',\n 'description': getEncodedString\n },\n 0x001d: 'GPSDateStamp',\n 0x001e: {\n 'name': 'GPSDifferential',\n 'description': (value) => {\n if (value === 0) {\n return 'Measurement without differential correction';\n } else if (value === 1) {\n return 'Differential correction applied';\n }\n return 'Unknown';\n }\n },\n 0x001f: 'GPSHPositioningError'\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringValue} from './tag-names-utils.js';\n\nexport default {\n 0x0001: 'InteroperabilityIndex',\n 0x0002: {\n name: 'InteroperabilityVersion',\n description: (value) => getStringValue(value)\n },\n 0x1000: 'RelatedImageFileFormat',\n 0x1001: 'RelatedImageWidth',\n 0x1002: 'RelatedImageHeight'\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringValue} from './tag-names-utils.js';\n\nexport default {\n 0xb000: {\n 'name': 'MPFVersion',\n 'description': (value) => getStringValue(value)\n },\n 0xb001: 'NumberOfImages',\n 0xb002: 'MPEntry',\n 0xb003: 'ImageUIDList',\n 0xb004: 'TotalFrames'\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {objectAssign} from './utils.js';\nimport Constants from './constants.js';\nimport TagNames0thIfd from './tag-names-0th-ifd.js';\nimport TagNamesExifIfd from './tag-names-exif-ifd.js';\nimport TagNamesGpsIfd from './tag-names-gps-ifd.js';\nimport TagNamesInteroperabilityIfd from './tag-names-interoperability-ifd.js';\nimport TagNamesMpfIfd from './tag-names-mpf-ifd.js';\n\nconst tagNames0thExifIfds = objectAssign({}, TagNames0thIfd, TagNamesExifIfd);\n\nexport default {\n '0th': tagNames0thExifIfds,\n 'exif': tagNames0thExifIfds,\n 'gps': TagNamesGpsIfd,\n 'interoperability': TagNamesInteroperabilityIfd,\n 'mpf': Constants.USE_MPF ? TagNamesMpfIfd : {},\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport TagNamesCommon from './tag-names-common.js';\n\nexport default {\n 0x000b: 'ProcessingSoftware',\n 0x00fe: {\n name: 'SubfileType',\n description: (value) => ({\n 0x0: 'Full-resolution image',\n 0x1: 'Reduced-resolution image',\n 0x2: 'Single page of multi-page image',\n 0x3: 'Single page of multi-page reduced-resolution image',\n 0x4: 'Transparency mask',\n 0x5: 'Transparency mask of reduced-resolution image',\n 0x6: 'Transparency mask of multi-page image',\n 0x7: 'Transparency mask of reduced-resolution multi-page image',\n 0x10001: 'Alternate reduced-resolution image',\n 0xffffffff: 'Invalid'\n })[value] || 'Unknown'\n },\n 0x00ff: {\n name: 'OldSubfileType',\n description: (value) => ({\n 0: 'Full-resolution image',\n 1: 'Reduced-resolution image',\n 2: 'Single page of multi-page image'\n })[value] || 'Unknown'\n },\n 0x0100: 'ImageWidth',\n 0x0101: 'ImageLength',\n 0x0102: 'BitsPerSample',\n 0x0103: 'Compression',\n 0x0106: 'PhotometricInterpretation',\n 0x0107: {\n name: 'Thresholding',\n description: (value) => ({\n 1: 'No dithering or halftoning',\n 2: 'Ordered dither or halfton',\n 3: 'Randomized dither'\n })[value] || 'Unknown'\n },\n 0x0108: 'CellWidth',\n 0x0109: 'CellLength',\n 0x010a: {\n name: 'FillOrder',\n description: (value) => ({\n 1: 'Normal',\n 2: 'Reversed'\n })[value] || 'Unknown'\n },\n 0x010d: 'DocumentName',\n 0x010e: 'ImageDescription',\n 0x010f: 'Make',\n 0x0110: 'Model',\n 0x0111: 'StripOffsets',\n 0x0112: {\n name: 'Orientation',\n description: (value) => {\n if (value === 1) {\n return 'top-left';\n }\n if (value === 2) {\n return 'top-right';\n }\n if (value === 3) {\n return 'bottom-right';\n }\n if (value === 4) {\n return 'bottom-left';\n }\n if (value === 5) {\n return 'left-top';\n }\n if (value === 6) {\n return 'right-top';\n }\n if (value === 7) {\n return 'right-bottom';\n }\n if (value === 8) {\n return 'left-bottom';\n }\n return 'Undefined';\n }\n },\n 0x0115: 'SamplesPerPixel',\n 0x0116: 'RowsPerStrip',\n 0x0117: 'StripByteCounts',\n 0x0118: 'MinSampleValue',\n 0x0119: 'MaxSampleValue',\n 0x011a: {\n 'name': 'XResolution',\n 'description': (value) => {\n return '' + Math.round(value[0] / value[1]);\n }\n },\n 0x011b: {\n 'name': 'YResolution',\n 'description': (value) => {\n return '' + Math.round(value[0] / value[1]);\n }\n },\n 0x011c: 'PlanarConfiguration',\n 0x011d: 'PageName',\n 0x011e: {\n 'name': 'XPosition',\n 'description': (value) => {\n return '' + Math.round(value[0] / value[1]);\n }\n },\n 0x011f: {\n 'name': 'YPosition',\n 'description': (value) => {\n return '' + Math.round(value[0] / value[1]);\n }\n },\n 0x0122: {\n name: 'GrayResponseUnit',\n description: (value) => ({\n 1: '0.1',\n 2: '0.001',\n 3: '0.0001',\n 4: '1e-05',\n 5: '1e-06'\n })[value] || 'Unknown'\n },\n 0x0128: {\n name: 'ResolutionUnit',\n description: (value) => {\n if (value === 2) {\n return 'inches';\n }\n if (value === 3) {\n return 'centimeters';\n }\n return 'Unknown';\n }\n },\n 0x0129: 'PageNumber',\n 0x012d: 'TransferFunction',\n 0x0131: 'Software',\n 0x0132: 'DateTime',\n 0x013b: 'Artist',\n 0x013c: 'HostComputer',\n 0x013d: 'Predictor',\n 0x013e: {\n 'name': 'WhitePoint',\n 'description': (values) => {\n return values.map((value) => `${value[0]}/${value[1]}`).join(', ');\n }\n },\n 0x013f: {\n 'name': 'PrimaryChromaticities',\n 'description': (values) => {\n return values.map((value) => `${value[0]}/${value[1]}`).join(', ');\n }\n },\n 0x0141: 'HalftoneHints',\n 0x0142: 'TileWidth',\n 0x0143: 'TileLength',\n 0x014a: 'A100DataOffset',\n 0x014c: {\n name: 'InkSet',\n description: (value) => ({\n 1: 'CMYK',\n 2: 'Not CMYK'\n })[value] || 'Unknown'\n },\n 0x0151: 'TargetPrinter',\n 0x0152: {\n name: 'ExtraSamples',\n description: (value) => ({\n 0: 'Unspecified',\n 1: 'Associated Alpha',\n 2: 'Unassociated Alpha',\n })[value] || 'Unknown'\n },\n 0x0153: {\n name: 'SampleFormat',\n description: (value) => {\n const formats = {\n 1: 'Unsigned',\n 2: 'Signed',\n 3: 'Float',\n 4: 'Undefined',\n 5: 'Complex int',\n 6: 'Complex float',\n };\n if (!Array.isArray(value)) {\n return 'Unknown';\n }\n return value.map((sample) => formats[sample] || 'Unknown').join(', ');\n }\n },\n 0x0201: 'JPEGInterchangeFormat',\n 0x0202: 'JPEGInterchangeFormatLength',\n 0x0211: {\n 'name': 'YCbCrCoefficients',\n 'description': (values) => {\n return values.map((value) => '' + value[0] / value[1]).join('/');\n }\n },\n 0x0212: 'YCbCrSubSampling',\n 0x0213: {\n name: 'YCbCrPositioning',\n description: (value) => {\n if (value === 1) {\n return 'centered';\n }\n if (value === 2) {\n return 'co-sited';\n }\n return 'undefined ' + value;\n }\n },\n 0x0214: {\n 'name': 'ReferenceBlackWhite',\n 'description': (values) => {\n return values.map((value) => '' + value[0] / value[1]).join(', ');\n }\n },\n 0x02bc: 'ApplicationNotes',\n 0x4746: 'Rating',\n 0x4749: 'RatingPercent',\n 0x8298: {\n name: 'Copyright',\n description: (value) => value.join('; ')\n },\n 0x830e: 'PixelScale',\n 0x83bb: 'IPTC-NAA',\n 0x8480: 'IntergraphMatrix',\n 0x8482: 'ModelTiePoint',\n 0x8546: 'SEMInfo',\n 0x85d8: 'ModelTransform',\n 0x8649: 'PhotoshopSettings',\n 0x8769: 'Exif IFD Pointer',\n 0x8773: 'ICC_Profile',\n 0x87af: 'GeoTiffDirectory',\n 0x87b0: 'GeoTiffDoubleParams',\n 0x87b1: 'GeoTiffAsciiParams',\n 0x8825: 'GPS Info IFD Pointer',\n 0x9c9b: 'XPTitle',\n 0x9c9c: 'XPComment',\n 0x9c9d: 'XPAuthor',\n 0x9c9e: 'XPKeywords',\n 0x9c9f: 'XPSubject',\n 0xa480: 'GDALMetadata',\n 0xa481: 'GDALNoData',\n 0xc4a5: 'PrintIM',\n 0xc613: 'DNGBackwardVersion',\n 0xc614: 'UniqueCameraModel',\n 0xc615: 'LocalizedCameraModel',\n 0xc621: 'ColorMatrix1',\n 0xc622: 'ColorMatrix2',\n 0xc623: 'CameraCalibration1',\n 0xc624: 'CameraCalibration2',\n 0xc625: 'ReductionMatrix1',\n 0xc626: 'ReductionMatrix2',\n 0xc627: 'AnalogBalance',\n 0xc628: 'AsShotNeutral',\n 0xc629: 'AsShotWhiteXY',\n 0xc62a: 'BaselineExposure',\n 0xc62b: 'BaselineNoise',\n 0xc62c: 'BaselineSharpness',\n 0xc62e: 'LinearResponseLimit',\n 0xc62f: 'CameraSerialNumber',\n 0xc630: 'DNGLensInfo',\n 0xc633: 'ShadowScale',\n 0xc635: {\n name: 'MakerNoteSafety',\n description: (value) => ({\n 0: 'Unsafe',\n 1: 'Safe'\n })[value] || 'Unknown'\n },\n 0xc65a: {\n name: 'CalibrationIlluminant1',\n description: TagNamesCommon['LightSource']\n },\n 0xc65b: {\n name: 'CalibrationIlluminant2',\n description: TagNamesCommon['LightSource']\n },\n 0xc65d: 'RawDataUniqueID',\n 0xc68b: 'OriginalRawFileName',\n 0xc68c: 'OriginalRawFileData',\n 0xc68f: 'AsShotICCProfile',\n 0xc690: 'AsShotPreProfileMatrix',\n 0xc691: 'CurrentICCProfile',\n 0xc692: 'CurrentPreProfileMatrix',\n 0xc6bf: 'ColorimetricReference',\n 0xc6c5: 'SRawType',\n 0xc6d2: 'PanasonicTitle',\n 0xc6d3: 'PanasonicTitle2',\n 0xc6f3: 'CameraCalibrationSig',\n 0xc6f4: 'ProfileCalibrationSig',\n 0xc6f5: 'ProfileIFD',\n 0xc6f6: 'AsShotProfileName',\n 0xc6f8: 'ProfileName',\n 0xc6f9: 'ProfileHueSatMapDims',\n 0xc6fa: 'ProfileHueSatMapData1',\n 0xc6fb: 'ProfileHueSatMapData2',\n 0xc6fc: 'ProfileToneCurve',\n 0xc6fd: {\n name: 'ProfileEmbedPolicy',\n description: (value) => ({\n 0: 'Allow Copying',\n 1: 'Embed if Used',\n 2: 'Never Embed',\n 3: 'No Restrictions'\n })[value] || 'Unknown'\n },\n 0xc6fe: 'ProfileCopyright',\n 0xc714: 'ForwardMatrix1',\n 0xc715: 'ForwardMatrix2',\n 0xc716: 'PreviewApplicationName',\n 0xc717: 'PreviewApplicationVersion',\n 0xc718: 'PreviewSettingsName',\n 0xc719: 'PreviewSettingsDigest',\n 0xc71a: {\n name: 'PreviewColorSpace',\n description: (value) => ({\n 1: 'Gray Gamma 2.2',\n 2: 'sRGB',\n 3: 'Adobe RGB',\n 4: 'ProPhoto RGB'\n })[value] || 'Unknown'\n },\n 0xc71b: 'PreviewDateTime',\n 0xc71c: 'RawImageDigest',\n 0xc71d: 'OriginalRawFileDigest',\n 0xc725: 'ProfileLookTableDims',\n 0xc726: 'ProfileLookTableData',\n 0xc763: 'TimeCodes',\n 0xc764: 'FrameRate',\n 0xc772: 'TStop',\n 0xc789: 'ReelName',\n 0xc791: 'OriginalDefaultFinalSize',\n 0xc792: 'OriginalBestQualitySize',\n 0xc793: 'OriginalDefaultCropSize',\n 0xc7a1: 'CameraLabel',\n 0xc7a3: {\n name: 'ProfileHueSatMapEncoding',\n description: (value) => ({\n 0: 'Linear',\n 1: 'sRGB'\n })[value] || 'Unknown'\n },\n 0xc7a4: {\n name: 'ProfileLookTableEncoding',\n description: (value) => ({\n 0: 'Linear',\n 1: 'sRGB'\n })[value] || 'Unknown'\n },\n 0xc7a5: 'BaselineExposureOffset',\n 0xc7a6: {\n name: 'DefaultBlackRender',\n description: (value) => ({\n 0: 'Auto',\n 1: 'None'\n })[value] || 'Unknown'\n },\n 0xc7a7: 'NewRawImageDigest',\n 0xc7a8: 'RawToPreviewGain'\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringValue, getEncodedString} from './tag-names-utils.js';\nimport TagNamesCommon from './tag-names-common.js';\n\nexport default {\n 0x829a: {\n 'name': 'ExposureTime',\n 'description': (value) => {\n if (value[0] !== 0) {\n return `1/${Math.round(value[1] / value[0])}`;\n }\n return `0/${value[1]}`;\n }\n },\n 0x829d: {\n 'name': 'FNumber',\n 'description': (value) => `f/${value[0] / value[1]}`\n },\n 0x8822: {\n 'name': 'ExposureProgram',\n 'description': (value) => {\n if (value === 0) {\n return 'Undefined';\n } else if (value === 1) {\n return 'Manual';\n } else if (value === 2) {\n return 'Normal program';\n } else if (value === 3) {\n return 'Aperture priority';\n } else if (value === 4) {\n return 'Shutter priority';\n } else if (value === 5) {\n return 'Creative program';\n } else if (value === 6) {\n return 'Action program';\n } else if (value === 7) {\n return 'Portrait mode';\n } else if (value === 8) {\n return 'Landscape mode';\n } else if (value === 9) {\n return 'Bulb';\n }\n return 'Unknown';\n }\n },\n 0x8824: 'SpectralSensitivity',\n 0x8827: 'ISOSpeedRatings',\n 0x8828: {\n 'name': 'OECF',\n 'description': () => '[Raw OECF table data]'\n },\n 0x882a: 'TimeZoneOffset',\n 0x882b: 'SelfTimerMode',\n 0x8830: {\n name: 'SensitivityType',\n description: (value) => ({\n 1: 'Standard Output Sensitivity',\n 2: 'Recommended Exposure Index',\n 3: 'ISO Speed',\n 4: 'Standard Output Sensitivity and Recommended Exposure Index',\n 5: 'Standard Output Sensitivity and ISO Speed',\n 6: 'Recommended Exposure Index and ISO Speed',\n 7: 'Standard Output Sensitivity, Recommended Exposure Index and ISO Speed'\n })[value] || 'Unknown'\n },\n 0x8831: 'StandardOutputSensitivity',\n 0x8832: 'RecommendedExposureIndex',\n 0x8833: 'ISOSpeed',\n 0x8834: 'ISOSpeedLatitudeyyy',\n 0x8835: 'ISOSpeedLatitudezzz',\n 0x9000: {\n 'name': 'ExifVersion',\n 'description': (value) => getStringValue(value)\n },\n 0x9003: 'DateTimeOriginal',\n 0x9004: 'DateTimeDigitized',\n 0x9009: 'GooglePlusUploadCode',\n 0x9010: 'OffsetTime',\n 0x9011: 'OffsetTimeOriginal',\n 0x9012: 'OffsetTimeDigitized',\n 0x9101: {\n 'name': 'ComponentsConfiguration',\n 'description': (value) => {\n return value.map((character) => {\n if (character === 0x31) {\n return 'Y';\n } else if (character === 0x32) {\n return 'Cb';\n } else if (character === 0x33) {\n return 'Cr';\n } else if (character === 0x34) {\n return 'R';\n } else if (character === 0x35) {\n return 'G';\n } else if (character === 0x36) {\n return 'B';\n }\n }).join('');\n }\n },\n 0x9102: 'CompressedBitsPerPixel',\n 0x9201: {\n 'name': 'ShutterSpeedValue',\n 'description': (value) => {\n return `1/${Math.round(Math.pow(2, value[0] / value[1]))}`;\n }\n },\n 0x9202: {\n 'name': 'ApertureValue',\n 'description': (value) => {\n return Math.pow(Math.sqrt(2), value[0] / value[1]).toFixed(2);\n }\n },\n 0x9203: 'BrightnessValue',\n 0x9204: 'ExposureBiasValue',\n 0x9205: {\n 'name': 'MaxApertureValue',\n 'description': (value) => {\n return Math.pow(Math.sqrt(2), value[0] / value[1]).toFixed(2);\n }\n },\n 0x9206: {\n 'name': 'SubjectDistance',\n 'description': (value) => (value[0] / value[1]) + ' m'\n },\n 0x9207: {\n 'name': 'MeteringMode',\n 'description': (value) => {\n if (value === 1) {\n return 'Average';\n } else if (value === 2) {\n return 'CenterWeightedAverage';\n } else if (value === 3) {\n return 'Spot';\n } else if (value === 4) {\n return 'MultiSpot';\n } else if (value === 5) {\n return 'Pattern';\n } else if (value === 6) {\n return 'Partial';\n } else if (value === 255) {\n return 'Other';\n }\n return 'Unknown';\n }\n },\n 0x9208: {\n 'name': 'LightSource',\n description: TagNamesCommon['LightSource']\n },\n 0x9209: {\n 'name': 'Flash',\n 'description': (value) => {\n if (value === 0x00) {\n return 'Flash did not fire';\n } else if (value === 0x01) {\n return 'Flash fired';\n } else if (value === 0x05) {\n return 'Strobe return light not detected';\n } else if (value === 0x07) {\n return 'Strobe return light detected';\n } else if (value === 0x09) {\n return 'Flash fired, compulsory flash mode';\n } else if (value === 0x0d) {\n return 'Flash fired, compulsory flash mode, return light not detected';\n } else if (value === 0x0f) {\n return 'Flash fired, compulsory flash mode, return light detected';\n } else if (value === 0x10) {\n return 'Flash did not fire, compulsory flash mode';\n } else if (value === 0x18) {\n return 'Flash did not fire, auto mode';\n } else if (value === 0x19) {\n return 'Flash fired, auto mode';\n } else if (value === 0x1d) {\n return 'Flash fired, auto mode, return light not detected';\n } else if (value === 0x1f) {\n return 'Flash fired, auto mode, return light detected';\n } else if (value === 0x20) {\n return 'No flash function';\n } else if (value === 0x41) {\n return 'Flash fired, red-eye reduction mode';\n } else if (value === 0x45) {\n return 'Flash fired, red-eye reduction mode, return light not detected';\n } else if (value === 0x47) {\n return 'Flash fired, red-eye reduction mode, return light detected';\n } else if (value === 0x49) {\n return 'Flash fired, compulsory flash mode, red-eye reduction mode';\n } else if (value === 0x4d) {\n return 'Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected';\n } else if (value === 0x4f) {\n return 'Flash fired, compulsory flash mode, red-eye reduction mode, return light detected';\n } else if (value === 0x59) {\n return 'Flash fired, auto mode, red-eye reduction mode';\n } else if (value === 0x5d) {\n return 'Flash fired, auto mode, return light not detected, red-eye reduction mode';\n } else if (value === 0x5f) {\n return 'Flash fired, auto mode, return light detected, red-eye reduction mode';\n }\n return 'Unknown';\n }\n },\n 0x920a: {\n 'name': 'FocalLength',\n 'description': (value) => (value[0] / value[1]) + ' mm'\n },\n 0x9211: 'ImageNumber',\n 0x9212: {\n name: 'SecurityClassification',\n description: (value) => ({\n 'C': 'Confidential',\n 'R': 'Restricted',\n 'S': 'Secret',\n 'T': 'Top Secret',\n 'U': 'Unclassified'\n })[value] || 'Unknown'\n },\n 0x9213: 'ImageHistory',\n 0x9214: {\n 'name': 'SubjectArea',\n 'description': (value) => {\n if (value.length === 2) {\n return `Location; X: ${value[0]}, Y: ${value[1]}`;\n } else if (value.length === 3) {\n return `Circle; X: ${value[0]}, Y: ${value[1]}, diameter: ${value[2]}`;\n } else if (value.length === 4) {\n return `Rectangle; X: ${value[0]}, Y: ${value[1]}, width: ${value[2]}, height: ${value[3]}`;\n }\n return 'Unknown';\n }\n },\n 0x927c: {\n 'name': 'MakerNote',\n 'description': () => '[Raw maker note data]'\n },\n 0x9286: {\n 'name': 'UserComment',\n 'description': getEncodedString\n },\n 0x9290: 'SubSecTime',\n 0x9291: 'SubSecTimeOriginal',\n 0x9292: 'SubSecTimeDigitized',\n 0x9400: {\n 'name': 'AmbientTemperature',\n 'description': (value) => (value[0] / value[1]) + ' °C'\n },\n 0x9401: {\n 'name': 'Humidity',\n 'description': (value) => (value[0] / value[1]) + ' %'\n },\n 0x9402: {\n 'name': 'Pressure',\n 'description': (value) => (value[0] / value[1]) + ' hPa'\n },\n 0x9403: {\n 'name': 'WaterDepth',\n 'description': (value) => (value[0] / value[1]) + ' m'\n },\n 0x9404: {\n 'name': 'Acceleration',\n 'description': (value) => (value[0] / value[1]) + ' mGal'\n },\n 0x9405: {\n 'name': 'CameraElevationAngle',\n 'description': (value) => (value[0] / value[1]) + ' °'\n },\n 0xa000: {\n 'name': 'FlashpixVersion',\n 'description': (value) => value.map((charCode) => String.fromCharCode(charCode)).join('')\n },\n 0xa001: {\n 'name': 'ColorSpace',\n 'description': (value) => {\n if (value === 1) {\n return 'sRGB';\n } else if (value === 0xffff) {\n return 'Uncalibrated';\n }\n return 'Unknown';\n }\n },\n 0xa002: 'PixelXDimension',\n 0xa003: 'PixelYDimension',\n 0xa004: 'RelatedSoundFile',\n 0xa005: 'Interoperability IFD Pointer',\n 0xa20b: 'FlashEnergy',\n 0xa20c: {\n 'name': 'SpatialFrequencyResponse',\n 'description': () => '[Raw SFR table data]'\n },\n 0xa20e: 'FocalPlaneXResolution',\n 0xa20f: 'FocalPlaneYResolution',\n 0xa210: {\n 'name': 'FocalPlaneResolutionUnit',\n 'description': (value) => {\n if (value === 2) {\n return 'inches';\n } else if (value === 3) {\n return 'centimeters';\n }\n return 'Unknown';\n }\n },\n 0xa214: {\n 'name': 'SubjectLocation',\n 'description': ([x, y]) => `X: ${x}, Y: ${y}`\n },\n 0xa215: 'ExposureIndex',\n 0xa217: {\n 'name': 'SensingMethod',\n 'description': (value) => {\n if (value === 1) {\n return 'Undefined';\n } else if (value === 2) {\n return 'One-chip color area sensor';\n } else if (value === 3) {\n return 'Two-chip color area sensor';\n } else if (value === 4) {\n return 'Three-chip color area sensor';\n } else if (value === 5) {\n return 'Color sequential area sensor';\n } else if (value === 7) {\n return 'Trilinear sensor';\n } else if (value === 8) {\n return 'Color sequential linear sensor';\n }\n return 'Unknown';\n }\n },\n 0xa300: {\n 'name': 'FileSource',\n 'description': (value) => {\n if (value === 3) {\n return 'DSC';\n }\n return 'Unknown';\n }\n },\n 0xa301: {\n 'name': 'SceneType',\n 'description': (value) => {\n if (value === 1) {\n return 'A directly photographed image';\n }\n return 'Unknown';\n }\n },\n 0xa302: {\n 'name': 'CFAPattern',\n 'description': () => '[Raw CFA pattern table data]'\n },\n 0xa401: {\n 'name': 'CustomRendered',\n 'description': (value) => {\n if (value === 0) {\n return 'Normal process';\n } else if (value === 1) {\n return 'Custom process';\n }\n return 'Unknown';\n }\n },\n 0xa402: {\n 'name': 'ExposureMode',\n 'description': (value) => {\n if (value === 0) {\n return 'Auto exposure';\n } else if (value === 1) {\n return 'Manual exposure';\n } else if (value === 2) {\n return 'Auto bracket';\n }\n return 'Unknown';\n }\n },\n 0xa403: {\n 'name': 'WhiteBalance',\n 'description': (value) => {\n if (value === 0) {\n return 'Auto white balance';\n } else if (value === 1) {\n return 'Manual white balance';\n }\n return 'Unknown';\n }\n },\n 0xa404: {\n 'name': 'DigitalZoomRatio',\n 'description': (value) => {\n if (value[0] === 0) {\n return 'Digital zoom was not used';\n }\n return '' + (value[0] / value[1]);\n }\n },\n 0xa405: {\n 'name': 'FocalLengthIn35mmFilm',\n 'description': (value) => {\n if (value === 0) {\n return 'Unknown';\n }\n return value;\n }\n },\n 0xa406: {\n 'name': 'SceneCaptureType',\n 'description': (value) => {\n if (value === 0) {\n return 'Standard';\n } else if (value === 1) {\n return 'Landscape';\n } else if (value === 2) {\n return 'Portrait';\n } else if (value === 3) {\n return 'Night scene';\n }\n return 'Unknown';\n }\n },\n 0xa407: {\n 'name': 'GainControl',\n 'description': (value) => {\n if (value === 0) {\n return 'None';\n } else if (value === 1) {\n return 'Low gain up';\n } else if (value === 2) {\n return 'High gain up';\n } else if (value === 3) {\n return 'Low gain down';\n } else if (value === 4) {\n return 'High gain down';\n }\n return 'Unknown';\n }\n },\n 0xa408: {\n 'name': 'Contrast',\n 'description': (value) => {\n if (value === 0) {\n return 'Normal';\n } else if (value === 1) {\n return 'Soft';\n } else if (value === 2) {\n return 'Hard';\n }\n return 'Unknown';\n }\n },\n 0xa409: {\n 'name': 'Saturation',\n 'description': (value) => {\n if (value === 0) {\n return 'Normal';\n } else if (value === 1) {\n return 'Low saturation';\n } else if (value === 2) {\n return 'High saturation';\n }\n return 'Unknown';\n }\n },\n 0xa40a: {\n 'name': 'Sharpness',\n 'description': (value) => {\n if (value === 0) {\n return 'Normal';\n } else if (value === 1) {\n return 'Soft';\n } else if (value === 2) {\n return 'Hard';\n }\n return 'Unknown';\n }\n },\n 0xa40b: {\n 'name': 'DeviceSettingDescription',\n 'description': () => '[Raw device settings table data]'\n },\n 0xa40c: {\n 'name': 'SubjectDistanceRange',\n 'description': (value) => {\n if (value === 1) {\n return 'Macro';\n } else if (value === 2) {\n return 'Close view';\n } else if (value === 3) {\n return 'Distant view';\n }\n return 'Unknown';\n }\n },\n 0xa420: 'ImageUniqueID',\n 0xa430: 'CameraOwnerName',\n 0xa431: 'BodySerialNumber',\n 0xa432: {\n 'name': 'LensSpecification',\n 'description': (value) => {\n const focalLengths = `${value[0][0] / value[0][1]}-${value[1][0] / value[1][1]} mm`;\n if (value[3][1] === 0) {\n return `${focalLengths} f/?`;\n }\n return `${focalLengths} f/${1 / ((value[2][1] / value[2][1]) / (value[3][0] / value[3][1]))}`;\n }\n },\n 0xa433: 'LensMake',\n 0xa434: 'LensModel',\n 0xa435: 'LensSerialNumber',\n 0xa460: {\n name: 'CompositeImage',\n description: (value) => ({\n 1: 'Not a Composite Image',\n 2: 'General Composite Image',\n 3: 'Composite Image Captured While Shooting',\n })[value] || 'Unknown'\n },\n 0xa461: 'SourceImageNumberOfCompositeImage',\n 0xa462: 'SourceExposureTimesOfCompositeImage',\n 0xa500: 'Gamma',\n 0xea1c: 'Padding',\n 0xea1d: 'OffsetSchema',\n 0xfde8: 'OwnerName',\n 0xfde9: 'SerialNumber',\n 0xfdea: 'Lens',\n 0xfe4c: 'RawFile',\n 0xfe4d: 'Converter',\n 0xfe4e: 'WhiteBalance',\n 0xfe51: 'Exposure',\n 0xfe52: 'Shadows',\n 0xfe53: 'Brightness',\n 0xfe54: 'Contrast',\n 0xfe55: 'Saturation',\n 0xfe56: 'Sharpness',\n 0xfe57: 'Smoothness',\n 0xfe58: 'MoireFilter'\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport Constants from './constants.js';\nimport {objectAssign} from './utils.js';\nimport ByteOrder from './byte-order.js';\nimport Types from './types.js';\nimport TagNames from './tag-names.js';\nimport {deferInit, getBase64Image} from './utils.js';\n\nconst EXIF_IFD_POINTER_KEY = 'Exif IFD Pointer';\nconst GPS_INFO_IFD_POINTER_KEY = 'GPS Info IFD Pointer';\nconst INTEROPERABILITY_IFD_POINTER_KEY = 'Interoperability IFD Pointer';\n\nconst getTagValueAt = {\n 1: Types.getByteAt,\n 2: Types.getAsciiAt,\n 3: Types.getShortAt,\n 4: Types.getLongAt,\n 5: Types.getRationalAt,\n 7: Types.getUndefinedAt,\n 9: Types.getSlongAt,\n 10: Types.getSrationalAt,\n 13: Types.getIfdPointerAt\n};\n\nexport default {\n read,\n readMpf\n};\n\nfunction read(dataView, tiffHeaderOffset) {\n const byteOrder = ByteOrder.getByteOrder(dataView, tiffHeaderOffset);\n let tags = read0thIfd(dataView, tiffHeaderOffset, byteOrder);\n tags = readExifIfd(tags, dataView, tiffHeaderOffset, byteOrder);\n tags = readGpsIfd(tags, dataView, tiffHeaderOffset, byteOrder);\n tags = readInteroperabilityIfd(tags, dataView, tiffHeaderOffset, byteOrder);\n\n return tags;\n}\n\nfunction read0thIfd(dataView, tiffHeaderOffset, byteOrder) {\n return readIfd(dataView, '0th', tiffHeaderOffset, get0thIfdOffset(dataView, tiffHeaderOffset, byteOrder), byteOrder);\n}\n\nfunction get0thIfdOffset(dataView, tiffHeaderOffset, byteOrder) {\n return tiffHeaderOffset + Types.getLongAt(dataView, tiffHeaderOffset + 4, byteOrder);\n}\n\nfunction readExifIfd(tags, dataView, tiffHeaderOffset, byteOrder) {\n if (tags[EXIF_IFD_POINTER_KEY] !== undefined) {\n return objectAssign(tags, readIfd(dataView, 'exif', tiffHeaderOffset, tiffHeaderOffset + tags[EXIF_IFD_POINTER_KEY].value, byteOrder));\n }\n\n return tags;\n}\n\nfunction readGpsIfd(tags, dataView, tiffHeaderOffset, byteOrder) {\n if (tags[GPS_INFO_IFD_POINTER_KEY] !== undefined) {\n return objectAssign(tags, readIfd(dataView, 'gps', tiffHeaderOffset, tiffHeaderOffset + tags[GPS_INFO_IFD_POINTER_KEY].value, byteOrder));\n }\n\n return tags;\n}\n\nfunction readInteroperabilityIfd(tags, dataView, tiffHeaderOffset, byteOrder) {\n if (tags[INTEROPERABILITY_IFD_POINTER_KEY] !== undefined) {\n return objectAssign(tags, readIfd(dataView, 'interoperability', tiffHeaderOffset, tiffHeaderOffset + tags[INTEROPERABILITY_IFD_POINTER_KEY].value, byteOrder));\n }\n\n return tags;\n}\n\nfunction readMpf(dataView, dataOffset) {\n const byteOrder = ByteOrder.getByteOrder(dataView, dataOffset);\n const tags = readIfd(dataView, 'mpf', dataOffset, get0thIfdOffset(dataView, dataOffset, byteOrder), byteOrder);\n return addMpfImages(dataView, dataOffset, tags, byteOrder);\n}\n\nfunction addMpfImages(dataView, dataOffset, tags, byteOrder) {\n const ENTRY_SIZE = 16;\n\n if (!tags['MPEntry']) {\n return tags;\n }\n\n const images = [];\n for (let i = 0; i < Math.ceil(tags['MPEntry'].value.length / ENTRY_SIZE); i++) {\n images[i] = {};\n\n const attributes = getImageNumberValue(tags['MPEntry'].value, i * ENTRY_SIZE, Types.getTypeSize('LONG'), byteOrder);\n images[i]['ImageFlags'] = getImageFlags(attributes);\n images[i]['ImageFormat'] = getImageFormat(attributes);\n images[i]['ImageType'] = getImageType(attributes);\n\n const imageSize = getImageNumberValue(tags['MPEntry'].value, i * ENTRY_SIZE + 4, Types.getTypeSize('LONG'), byteOrder);\n images[i]['ImageSize'] = {\n value: imageSize,\n description: '' + imageSize\n };\n\n const imageOffset = isFirstIndividualImage(i) ? 0 : getImageNumberValue(tags['MPEntry'].value, i * ENTRY_SIZE + 8, Types.getTypeSize('LONG'), byteOrder) + dataOffset;\n images[i]['ImageOffset'] = {\n value: imageOffset,\n description: '' + imageOffset\n };\n\n const dependentImage1EntryNumber =\n getImageNumberValue(tags['MPEntry'].value, i * ENTRY_SIZE + 12, Types.getTypeSize('SHORT'), byteOrder);\n images[i]['DependentImage1EntryNumber'] = {\n value: dependentImage1EntryNumber,\n description: '' + dependentImage1EntryNumber\n };\n\n const dependentImage2EntryNumber =\n getImageNumberValue(tags['MPEntry'].value, i * ENTRY_SIZE + 14, Types.getTypeSize('SHORT'), byteOrder);\n images[i]['DependentImage2EntryNumber'] = {\n value: dependentImage2EntryNumber,\n description: '' + dependentImage2EntryNumber\n };\n\n images[i].image = dataView.buffer.slice(imageOffset, imageOffset + imageSize);\n deferInit(images[i], 'base64', function () {\n return getBase64Image(this.image);\n });\n }\n\n tags['Images'] = images;\n\n return tags;\n}\n\nfunction getImageNumberValue(entries, offset, size, byteOrder) {\n if (byteOrder === ByteOrder.LITTLE_ENDIAN) {\n let value = 0;\n for (let i = 0; i < size; i++) {\n value += entries[offset + i] << (8 * i);\n }\n return value;\n }\n\n let value = 0;\n for (let i = 0; i < size; i++) {\n value += entries[offset + i] << (8 * (size - 1 - i));\n }\n return value;\n}\n\nfunction getImageFlags(attributes) {\n const flags = [\n (attributes >> 31) & 0x1,\n (attributes >> 30) & 0x1,\n (attributes >> 29) & 0x1\n ];\n\n const flagsDescription = [];\n\n if (flags[0]) {\n flagsDescription.push('Dependent Parent Image');\n }\n if (flags[1]) {\n flagsDescription.push('Dependent Child Image');\n }\n if (flags[2]) {\n flagsDescription.push('Representative Image');\n }\n\n return {\n value: flags,\n description: flagsDescription.join(', ') || 'None'\n };\n}\n\nfunction getImageFormat(attributes) {\n const imageFormat = attributes >> 24 & 0x7;\n return {\n value: imageFormat,\n description: imageFormat === 0 ? 'JPEG' : 'Unknown'\n };\n}\n\nfunction getImageType(attributes) {\n const type = attributes & 0xffffff;\n const descriptions = {\n 0x30000: 'Baseline MP Primary Image',\n 0x10001: 'Large Thumbnail (VGA equivalent)',\n 0x10002: 'Large Thumbnail (Full HD equivalent)',\n 0x20001: 'Multi-Frame Image (Panorama)',\n 0x20002: 'Multi-Frame Image (Disparity)',\n 0x20003: 'Multi-Frame Image (Multi-Angle)',\n 0x0: 'Undefined',\n };\n\n return {\n value: type,\n description: descriptions[type] || 'Unknown'\n };\n}\n\nfunction isFirstIndividualImage(i) {\n return i === 0;\n}\n\nfunction readIfd(dataView, ifdType, tiffHeaderOffset, offset, byteOrder) {\n const FIELD_COUNT_SIZE = Types.getTypeSize('SHORT');\n const FIELD_SIZE = 12;\n\n const tags = {};\n const numberOfFields = getNumberOfFields(dataView, offset, byteOrder);\n\n offset += FIELD_COUNT_SIZE;\n for (let fieldIndex = 0; fieldIndex < numberOfFields; fieldIndex++) {\n if (offset + FIELD_SIZE > dataView.byteLength) {\n break;\n }\n\n const tag = readTag(dataView, ifdType, tiffHeaderOffset, offset, byteOrder);\n if (tag !== undefined) {\n tags[tag.name] = {\n 'id': tag.id,\n 'value': tag.value,\n 'description': tag.description\n };\n }\n\n offset += FIELD_SIZE;\n }\n\n if (Constants.USE_THUMBNAIL && (offset < dataView.byteLength - Types.getTypeSize('LONG'))) {\n const nextIfdOffset = Types.getLongAt(dataView, offset, byteOrder);\n if (nextIfdOffset !== 0) {\n tags['Thumbnail'] = readIfd(dataView, ifdType, tiffHeaderOffset, tiffHeaderOffset + nextIfdOffset, byteOrder);\n }\n }\n\n return tags;\n}\n\nfunction getNumberOfFields(dataView, offset, byteOrder) {\n if (offset + Types.getTypeSize('SHORT') <= dataView.byteLength) {\n return Types.getShortAt(dataView, offset, byteOrder);\n }\n return 0;\n}\n\nfunction readTag(dataView, ifdType, tiffHeaderOffset, offset, byteOrder) {\n const TAG_CODE_IPTC_NAA = 0x83bb;\n const TAG_TYPE_OFFSET = Types.getTypeSize('SHORT');\n const TAG_COUNT_OFFSET = TAG_TYPE_OFFSET + Types.getTypeSize('SHORT');\n const TAG_VALUE_OFFSET = TAG_COUNT_OFFSET + Types.getTypeSize('LONG');\n\n const tagCode = Types.getShortAt(dataView, offset, byteOrder);\n const tagType = Types.getShortAt(dataView, offset + TAG_TYPE_OFFSET, byteOrder);\n const tagCount = Types.getLongAt(dataView, offset + TAG_COUNT_OFFSET, byteOrder);\n let tagValue;\n\n if (Types.typeSizes[tagType] === undefined) {\n return undefined;\n }\n\n if (tagValueFitsInOffsetSlot(tagType, tagCount)) {\n tagValue = getTagValue(dataView, offset + TAG_VALUE_OFFSET, tagType, tagCount, byteOrder);\n } else {\n const tagValueOffset = Types.getLongAt(dataView, offset + TAG_VALUE_OFFSET, byteOrder);\n if (tagValueFitsInDataView(dataView, tiffHeaderOffset, tagValueOffset, tagType, tagCount)) {\n const forceByteType = tagCode === TAG_CODE_IPTC_NAA;\n tagValue = getTagValue(dataView, tiffHeaderOffset + tagValueOffset, tagType, tagCount, byteOrder, forceByteType);\n } else {\n tagValue = '';\n }\n }\n\n if (tagType === Types.tagTypes['ASCII']) {\n tagValue = splitNullSeparatedAsciiString(tagValue);\n tagValue = decodeAsciiValue(tagValue);\n }\n\n let tagName = `undefined-${tagCode}`;\n let tagDescription = tagValue;\n\n if (TagNames[ifdType][tagCode] !== undefined) {\n if ((TagNames[ifdType][tagCode]['name'] !== undefined) && (TagNames[ifdType][tagCode]['description'] !== undefined)) {\n tagName = TagNames[ifdType][tagCode]['name'];\n try {\n tagDescription = TagNames[ifdType][tagCode]['description'](tagValue);\n } catch (error) {\n tagDescription = getDescriptionFromTagValue(tagValue);\n }\n } else if ((tagType === Types.tagTypes['RATIONAL']) || (tagType === Types.tagTypes['SRATIONAL'])) {\n tagName = TagNames[ifdType][tagCode];\n tagDescription = '' + (tagValue[0] / tagValue[1]);\n } else {\n tagName = TagNames[ifdType][tagCode];\n tagDescription = getDescriptionFromTagValue(tagValue);\n }\n }\n\n return {\n id: tagCode,\n name: tagName,\n value: tagValue,\n description: tagDescription\n };\n}\n\nfunction tagValueFitsInOffsetSlot(tagType, tagCount) {\n return Types.typeSizes[tagType] * tagCount <= Types.getTypeSize('LONG');\n}\n\nfunction getTagValue(dataView, offset, type, count, byteOrder, forceByteType = false) {\n let value = [];\n\n if (forceByteType) {\n count = count * Types.typeSizes[type];\n type = Types.tagTypes['BYTE'];\n }\n for (let valueIndex = 0; valueIndex < count; valueIndex++) {\n value.push(getTagValueAt[type](dataView, offset, byteOrder));\n offset += Types.typeSizes[type];\n }\n\n if (type === Types.tagTypes['ASCII']) {\n value = Types.getAsciiValue(value);\n } else if (value.length === 1) {\n value = value[0];\n }\n\n return value;\n}\n\nfunction tagValueFitsInDataView(dataView, tiffHeaderOffset, tagValueOffset, tagType, tagCount) {\n return tiffHeaderOffset + tagValueOffset + Types.typeSizes[tagType] * tagCount <= dataView.byteLength;\n}\n\nfunction splitNullSeparatedAsciiString(string) {\n const tagValue = [];\n let i = 0;\n\n for (let j = 0; j < string.length; j++) {\n if (string[j] === '\\x00') {\n i++;\n continue;\n }\n if (tagValue[i] === undefined) {\n tagValue[i] = '';\n }\n tagValue[i] += string[j];\n }\n\n return tagValue;\n}\n\nfunction decodeAsciiValue(asciiValue) {\n try {\n return asciiValue.map((value) => decodeURIComponent(escape(value)));\n } catch (error) {\n return asciiValue;\n }\n}\n\nfunction getDescriptionFromTagValue(tagValue) {\n if (tagValue instanceof Array) {\n return tagValue.join(', ');\n }\n return tagValue;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport Types from './types.js';\n\nexport default {\n read\n};\n\nfunction read(dataView, fileDataOffset) {\n const length = getLength(dataView, fileDataOffset);\n const numberOfColorComponents = getNumberOfColorComponents(dataView, fileDataOffset, length);\n return {\n 'Bits Per Sample': getDataPrecision(dataView, fileDataOffset, length),\n 'Image Height': getImageHeight(dataView, fileDataOffset, length),\n 'Image Width': getImageWidth(dataView, fileDataOffset, length),\n 'Color Components': numberOfColorComponents,\n 'Subsampling': numberOfColorComponents && getSubsampling(dataView, fileDataOffset, numberOfColorComponents.value, length)\n };\n}\n\nfunction getLength(dataView, fileDataOffset) {\n return Types.getShortAt(dataView, fileDataOffset);\n}\n\nfunction getDataPrecision(dataView, fileDataOffset, length) {\n const OFFSET = 2;\n const SIZE = 1;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: '' + value\n };\n}\n\nfunction getImageHeight(dataView, fileDataOffset, length) {\n const OFFSET = 3;\n const SIZE = 2;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getShortAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: `${value}px`\n };\n}\n\nfunction getImageWidth(dataView, fileDataOffset, length) {\n const OFFSET = 5;\n const SIZE = 2;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getShortAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: `${value}px`\n };\n}\n\nfunction getNumberOfColorComponents(dataView, fileDataOffset, length) {\n const OFFSET = 7;\n const SIZE = 1;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: '' + value\n };\n}\n\nfunction getSubsampling(dataView, fileDataOffset, numberOfColorComponents, length) {\n const OFFSET = 8;\n const SIZE = 3 * numberOfColorComponents;\n\n if (OFFSET + SIZE > length) {\n return undefined;\n }\n\n const components = [];\n\n for (let i = 0; i < numberOfColorComponents; i++) {\n const componentOffset = fileDataOffset + OFFSET + i * 3;\n components.push([\n Types.getByteAt(dataView, componentOffset),\n Types.getByteAt(dataView, componentOffset + 1),\n Types.getByteAt(dataView, componentOffset + 2)\n ]);\n }\n\n return {\n value: components,\n description: components.length > 1 ? getComponentIds(components) + getSamplingType(components) : ''\n };\n}\n\nfunction getComponentIds(components) {\n const ids = {\n 0x01: 'Y',\n 0x02: 'Cb',\n 0x03: 'Cr',\n 0x04: 'I',\n 0x05: 'Q',\n };\n\n return components.map((compontent) => ids[compontent[0]]).join('');\n}\n\nfunction getSamplingType(components) {\n const types = {\n 0x11: '4:4:4 (1 1)',\n 0x12: '4:4:0 (1 2)',\n 0x14: '4:4:1 (1 4)',\n 0x21: '4:2:2 (2 1)',\n 0x22: '4:2:0 (2 2)',\n 0x24: '4:2:1 (2 4)',\n 0x41: '4:1:1 (4 1)',\n 0x42: '4:1:0 (4 2)'\n };\n\n if (components.length === 0 || components[0][1] === undefined || types[components[0][1]] === undefined) {\n return '';\n }\n\n return types[components[0][1]];\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringValue} from './tag-names-utils.js';\n\nexport default {\n 'iptc': {\n 0x0100: {\n 'name': 'Model Version',\n 'description': (value) => {\n return ((value[0] << 8) + value[1]).toString();\n }\n },\n 0x0105: {\n 'name': 'Destination',\n 'repeatable': true\n },\n 0x0114: {\n 'name': 'File Format',\n 'description': (value) => {\n return ((value[0] << 8) + value[1]).toString();\n }\n },\n 0x0116: {\n 'name': 'File Format Version',\n 'description': (value) => {\n return ((value[0] << 8) + value[1]).toString();\n }\n },\n 0x011e: 'Service Identifier',\n 0x0128: 'Envelope Number',\n 0x0132: 'Product ID',\n 0x013c: 'Envelope Priority',\n 0x0146: {\n 'name': 'Date Sent',\n 'description': getCreationDate\n },\n 0x0150: {\n 'name': 'Time Sent',\n 'description': getCreationTime\n },\n 0x015a: {\n 'name': 'Coded Character Set',\n 'description': getEncodingName,\n 'encoding_name': getEncodingName,\n },\n 0x0164: 'UNO',\n 0x0178: {\n 'name': 'ARM Identifier',\n 'description': (value) => {\n return ((value[0] << 8) + value[1]).toString();\n }\n },\n 0x017a: {\n 'name': 'ARM Version',\n 'description': (value) => {\n return ((value[0] << 8) + value[1]).toString();\n }\n },\n 0x0200: {\n 'name': 'Record Version',\n 'description': (value) => {\n return ((value[0] << 8) + value[1]).toString();\n }\n },\n 0x0203: 'Object Type Reference',\n 0x0204: 'Object Attribute Reference',\n 0x0205: 'Object Name',\n 0x0207: 'Edit Status',\n 0x0208: {\n 'name': 'Editorial Update',\n 'description': (value) => {\n if (getStringValue(value) === '01') {\n return 'Additional Language';\n }\n return 'Unknown';\n }\n },\n 0x020a: 'Urgency',\n 0x020c: {\n 'name': 'Subject Reference',\n 'repeatable': true,\n 'description': (value) => {\n const parts = getStringValue(value).split(':');\n return parts[2] + (parts[3] ? '/' + parts[3] : '') + (parts[4] ? '/' + parts[4] : '');\n }\n },\n 0x020f: 'Category',\n 0x0214: {\n 'name': 'Supplemental Category',\n 'repeatable': true\n },\n 0x0216: 'Fixture Identifier',\n 0x0219: {\n 'name': 'Keywords',\n 'repeatable': true\n },\n 0x021a: {\n 'name': 'Content Location Code',\n 'repeatable': true\n },\n 0x021b: {\n 'name': 'Content Location Name',\n 'repeatable': true\n },\n 0x021e: 'Release Date',\n 0x0223: 'Release Time',\n 0x0225: 'Expiration Date',\n 0x0226: 'Expiration Time',\n 0x0228: 'Special Instructions',\n 0x022a: {\n 'name': 'Action Advised',\n 'description': (value) => {\n const string = getStringValue(value);\n if (string === '01') {\n return 'Object Kill';\n } else if (string === '02') {\n return 'Object Replace';\n } else if (string === '03') {\n return 'Object Append';\n } else if (string === '04') {\n return 'Object Reference';\n }\n return 'Unknown';\n }\n },\n 0x022d: {\n 'name': 'Reference Service',\n 'repeatable': true\n },\n 0x022f: {\n 'name': 'Reference Date',\n 'repeatable': true\n },\n 0x0232: {\n 'name': 'Reference Number',\n 'repeatable': true\n },\n 0x0237: {\n 'name': 'Date Created',\n 'description': getCreationDate\n },\n 0x023c: {\n 'name': 'Time Created',\n 'description': getCreationTime\n },\n 0x023e: {\n 'name': 'Digital Creation Date',\n 'description': getCreationDate\n },\n 0x023f: {\n 'name': 'Digital Creation Time',\n 'description': getCreationTime\n },\n 0x0241: 'Originating Program',\n 0x0246: 'Program Version',\n 0x024b: {\n 'name': 'Object Cycle',\n 'description': (value) => {\n const string = getStringValue(value);\n if (string === 'a') {\n return 'morning';\n } else if (string === 'p') {\n return 'evening';\n } else if (string === 'b') {\n return 'both';\n }\n return 'Unknown';\n }\n },\n 0x0250: {\n 'name': 'By-line',\n 'repeatable': true\n },\n 0x0255: {\n 'name': 'By-line Title',\n 'repeatable': true\n },\n 0x025a: 'City',\n 0x025c: 'Sub-location',\n 0x025f: 'Province/State',\n 0x0264: 'Country/Primary Location Code',\n 0x0265: 'Country/Primary Location Name',\n 0x0267: 'Original Transmission Reference',\n 0x0269: 'Headline',\n 0x026e: 'Credit',\n 0x0273: 'Source',\n 0x0274: 'Copyright Notice',\n 0x0276: {\n 'name': 'Contact',\n 'repeatable': true\n },\n 0x0278: 'Caption/Abstract',\n 0x027a: {\n 'name': 'Writer/Editor',\n 'repeatable': true\n },\n 0x027d: {\n 'name': 'Rasterized Caption',\n 'description': (value) => value\n },\n 0x0282: 'Image Type',\n 0x0283: {\n 'name': 'Image Orientation',\n 'description': (value) => {\n const string = getStringValue(value);\n if (string === 'P') {\n return 'Portrait';\n } else if (string === 'L') {\n return 'Landscape';\n } else if (string === 'S') {\n return 'Square';\n }\n return 'Unknown';\n }\n },\n 0x0287: 'Language Identifier',\n 0x0296: {\n 'name': 'Audio Type',\n 'description': (value) => {\n const stringValue = getStringValue(value);\n const character0 = stringValue.charAt(0);\n const character1 = stringValue.charAt(1);\n let description = '';\n\n if (character0 === '1') {\n description += 'Mono';\n } else if (character0 === '2') {\n description += 'Stereo';\n }\n\n if (character1 === 'A') {\n description += ', actuality';\n } else if (character1 === 'C') {\n description += ', question and answer session';\n } else if (character1 === 'M') {\n description += ', music, transmitted by itself';\n } else if (character1 === 'Q') {\n description += ', response to a question';\n } else if (character1 === 'R') {\n description += ', raw sound';\n } else if (character1 === 'S') {\n description += ', scener';\n } else if (character1 === 'V') {\n description += ', voicer';\n } else if (character1 === 'W') {\n description += ', wrap';\n }\n\n if (description !== '') {\n return description;\n }\n return stringValue;\n }\n },\n 0x0297: {\n 'name': 'Audio Sampling Rate',\n 'description': (value) => parseInt(getStringValue(value), 10) + ' Hz'\n },\n 0x0298: {\n 'name': 'Audio Sampling Resolution',\n 'description': (value) => {\n const bits = parseInt(getStringValue(value), 10);\n return bits + (bits === 1 ? ' bit' : ' bits');\n }\n },\n 0x0299: {\n 'name': 'Audio Duration',\n 'description': (value) => {\n const duration = getStringValue(value);\n if (duration.length >= 6) {\n return duration.substr(0, 2) + ':' + duration.substr(2, 2) + ':' + duration.substr(4, 2);\n }\n return duration;\n }\n },\n 0x029a: 'Audio Outcue',\n 0x02ba: 'Short Document ID',\n 0x02bb: 'Unique Document ID',\n 0x02bc: 'Owner ID',\n 0x02c8: {\n 'name': (value) => {\n if (value.length === 2) {\n return 'ObjectData Preview File Format';\n }\n return 'Record 2 destination';\n },\n 'description': (value) => {\n if (value.length === 2) {\n const intValue = (value[0] << 8) + value[1];\n if (intValue === 0) {\n return 'No ObjectData';\n } else if (intValue === 1) {\n return 'IPTC-NAA Digital Newsphoto Parameter Record';\n } else if (intValue === 2) {\n return 'IPTC7901 Recommended Message Format';\n } else if (intValue === 3) {\n return 'Tagged Image File Format (Adobe/Aldus Image data)';\n } else if (intValue === 4) {\n return 'Illustrator (Adobe Graphics data)';\n } else if (intValue === 5) {\n return 'AppleSingle (Apple Computer Inc)';\n } else if (intValue === 6) {\n return 'NAA 89-3 (ANPA 1312)';\n } else if (intValue === 7) {\n return 'MacBinary II';\n } else if (intValue === 8) {\n return 'IPTC Unstructured Character Oriented File Format (UCOFF)';\n } else if (intValue === 9) {\n return 'United Press International ANPA 1312 variant';\n } else if (intValue === 10) {\n return 'United Press International Down-Load Message';\n } else if (intValue === 11) {\n return 'JPEG File Interchange (JFIF)';\n } else if (intValue === 12) {\n return 'Photo-CD Image-Pac (Eastman Kodak)';\n } else if (intValue === 13) {\n return 'Microsoft Bit Mapped Graphics File [*.BMP]';\n } else if (intValue === 14) {\n return 'Digital Audio File [*.WAV] (Microsoft & Creative Labs)';\n } else if (intValue === 15) {\n return 'Audio plus Moving Video [*.AVI] (Microsoft)';\n } else if (intValue === 16) {\n return 'PC DOS/Windows Executable Files [*.COM][*.EXE]';\n } else if (intValue === 17) {\n return 'Compressed Binary File [*.ZIP] (PKWare Inc)';\n } else if (intValue === 18) {\n return 'Audio Interchange File Format AIFF (Apple Computer Inc)';\n } else if (intValue === 19) {\n return 'RIFF Wave (Microsoft Corporation)';\n } else if (intValue === 20) {\n return 'Freehand (Macromedia/Aldus)';\n } else if (intValue === 21) {\n return 'Hypertext Markup Language \"HTML\" (The Internet Society)';\n } else if (intValue === 22) {\n return 'MPEG 2 Audio Layer 2 (Musicom), ISO/IEC';\n } else if (intValue === 23) {\n return 'MPEG 2 Audio Layer 3, ISO/IEC';\n } else if (intValue === 24) {\n return 'Portable Document File (*.PDF) Adobe';\n } else if (intValue === 25) {\n return 'News Industry Text Format (NITF)';\n } else if (intValue === 26) {\n return 'Tape Archive (*.TAR)';\n } else if (intValue === 27) {\n return 'Tidningarnas Telegrambyrå NITF version (TTNITF DTD)';\n } else if (intValue === 28) {\n return 'Ritzaus Bureau NITF version (RBNITF DTD)';\n } else if (intValue === 29) {\n return 'Corel Draw [*.CDR]';\n }\n return `Unknown format ${intValue}`;\n }\n return getStringValue(value);\n }\n },\n 0x02c9: {\n 'name': 'ObjectData Preview File Format Version',\n 'description': (value, tags) => {\n // Format ID, Version ID, Version Description\n const formatVersions = {\n '00': {'00': '1'},\n '01': {'01': '1', '02': '2', '03': '3', '04': '4'},\n '02': {'04': '4'},\n '03': {'01': '5.0', '02': '6.0'},\n '04': {'01': '1.40'},\n '05': {'01': '2'},\n '06': {'01': '1'},\n '11': {'01': '1.02'},\n '20': {'01': '3.1', '02': '4.0', '03': '5.0', '04': '5.5'},\n '21': {'02': '2.0'}\n };\n const stringValue = getStringValue(value);\n\n if (tags['ObjectData Preview File Format']) {\n const objectDataPreviewFileFormat = getStringValue(tags['ObjectData Preview File Format'].value);\n if (formatVersions[objectDataPreviewFileFormat]\n && formatVersions[objectDataPreviewFileFormat][stringValue]) {\n return formatVersions[objectDataPreviewFileFormat][stringValue];\n }\n }\n\n return stringValue;\n }\n },\n 0x02ca: 'ObjectData Preview Data',\n 0x070a: {\n 'name': 'Size Mode',\n 'description': (value) => {\n return (value[0]).toString();\n }\n },\n 0x0714: {\n 'name': 'Max Subfile Size',\n 'description': (value) => {\n let n = 0;\n for (let i = 0; i < value.length; i++) {\n n = (n << 8) + value[i];\n }\n return n.toString();\n }\n },\n 0x075a: {\n 'name': 'ObjectData Size Announced',\n 'description': (value) => {\n let n = 0;\n for (let i = 0; i < value.length; i++) {\n n = (n << 8) + value[i];\n }\n return n.toString();\n }\n },\n 0x075f: {\n 'name': 'Maximum ObjectData Size',\n 'description': (value) => {\n let n = 0;\n for (let i = 0; i < value.length; i++) {\n n = (n << 8) + value[i];\n }\n return n.toString();\n }\n }\n }\n};\n\nfunction getCreationDate(value) {\n const date = getStringValue(value);\n\n if (date.length >= 8) {\n return date.substr(0, 4) + '-' + date.substr(4, 2) + '-' + date.substr(6, 2);\n }\n\n return date;\n}\n\nfunction getCreationTime(value) {\n const time = getStringValue(value);\n let parsedTime = time;\n\n if (time.length >= 6) {\n parsedTime = time.substr(0, 2) + ':' + time.substr(2, 2) + ':' + time.substr(4, 2);\n if (time.length === 11) {\n parsedTime += time.substr(6, 1) + time.substr(7, 2) + ':' + time.substr(9, 2);\n }\n }\n\n return parsedTime;\n}\n\nfunction getEncodingName(value) {\n const string = getStringValue(value);\n if (string === '\\x1b%G') {\n return 'UTF-8';\n } else if (string === '\\x1b%5') {\n return 'Windows-1252';\n } else if (string === '\\x1b%/G') {\n return 'UTF-8 Level 1';\n } else if (string === '\\x1b%/H') {\n return 'UTF-8 Level 2';\n } else if (string === '\\x1b%/I') {\n return 'UTF-8 Level 3';\n } else if (string === '\\x1B/A') {\n return 'ISO-8859-1';\n } else if (string === '\\x1B/B') {\n return 'ISO-8859-2';\n } else if (string === '\\x1B/C') {\n return 'ISO-8859-3';\n } else if (string === '\\x1B/D') {\n return 'ISO-8859-4';\n } else if (string === '\\x1B/@') {\n return 'ISO-8859-5';\n } else if (string === '\\x1B/G') {\n return 'ISO-8859-6';\n } else if (string === '\\x1B/F') {\n return 'ISO-8859-7';\n } else if (string === '\\x1B/H') {\n return 'ISO-8859-8';\n }\n return 'Unknown';\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nexport default {\n get\n};\n\nfunction get() {\n if (typeof TextDecoder !== 'undefined') {\n return TextDecoder;\n }\n\n return undefined;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport TextDecoder from './text-decoder.js';\n\nconst TAG_HEADER_SIZE = 5;\n\nexport default {\n decode,\n TAG_HEADER_SIZE\n};\n\nfunction decode(encoding, tagValue) {\n const Decoder = TextDecoder.get();\n if ((typeof Decoder !== 'undefined') && (encoding !== undefined)) {\n try {\n return new Decoder(encoding).decode(Uint8Array.from(tagValue));\n } catch (error) {\n // Pass through and fall back to ASCII decoding.\n }\n }\n\n const stringValue = tagValue.map((charCode) => String.fromCharCode(charCode)).join('');\n return decodeAsciiValue(stringValue);\n}\n\nfunction decodeAsciiValue(asciiValue) {\n try {\n return decodeURIComponent(escape(asciiValue));\n } catch (error) {\n return asciiValue;\n }\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport IptcTagNames from './iptc-tag-names.js';\nimport TagDecoder from './tag-decoder.js';\n\nconst BYTES_8BIM = 0x3842494d;\nconst BYTES_8BIM_SIZE = 4;\nconst RESOURCE_BLOCK_HEADER_SIZE = BYTES_8BIM_SIZE + 8;\nconst NAA_RESOURCE_BLOCK_TYPE = 0x0404;\nconst TAG_HEADER_SIZE = 5;\n\nexport default {\n read\n};\n\nfunction read(dataView, dataOffset) {\n try {\n if (Array.isArray(dataView)) {\n return parseTags(new DataView(Uint8Array.from(dataView).buffer), {size: dataView.length}, 0);\n }\n const {naaBlock, dataOffset: newDataOffset} = getNaaResourceBlock(dataView, dataOffset);\n return parseTags(dataView, naaBlock, newDataOffset);\n } catch (error) {\n return {};\n }\n}\n\nfunction getNaaResourceBlock(dataView, dataOffset) {\n while (dataOffset + RESOURCE_BLOCK_HEADER_SIZE <= dataView.byteLength) {\n const resourceBlock = getResourceBlock(dataView, dataOffset);\n if (isNaaResourceBlock(resourceBlock)) {\n return {naaBlock: resourceBlock, dataOffset: dataOffset + RESOURCE_BLOCK_HEADER_SIZE};\n }\n dataOffset += RESOURCE_BLOCK_HEADER_SIZE + resourceBlock.size + getBlockPadding(resourceBlock);\n }\n throw new Error('No IPTC NAA resource block.');\n}\n\nfunction getResourceBlock(dataView, dataOffset) {\n const RESOURCE_BLOCK_SIZE_OFFSET = 10;\n\n if (dataView.getUint32(dataOffset, false) !== BYTES_8BIM) {\n throw new Error('Not an IPTC resource block.');\n }\n\n return {\n type: dataView.getUint16(dataOffset + BYTES_8BIM_SIZE),\n size: dataView.getUint16(dataOffset + RESOURCE_BLOCK_SIZE_OFFSET)\n };\n}\n\nfunction isNaaResourceBlock(resourceBlock) {\n return resourceBlock.type === NAA_RESOURCE_BLOCK_TYPE;\n}\n\nfunction getBlockPadding(resourceBlock) {\n if (resourceBlock.size % 2 !== 0) {\n return 1;\n }\n return 0;\n}\n\nfunction parseTags(dataView, naaBlock, dataOffset) {\n const tags = {};\n let encoding = undefined;\n\n const endOfBlockOffset = dataOffset + naaBlock['size'];\n\n while ((dataOffset < endOfBlockOffset) && (dataOffset < dataView.byteLength)) {\n const {tag, tagSize} = readTag(dataView, dataOffset, tags, encoding);\n\n if (tag === null) {\n break;\n }\n\n if ('encoding' in tag) {\n encoding = tag.encoding;\n }\n\n if ((tags[tag.name] === undefined) || (tag['repeatable'] === undefined)) {\n tags[tag.name] = {\n id: tag.id,\n value: tag.value,\n description: tag.description\n };\n } else {\n if (!(tags[tag.name] instanceof Array)) {\n tags[tag.name] = [{\n id: tags[tag.name].id,\n value: tags[tag.name].value,\n description: tags[tag.name].description\n }];\n }\n tags[tag.name].push({\n id: tag.id,\n value: tag.value,\n description: tag.description\n });\n }\n\n dataOffset += TAG_HEADER_SIZE + tagSize;\n }\n\n return tags;\n}\n\nfunction readTag(dataView, dataOffset, tags, encoding) {\n const TAG_CODE_OFFSET = 1;\n const TAG_SIZE_OFFSET = 3;\n\n if (leadByteIsMissing(dataView, dataOffset)) {\n return {tag: null, tagSize: 0};\n }\n\n const tagCode = dataView.getUint16(dataOffset + TAG_CODE_OFFSET);\n const tagSize = dataView.getUint16(dataOffset + TAG_SIZE_OFFSET);\n const tagValue = getTagValue(dataView, dataOffset + TAG_HEADER_SIZE, tagSize);\n\n const tag = {\n id: tagCode,\n name: getTagName(IptcTagNames['iptc'][tagCode], tagCode, tagValue),\n value: tagValue,\n description: getTagDescription(IptcTagNames['iptc'][tagCode], tagValue, tags, encoding)\n };\n if (tagIsRepeatable(tagCode)) {\n tag['repeatable'] = true;\n }\n if (tagContainsEncoding(tagCode)) {\n tag['encoding'] = IptcTagNames['iptc'][tagCode]['encoding_name'](tagValue);\n }\n\n return {tag, tagSize};\n}\n\nfunction leadByteIsMissing(dataView, dataOffset) {\n const TAG_LEAD_BYTE = 0x1c;\n return dataView.getUint8(dataOffset) !== TAG_LEAD_BYTE;\n}\n\nfunction getTagValue(dataView, offset, size) {\n const value = [];\n\n for (let valueIndex = 0; valueIndex < size; valueIndex++) {\n value.push(dataView.getUint8(offset + valueIndex));\n }\n\n return value;\n}\n\nfunction getTagName(tag, tagCode, tagValue) {\n if (!tag) {\n return `undefined-${tagCode}`;\n }\n if (tagIsName(tag)) {\n return tag;\n }\n if (hasDynamicName(tag)) {\n return tag['name'](tagValue);\n }\n return tag['name'];\n}\n\nfunction tagIsName(tag) {\n return typeof tag === 'string';\n}\n\nfunction hasDynamicName(tag) {\n return typeof (tag['name']) === 'function';\n}\n\nfunction getTagDescription(tag, tagValue, tags, encoding) {\n if (hasDescriptionProperty(tag)) {\n try {\n return tag['description'](tagValue, tags);\n } catch (error) {\n // Fall through to next handler.\n }\n }\n if (tagValueIsText(tag, tagValue)) {\n return TagDecoder.decode(encoding, tagValue);\n }\n return tagValue;\n}\n\nfunction tagValueIsText(tag, tagValue) {\n return tag && tagValue instanceof Array;\n}\n\nfunction hasDescriptionProperty(tag) {\n return tag && tag['description'] !== undefined;\n}\n\nfunction tagIsRepeatable(tagCode) {\n return IptcTagNames['iptc'][tagCode] && IptcTagNames['iptc'][tagCode]['repeatable'];\n}\n\nfunction tagContainsEncoding(tagCode) {\n return IptcTagNames['iptc'][tagCode] && IptcTagNames['iptc'][tagCode]['encoding_name'] !== undefined;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nexport default {\n 'tiff:Orientation'(value) {\n if (value === '1') {\n return 'Horizontal (normal)';\n }\n if (value === '2') {\n return 'Mirror horizontal';\n }\n if (value === '3') {\n return 'Rotate 180';\n }\n if (value === '4') {\n return 'Mirror vertical';\n }\n if (value === '5') {\n return 'Mirror horizontal and rotate 270 CW';\n }\n if (value === '6') {\n return 'Rotate 90 CW';\n }\n if (value === '7') {\n return 'Mirror horizontal and rotate 90 CW';\n }\n if (value === '8') {\n return 'Rotate 270 CW';\n }\n return value;\n },\n 'exif:GPSLatitude': calculateGPSValue,\n 'exif:GPSLongitude': calculateGPSValue\n};\n\nfunction calculateGPSValue(value) {\n const [degreesString, minutesString] = value.split(',');\n if ((degreesString !== undefined) && (minutesString !== undefined)) {\n const degrees = parseFloat(degreesString);\n const minutes = parseFloat(minutesString);\n const ref = minutesString.charAt(minutesString.length - 1);\n if ((!Number.isNaN(degrees)) && (!Number.isNaN(minutes))) {\n return '' + (degrees + minutes / 60) + ref;\n }\n }\n return value;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringFromDataView, objectAssign} from './utils.js';\nimport XmpTagNames from './xmp-tag-names.js';\nimport DOMParser from './dom-parser.js';\n\nexport default {\n read\n};\n\nfunction read(dataView, chunks) {\n if (typeof dataView === 'string') {\n return readTags({}, dataView);\n }\n return extractCompleteChunks(dataView, chunks).reduce(readTags, {});\n}\n\n// The first chunk is always the regular XMP document. Then there is something\n// called extended XMP. The extended XMP is also a single XMP document but it\n// can be divided into multiple chunks that need to be combined into one.\nfunction extractCompleteChunks(dataView, chunks) {\n if (chunks.length === 0) {\n return [];\n }\n\n const completeChunks = [combineChunks(dataView, chunks.slice(0, 1))];\n if (chunks.length > 1) {\n completeChunks.push(combineChunks(dataView, chunks.slice(1)));\n }\n\n return completeChunks;\n}\n\nfunction combineChunks(dataView, chunks) {\n const totalLength = chunks.reduce((size, chunk) => size + chunk.length, 0);\n const combinedChunks = new Uint8Array(totalLength);\n let offset = 0;\n\n for (let i = 0; i < chunks.length; i++) {\n const chunk = chunks[i];\n const slice = dataView.buffer.slice(chunk.dataOffset, chunk.dataOffset + chunk.length);\n combinedChunks.set(new Uint8Array(slice), offset);\n offset += chunk.length;\n }\n\n return new DataView(combinedChunks.buffer);\n}\n\nfunction readTags(tags, chunkDataView) {\n try {\n const doc = getDocument(chunkDataView);\n const rdf = getRDF(doc);\n\n return objectAssign(tags, parseXMPObject(convertToObject(rdf, true)));\n } catch (error) {\n return tags;\n }\n}\n\nfunction getDocument(chunkDataView) {\n const Parser = DOMParser.get();\n if (!Parser) {\n console.warn('Warning: DOMParser is not available. It is needed to be able to parse XMP tags.'); // eslint-disable-line no-console\n throw new Error();\n }\n\n const domParser = new Parser();\n const xmlString = typeof chunkDataView === 'string' ? chunkDataView : getStringFromDataView(chunkDataView, 0, chunkDataView.byteLength);\n const doc = domParser.parseFromString(trimXmlSource(xmlString), 'application/xml');\n\n if (doc.documentElement.nodeName === 'parsererror') {\n throw new Error(doc.documentElement.textContent);\n }\n\n return doc;\n}\n\nfunction trimXmlSource(xmlSource) {\n return xmlSource.replace(/^.+(<\\?xpacket begin)/, '$1').replace(/(<\\?xpacket end=\".*\"\\?>).+$/, '$1');\n}\n\nfunction getRDF(node) {\n for (let i = 0; i < node.childNodes.length; i++) {\n if (node.childNodes[i].tagName === 'x:xmpmeta') {\n return getRDF(node.childNodes[i]);\n }\n if (node.childNodes[i].tagName === 'rdf:RDF') {\n return node.childNodes[i];\n }\n }\n\n throw new Error();\n}\n\nfunction convertToObject(node, isTopNode = false) {\n const childNodes = getChildNodes(node);\n\n if (hasTextOnlyContent(childNodes)) {\n if (isTopNode) {\n return {};\n }\n return getTextValue(childNodes[0]);\n }\n\n return getElementsFromNodes(childNodes);\n}\n\nfunction getChildNodes(node) {\n const elements = [];\n\n for (let i = 0; i < node.childNodes.length; i++) {\n elements.push(node.childNodes[i]);\n }\n\n return elements;\n}\n\nfunction hasTextOnlyContent(nodes) {\n return (nodes.length === 1) && (nodes[0].nodeName === '#text');\n}\n\nfunction getTextValue(node) {\n return node.nodeValue;\n}\n\nfunction getElementsFromNodes(nodes) {\n const elements = {};\n\n nodes.forEach((node) => {\n if (isElement(node)) {\n const nodeElement = getElementFromNode(node);\n\n if (elements[node.nodeName] !== undefined) {\n if (!Array.isArray(elements[node.nodeName])) {\n elements[node.nodeName] = [elements[node.nodeName]];\n }\n elements[node.nodeName].push(nodeElement);\n } else {\n elements[node.nodeName] = nodeElement;\n }\n }\n });\n\n return elements;\n}\n\nfunction isElement(node) {\n return (node.nodeName) && (node.nodeName !== '#text');\n}\n\nfunction getElementFromNode(node) {\n return {\n attributes: getAttributes(node),\n value: convertToObject(node)\n };\n}\n\nfunction getAttributes(element) {\n const attributes = {};\n\n for (let i = 0; i < element.attributes.length; i++) {\n attributes[element.attributes[i].nodeName] = decodeURIComponent(escape(element.attributes[i].value));\n }\n\n return attributes;\n}\n\nfunction parseXMPObject(xmpObject) {\n const tags = {};\n\n if (typeof xmpObject === 'string') {\n return xmpObject;\n }\n\n for (const nodeName in xmpObject) {\n let nodes = xmpObject[nodeName];\n\n if (!Array.isArray(nodes)) {\n nodes = [nodes];\n }\n\n nodes.forEach((node) => {\n objectAssign(tags, parseNodeAttributesAsTags(node.attributes));\n if (typeof node.value === 'object') {\n objectAssign(tags, parseNodeChildrenAsTags(node.value));\n }\n });\n }\n\n return tags;\n}\n\nfunction parseNodeAttributesAsTags(attributes) {\n const tags = {};\n\n for (const name in attributes) {\n if (isTagAttribute(name)) {\n tags[getLocalName(name)] = {\n value: attributes[name],\n attributes: {},\n description: getDescription(attributes[name], name)\n };\n }\n }\n\n return tags;\n}\n\nfunction isTagAttribute(name) {\n return (name !== 'rdf:parseType') && (!isNamespaceDefinition(name));\n}\n\nfunction isNamespaceDefinition(name) {\n return name.split(':')[0] === 'xmlns';\n}\n\nfunction getLocalName(name) {\n if (/^MicrosoftPhoto(_\\d+_)?:Rating$/i.test(name)) {\n return 'RatingPercent';\n }\n return name.split(':')[1];\n}\n\nfunction getDescription(value, name = undefined) {\n if (Array.isArray(value)) {\n return getDescriptionOfArray(value);\n }\n if (typeof value === 'object') {\n return getDescriptionOfObject(value);\n }\n\n try {\n if ((name) && (typeof XmpTagNames[name] === 'function')) {\n return XmpTagNames[name](value);\n }\n return decodeURIComponent(escape(value));\n } catch (error) {\n return value;\n }\n}\n\nfunction getDescriptionOfArray(value) {\n return value.map((item) => {\n if (item.value !== undefined) {\n return getDescription(item.value);\n }\n return getDescription(item);\n }).join(', ');\n}\n\nfunction getDescriptionOfObject(value) {\n const descriptions = [];\n\n for (const key in value) {\n descriptions.push(`${getClearTextKey(key)}: ${value[key].value}`);\n }\n\n return descriptions.join('; ');\n}\n\nfunction getClearTextKey(key) {\n if (key === 'CiAdrCity') {\n return 'CreatorCity';\n }\n if (key === 'CiAdrCtry') {\n return 'CreatorCountry';\n }\n if (key === 'CiAdrExtadr') {\n return 'CreatorAddress';\n }\n if (key === 'CiAdrPcode') {\n return 'CreatorPostalCode';\n }\n if (key === 'CiAdrRegion') {\n return 'CreatorRegion';\n }\n if (key === 'CiEmailWork') {\n return 'CreatorWorkEmail';\n }\n if (key === 'CiTelWork') {\n return 'CreatorWorkPhone';\n }\n if (key === 'CiUrlWork') {\n return 'CreatorWorkUrl';\n }\n return key;\n}\n\nfunction parseNodeChildrenAsTags(children) {\n const tags = {};\n\n for (const name in children) {\n if (!isNamespaceDefinition(name)) {\n tags[getLocalName(name)] = parseNodeAsTag(children[name], name);\n }\n }\n\n return tags;\n}\n\nfunction parseNodeAsTag(node, name) {\n if (hasNestedSimpleRdfDescription(node)) {\n return parseNodeAsSimpleRdfDescription(node, name);\n } else if (hasNestedStructureRdfDescription(node)) {\n return parseNodeAsStructureRdfDescription(node, name);\n } else if (isCompactStructure(node)) {\n return parseNodeAsCompactStructure(node, name);\n } else if (isArray(node)) {\n return parseNodeAsArray(node, name);\n }\n return parseNodeAsSimpleValue(node, name);\n}\n\nfunction hasNestedSimpleRdfDescription(node) {\n return ((node.attributes['rdf:parseType'] === 'Resource') && (node.value['rdf:value'] !== undefined))\n || ((node.value['rdf:Description'] !== undefined) && (node.value['rdf:Description'].value['rdf:value'] !== undefined));\n}\n\nfunction parseNodeAsSimpleRdfDescription(node, name) {\n const attributes = parseNodeAttributes(node);\n\n if (node.value['rdf:Description'] !== undefined) {\n node = node.value['rdf:Description'];\n }\n\n objectAssign(attributes, parseNodeAttributes(node), parseNodeChildrenAsAttributes(node));\n\n const value = parseRdfValue(node);\n\n return {\n value,\n attributes,\n description: getDescription(value, name)\n };\n}\n\nfunction parseNodeAttributes(node) {\n const attributes = {};\n\n for (const name in node.attributes) {\n if ((name !== 'rdf:parseType') && (name !== 'rdf:resource') && (!isNamespaceDefinition(name))) {\n attributes[getLocalName(name)] = node.attributes[name];\n }\n }\n\n return attributes;\n}\n\nfunction parseNodeChildrenAsAttributes(node) {\n const attributes = {};\n\n for (const name in node.value) {\n if ((name !== 'rdf:value') && (!isNamespaceDefinition(name))) {\n attributes[getLocalName(name)] = node.value[name].value;\n }\n }\n\n return attributes;\n}\n\nfunction parseRdfValue(node) {\n return getURIValue(node.value['rdf:value']) || node.value['rdf:value'].value;\n}\n\nfunction hasNestedStructureRdfDescription(node) {\n return (node.attributes['rdf:parseType'] === 'Resource')\n || ((node.value['rdf:Description'] !== undefined) && (node.value['rdf:Description'].value['rdf:value'] === undefined));\n}\n\nfunction parseNodeAsStructureRdfDescription(node, name) {\n const tag = {\n value: {},\n attributes: {}\n };\n\n if (node.value['rdf:Description'] !== undefined) {\n objectAssign(tag.value, parseNodeAttributesAsTags(node.value['rdf:Description'].attributes));\n objectAssign(tag.attributes, parseNodeAttributes(node));\n node = node.value['rdf:Description'];\n }\n\n objectAssign(tag.value, parseNodeChildrenAsTags(node.value));\n\n tag.description = getDescription(tag.value, name);\n\n return tag;\n}\n\nfunction isCompactStructure(node) {\n return (Object.keys(node.value).length === 0)\n && (node.attributes['rdf:resource'] === undefined);\n}\n\nfunction parseNodeAsCompactStructure(node, name) {\n const value = parseNodeAttributesAsTags(node.attributes);\n\n return {\n value,\n attributes: {},\n description: getDescription(value, name)\n };\n}\n\nfunction isArray(node) {\n return getArrayChild(node.value) !== undefined;\n}\n\nfunction getArrayChild(value) {\n return value['rdf:Bag'] || value['rdf:Seq'] || value['rdf:Alt'];\n}\n\nfunction parseNodeAsArray(node, name) {\n let items = getArrayChild(node.value).value['rdf:li'];\n const attributes = parseNodeAttributes(node);\n const value = [];\n\n if (items === undefined) {\n items = [];\n } else if (!Array.isArray(items)) {\n items = [items];\n }\n\n items.forEach((item) => {\n value.push(parseArrayValue(item));\n });\n\n return {\n value,\n attributes,\n description: getDescription(value, name)\n };\n}\n\nfunction parseArrayValue(item) {\n if (hasNestedSimpleRdfDescription(item)) {\n return parseNodeAsSimpleRdfDescription(item);\n }\n\n if (hasNestedArrayValue(item)) {\n return parseNodeChildrenAsTags(item.value);\n }\n\n return {\n value: item.value,\n attributes: parseNodeAttributes(item),\n description: getDescription(item.value)\n };\n}\n\nfunction hasNestedArrayValue(node) {\n return node.attributes['rdf:parseType'] === 'Resource';\n}\n\nfunction parseNodeAsSimpleValue(node, name) {\n const value = getURIValue(node) || parseXMPObject(node.value);\n\n return {\n value,\n attributes: parseNodeAttributes(node),\n description: getDescription(value, name)\n };\n}\n\nfunction getURIValue(node) {\n return node.attributes && node.attributes['rdf:resource'];\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {getStringFromDataView} from './utils.js';\n\nexport const iccTags = {\n 'desc': {\n 'name': 'ICC Description',\n },\n 'cprt': {\n 'name': 'ICC Copyright',\n },\n 'dmdd': {\n 'name': 'ICC Device Model Description',\n },\n 'vued': {\n 'name': 'ICC Viewing Conditions Description',\n },\n 'dmnd': {\n 'name': 'ICC Device Manufacturer for Display',\n },\n 'tech': {\n 'name': 'Technology',\n },\n};\n\nexport const iccProfile = {\n 4: {\n 'name': 'Preferred CMM type',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4),\n 'description': (value) => value !== null ? toCompany(value) : '',\n },\n 8: {\n 'name': 'Profile Version',\n 'value': (dataView, offset) => {\n return (dataView.getUint8(offset)).toString(10) + '.'\n + (dataView.getUint8(offset + 1) >> 4).toString(10) + '.'\n + (dataView.getUint8(offset + 1) % 16).toString(10);\n }\n },\n 12: {\n 'name': 'Profile/Device class',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4),\n 'description': (value) => {\n switch (value.toLowerCase()) {\n case 'scnr': return 'Input Device profile';\n case 'mntr': return 'Display Device profile';\n case 'prtr': return 'Output Device profile';\n case 'link': return 'DeviceLink profile';\n case 'abst': return 'Abstract profile';\n case 'spac': return 'ColorSpace profile';\n case 'nmcl': return 'NamedColor profile';\n case 'cenc': return 'ColorEncodingSpace profile';\n case 'mid ': return 'MultiplexIdentification profile';\n case 'mlnk': return 'MultiplexLink profile';\n case 'mvis': return 'MultiplexVisualization profile';\n default: return value;\n }\n }\n },\n 16: {\n 'name': 'Color Space',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4)\n },\n 20: {\n 'name': 'Connection Space',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4)\n },\n 24: {\n 'name': 'ICC Profile Date',\n 'value': (dataView, offset) => parseDate(dataView, offset).toISOString()\n },\n 36: {\n 'name': 'ICC Signature',\n 'value': (dataView, offset) => sliceToString(dataView.buffer.slice(offset, offset + 4))\n },\n 40: {\n 'name': 'Primary Platform',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4),\n 'description': (value) => toCompany(value)\n },\n 48: {\n 'name': 'Device Manufacturer',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4),\n 'description': (value) => toCompany(value)\n },\n 52: {\n 'name': 'Device Model Number',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4)\n },\n 64: {\n 'name': 'Rendering Intent',\n 'value': (dataView, offset) => dataView.getUint32(offset),\n 'description': (value) => {\n switch (value) {\n case 0: return 'Perceptual';\n case 1: return 'Relative Colorimetric';\n case 2: return 'Saturation';\n case 3: return 'Absolute Colorimetric';\n default: return value;\n }\n }\n },\n\n 80: {\n 'name': 'Profile Creator',\n 'value': (dataView, offset) => getStringFromDataView(dataView, offset, 4)\n },\n};\n\nfunction parseDate(dataView, offset) {\n const year = dataView.getUint16(offset);\n const month = dataView.getUint16(offset + 2) - 1;\n const day = dataView.getUint16(offset + 4);\n const hours = dataView.getUint16(offset + 6);\n const minutes = dataView.getUint16(offset + 8);\n const seconds = dataView.getUint16(offset + 10);\n return new Date(Date.UTC(year, month, day, hours, minutes, seconds));\n}\n\nfunction sliceToString(slice) {\n return String.fromCharCode.apply(null, new Uint8Array(slice));\n}\n\nfunction toCompany(value) {\n switch (value.toLowerCase()) {\n case 'appl': return 'Apple';\n case 'adbe': return 'Adobe';\n case 'msft': return 'Microsoft';\n case 'sunw': return 'Sun Microsystems';\n case 'sgi': return 'Silicon Graphics';\n case 'tgnt': return 'Taligent';\n default: return value;\n }\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\nimport {iccTags, iccProfile} from './icc-tag-names.js';\nimport {getStringFromDataView, getUnicodeStringFromDataView} from './utils.js';\n\nexport default {\n read\n};\n\nconst PROFILE_HEADER_LENGTH = 84;\nconst ICC_TAG_COUNT_OFFSET = 128;\nconst ICC_SIGNATURE = 'acsp';\nconst TAG_TYPE_DESC = 'desc';\nconst TAG_TYPE_MULTI_LOCALIZED_UNICODE_TYPE = 'mluc';\nconst TAG_TYPE_TEXT = 'text';\nconst TAG_TYPE_SIGNATURE = 'sig ';\nconst TAG_TABLE_SINGLE_TAG_DATA = 12;\n\n// ICC profile data can be longer than application segment max length of ~64k.\n// so it can be split into multiple APP2 segments. Each segment includes\n// total chunk count and chunk number.\n// Here we read all chunks into single continious array of bytes.\nfunction read(dataView, iccData) {\n try {\n const totalIccProfileLength = iccData.reduce((sum, icc) => sum + icc.length, 0);\n\n const iccBinaryData = new Uint8Array(totalIccProfileLength);\n let offset = 0;\n const buffer = getBuffer(dataView);\n\n for (let chunkNumber = 1; chunkNumber <= iccData.length; chunkNumber++) {\n const iccDataChunk = iccData.find((x) => x.chunkNumber === chunkNumber);\n if (!iccDataChunk) {\n throw new Error(`ICC chunk ${chunkNumber} not found`);\n }\n\n const data = buffer.slice(iccDataChunk.offset, iccDataChunk.offset + iccDataChunk.length);\n const chunkData = new Uint8Array(data);\n\n iccBinaryData.set(chunkData, offset);\n offset += chunkData.length;\n }\n\n return parseTags(new DataView(iccBinaryData.buffer));\n } catch (error) {\n return {};\n }\n}\n\nfunction getBuffer(dataView) {\n if (Array.isArray(dataView)) {\n return (new DataView(Uint8Array.from(dataView).buffer)).buffer;\n }\n return dataView.buffer;\n}\n\nfunction iccDoesNotHaveTagCount(buffer) {\n return buffer.length < (ICC_TAG_COUNT_OFFSET + 4);\n}\n\nfunction hasTagsData(buffer, tagHeaderOffset) {\n return buffer.length < tagHeaderOffset + TAG_TABLE_SINGLE_TAG_DATA;\n}\n\nexport function parseTags(dataView) {\n const buffer = dataView.buffer;\n\n const length = dataView.getUint32();\n if (dataView.byteLength !== length) {\n throw new Error('ICC profile length not matching');\n }\n\n if (dataView.length < PROFILE_HEADER_LENGTH) {\n throw new Error('ICC profile too short');\n }\n\n const tags = {};\n\n const iccProfileKeys = Object.keys(iccProfile);\n for (let i = 0; i < iccProfileKeys.length; i++) {\n const offset = iccProfileKeys[i];\n const profileEntry = iccProfile[offset];\n const value = profileEntry.value(dataView, parseInt(offset, 10));\n let description = value;\n if (profileEntry.description) {\n description = profileEntry.description(value);\n }\n\n tags[profileEntry.name] = {\n value,\n description\n };\n }\n\n const signature = sliceToString(buffer.slice(36, 40));\n if (signature !== ICC_SIGNATURE) {\n throw new Error('ICC profile: missing signature');\n }\n\n /* ICC data is incomplete but we have header parsed so lets return it */\n if (iccDoesNotHaveTagCount(buffer)) {\n return tags;\n }\n\n const tagCount = dataView.getUint32(128);\n let tagHeaderOffset = 132;\n\n for (let i = 0; i < tagCount; i++) {\n if (hasTagsData(buffer, tagHeaderOffset)) {\n // Tags are corrupted (offset too far), return what we parsed until now\n return tags;\n }\n const tagSignature = getStringFromDataView(dataView, tagHeaderOffset, 4);\n const tagOffset = dataView.getUint32(tagHeaderOffset + 4);\n const tagSize = dataView.getUint32(tagHeaderOffset + 8);\n\n if (tagOffset > buffer.length) {\n // Tag data is invalid, lets return what we managed to parse\n return tags;\n }\n const tagType = getStringFromDataView(dataView, tagOffset, 4);\n\n if (tagType === TAG_TYPE_DESC) {\n const tagValueSize = dataView.getUint32(tagOffset + 8);\n if (tagValueSize > tagSize) {\n // Tag data is invalid, lets return what we managed to parse\n return tags;\n }\n\n const val = sliceToString(buffer.slice(tagOffset + 12, tagOffset + tagValueSize + 11));\n addTag(tags, tagSignature, val);\n } else if (tagType === TAG_TYPE_MULTI_LOCALIZED_UNICODE_TYPE) {\n const numRecords = dataView.getUint32(tagOffset + 8);\n const recordSize = dataView.getUint32(tagOffset + 12);\n let offset = tagOffset + 16;\n const val = [];\n for (let recordNum = 0; recordNum < numRecords; recordNum++) {\n const languageCode = getStringFromDataView(dataView, offset + 0, 2);\n const countryCode = getStringFromDataView(dataView, offset + 2, 2);\n const textLength = dataView.getUint32(offset + 4);\n const textOffset = dataView.getUint32(offset + 8);\n\n const text = getUnicodeStringFromDataView(dataView, tagOffset + textOffset, textLength);\n val.push({languageCode, countryCode, text});\n offset += recordSize;\n }\n if (numRecords === 1) {\n addTag(tags, tagSignature, val[0].text);\n } else {\n const valObj = {};\n for (let valIndex = 0; valIndex < val.length; valIndex++) {\n valObj[`${val[valIndex].languageCode}-${val[valIndex].countryCode}`] = val[valIndex].text;\n }\n addTag(tags, tagSignature, valObj);\n }\n } else if (tagType === TAG_TYPE_TEXT) {\n const val = sliceToString(buffer.slice(tagOffset + 8, tagOffset + tagSize - 7));\n addTag(tags, tagSignature, val);\n } else if (tagType === TAG_TYPE_SIGNATURE) {\n const val = sliceToString(buffer.slice(tagOffset + 8, tagOffset + 12));\n addTag(tags, tagSignature, val);\n }\n tagHeaderOffset = tagHeaderOffset + 12;\n }\n\n return tags;\n}\n\nfunction sliceToString(slice) {\n return String.fromCharCode.apply(null, new Uint8Array(slice));\n}\n\nfunction addTag(tags, tagSignature, value) {\n if (iccTags[tagSignature]) {\n tags[iccTags[tagSignature].name] = {value, description: value};\n } else {\n tags[tagSignature] = {value, description: value};\n }\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport Types from './types.js';\n\nexport default {\n read\n};\n\nfunction read(dataView, fileDataOffset) {\n return {\n 'Image Width': getImageWidth(dataView, fileDataOffset),\n 'Image Height': getImageHeight(dataView, fileDataOffset),\n 'Bit Depth': getBitDepth(dataView, fileDataOffset),\n 'Color Type': getColorType(dataView, fileDataOffset),\n 'Compression': getCompression(dataView, fileDataOffset),\n 'Filter': getFilter(dataView, fileDataOffset),\n 'Interlace': getInterlace(dataView, fileDataOffset)\n };\n}\n\nfunction getImageWidth(dataView, fileDataOffset) {\n const OFFSET = 0;\n const SIZE = 4;\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getLongAt(dataView, fileDataOffset);\n return {\n value,\n description: `${value}px`\n };\n}\n\nfunction getImageHeight(dataView, fileDataOffset) {\n const OFFSET = 4;\n const SIZE = 4;\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getLongAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: `${value}px`\n };\n}\n\nfunction getBitDepth(dataView, fileDataOffset) {\n const OFFSET = 8;\n const SIZE = 1;\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: `${value}`\n };\n}\n\nfunction getColorType(dataView, fileDataOffset) {\n const OFFSET = 9;\n const SIZE = 1;\n const COLOR_TYPES = {\n 0: 'Grayscale',\n 2: 'RGB',\n 3: 'Palette',\n 4: 'Grayscale with Alpha',\n 6: 'RGB with Alpha'\n };\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: COLOR_TYPES[value] || 'Unknown'\n };\n}\n\nfunction getCompression(dataView, fileDataOffset) {\n const OFFSET = 10;\n const SIZE = 1;\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: value === 0 ? 'Deflate/Inflate' : 'Unknown'\n };\n}\n\nfunction getFilter(dataView, fileDataOffset) {\n const OFFSET = 11;\n const SIZE = 1;\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: value === 0 ? 'Adaptive' : 'Unknown'\n };\n}\n\nfunction getInterlace(dataView, fileDataOffset) {\n const OFFSET = 12;\n const SIZE = 1;\n const INTERLACE_TYPES = {\n 0: 'Noninterlaced',\n 1: 'Adam7 Interlace'\n };\n\n if (fileDataOffset + OFFSET + SIZE > dataView.byteLength) {\n return undefined;\n }\n\n const value = Types.getByteAt(dataView, fileDataOffset + OFFSET);\n return {\n value,\n description: INTERLACE_TYPES[value] || 'Unknown'\n };\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\nimport {deferInit, getBase64Image} from './utils.js';\n\n// https://exiftool.org/TagNames/EXIF.html#Compression\nconst COMPRESSION_JPEG = [6, 7, 99];\n\nexport default {\n get,\n};\n\nfunction get(dataView, thumbnailTags, tiffHeaderOffset) {\n if (hasJpegThumbnail(thumbnailTags)) {\n thumbnailTags.type = 'image/jpeg';\n const offset = tiffHeaderOffset + thumbnailTags.JPEGInterchangeFormat.value;\n thumbnailTags.image = dataView.buffer.slice(offset, offset + thumbnailTags.JPEGInterchangeFormatLength.value);\n deferInit(thumbnailTags, 'base64', function () {\n return getBase64Image(this.image);\n });\n }\n\n // There is a small possibility of thumbnails in TIFF format but they are\n // not stored as a self-contained image file and would be much more\n // difficult to extract.\n // https://exiftool.org/forum/index.php?topic=3273.msg14778#msg14778\n\n return thumbnailTags;\n}\n\nfunction hasJpegThumbnail(tags) {\n return tags && ((tags.Compression === undefined) || (COMPRESSION_JPEG.includes(tags.Compression.value)))\n && tags.JPEGInterchangeFormat && tags.JPEGInterchangeFormat.value\n && tags.JPEGInterchangeFormatLength && tags.JPEGInterchangeFormatLength.value;\n}\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/. */\n\n/**\n * Thrown when no Exif metadata was found for the given image.\n *\n * @param {string} message The error message.\n */\nfunction MetadataMissingError(message) {\n this.name = 'MetadataMissingError';\n this.message = message || 'No Exif data';\n this.stack = (new Error()).stack;\n}\n\nMetadataMissingError.prototype = new Error;\n\nexport default {\n MetadataMissingError,\n};\n","/**\n * ExifReader\n * http://github.com/mattiasw/exifreader\n * Copyright (C) 2011-2020 Mattias Wallander \n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\n\nimport {objectAssign} from './utils.js';\nimport DataViewWrapper from './dataview.js';\nimport Constants from './constants.js';\nimport {getStringValueFromArray} from './utils.js';\nimport {getCalculatedGpsValue} from './tag-names-utils.js';\nimport ImageHeader from './image-header.js';\nimport Tags from './tags.js';\nimport FileTags from './file-tags.js';\nimport IptcTags from './iptc-tags.js';\nimport XmpTags from './xmp-tags.js';\nimport IccTags from './icc-tags.js';\nimport PngFileTags from './png-file-tags.js';\nimport Thumbnail from './thumbnail.js';\nimport exifErrors from './errors.js';\n\nexport default {\n load,\n loadView,\n errors: exifErrors,\n};\n\nexport const errors = exifErrors;\n\nexport function load(data, options = {expanded: false}) {\n if (isNodeBuffer(data)) {\n // File data read in Node can share the underlying buffer with other\n // data. Therefore it's safest to get a new one to avoid weird bugs.\n data = (new Uint8Array(data)).buffer;\n }\n return loadView(getDataView(data), options);\n}\n\nfunction isNodeBuffer(data) {\n try {\n return Buffer.isBuffer(data); // eslint-disable-line no-undef\n } catch (error) {\n return false;\n }\n}\n\nfunction getDataView(data) {\n try {\n return new DataView(data);\n } catch (error) {\n return new DataViewWrapper(data);\n }\n}\n\nexport function loadView(dataView, options = {expanded: false}) {\n let foundMetaData = false;\n let tags = {};\n\n const {\n fileDataOffset,\n tiffHeaderOffset,\n iptcDataOffset,\n xmpChunks,\n iccChunks,\n mpfDataOffset,\n pngHeaderOffset\n } = ImageHeader.parseAppMarkers(dataView);\n\n if (Constants.USE_JPEG && Constants.USE_FILE && hasFileData(fileDataOffset)) {\n foundMetaData = true;\n const readTags = FileTags.read(dataView, fileDataOffset);\n if (options.expanded) {\n tags.file = readTags;\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n if (Constants.USE_EXIF && hasExifData(tiffHeaderOffset)) {\n foundMetaData = true;\n const readTags = Tags.read(dataView, tiffHeaderOffset);\n if (readTags.Thumbnail) {\n tags.Thumbnail = readTags.Thumbnail;\n delete readTags.Thumbnail;\n }\n\n if (options.expanded) {\n tags.exif = readTags;\n addGpsGroup(tags);\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n\n if (Constants.USE_TIFF && Constants.USE_IPTC && readTags['IPTC-NAA'] && !hasIptcData(iptcDataOffset)) {\n const readIptcTags = IptcTags.read(readTags['IPTC-NAA'].value, 0);\n if (options.expanded) {\n tags.iptc = readIptcTags;\n } else {\n tags = objectAssign({}, tags, readIptcTags);\n }\n }\n\n if (Constants.USE_TIFF && Constants.USE_XMP && readTags['ApplicationNotes'] && !hasXmpData(xmpChunks)) {\n const readXmpTags = XmpTags.read(getStringValueFromArray(readTags['ApplicationNotes'].value));\n if (options.expanded) {\n tags.xmp = readXmpTags;\n } else {\n tags = objectAssign({}, tags, readXmpTags);\n }\n }\n\n if (Constants.USE_TIFF && Constants.USE_ICC && readTags['ICC_Profile'] && !hasIccData(iccChunks)) {\n const readIccTags = IccTags.read(\n readTags['ICC_Profile'].value,\n [{\n offset: 0,\n length: readTags['ICC_Profile'].value.length,\n chunkNumber: 1,\n chunksTotal: 1\n }]\n );\n if (options.expanded) {\n tags.icc = readIccTags;\n } else {\n tags = objectAssign({}, tags, readIccTags);\n }\n }\n }\n\n if (Constants.USE_JPEG && Constants.USE_IPTC && hasIptcData(iptcDataOffset)) {\n foundMetaData = true;\n const readTags = IptcTags.read(dataView, iptcDataOffset);\n if (options.expanded) {\n tags.iptc = readTags;\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n if (Constants.USE_XMP && hasXmpData(xmpChunks)) {\n foundMetaData = true;\n const readTags = XmpTags.read(dataView, xmpChunks);\n if (options.expanded) {\n tags.xmp = readTags;\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n if ((Constants.USE_JPEG || Constants.USE_WEBP) && Constants.USE_ICC && hasIccData(iccChunks)) {\n foundMetaData = true;\n const readTags = IccTags.read(dataView, iccChunks);\n if (options.expanded) {\n tags.icc = readTags;\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n if (Constants.USE_MPF && hasMpfData(mpfDataOffset)) {\n foundMetaData = true;\n const readMpfTags = Tags.readMpf(dataView, mpfDataOffset);\n if (options.expanded) {\n tags.mpf = readMpfTags;\n } else {\n tags = objectAssign({}, tags, readMpfTags);\n }\n }\n\n if (Constants.USE_PNG && Constants.USE_PNG_FILE && hasPngFileData(pngHeaderOffset)) {\n foundMetaData = true;\n const readTags = PngFileTags.read(dataView, pngHeaderOffset);\n if (options.expanded) {\n tags.pngFile = readTags;\n } else {\n tags = objectAssign({}, tags, readTags);\n }\n }\n\n const thumbnail = (Constants.USE_JPEG || Constants.USE_WEBP)\n && Constants.USE_EXIF\n && Constants.USE_THUMBNAIL\n && Thumbnail.get(dataView, tags.Thumbnail, tiffHeaderOffset);\n if (thumbnail) {\n foundMetaData = true;\n tags.Thumbnail = thumbnail;\n } else {\n delete tags.Thumbnail;\n }\n\n if (!foundMetaData) {\n throw new exifErrors.MetadataMissingError();\n }\n\n return tags;\n}\n\nfunction hasFileData(fileDataOffset) {\n return fileDataOffset !== undefined;\n}\n\nfunction hasExifData(tiffHeaderOffset) {\n return tiffHeaderOffset !== undefined;\n}\n\nfunction addGpsGroup(tags) {\n if (tags.exif) {\n if (tags.exif.GPSLatitude && tags.exif.GPSLatitudeRef) {\n try {\n tags.gps = tags.gps || {};\n tags.gps.Latitude = getCalculatedGpsValue(tags.exif.GPSLatitude.value);\n if (tags.exif.GPSLatitudeRef.value.join('') === 'S') {\n tags.gps.Latitude = -tags.gps.Latitude;\n }\n } catch (error) {\n // Ignore.\n }\n }\n\n if (tags.exif.GPSLongitude && tags.exif.GPSLongitudeRef) {\n try {\n tags.gps = tags.gps || {};\n tags.gps.Longitude = getCalculatedGpsValue(tags.exif.GPSLongitude.value);\n if (tags.exif.GPSLongitudeRef.value.join('') === 'W') {\n tags.gps.Longitude = -tags.gps.Longitude;\n }\n } catch (error) {\n // Ignore.\n }\n }\n\n if (tags.exif.GPSAltitude && tags.exif.GPSAltitudeRef) {\n try {\n tags.gps = tags.gps || {};\n tags.gps.Altitude = tags.exif.GPSAltitude.value[0] / tags.exif.GPSAltitude.value[1];\n if (tags.exif.GPSAltitudeRef.value === 1) {\n tags.gps.Altitude = -tags.gps.Altitude;\n }\n } catch (error) {\n // Ignore.\n }\n }\n }\n}\n\nfunction hasIptcData(iptcDataOffset) {\n return iptcDataOffset !== undefined;\n}\n\nfunction hasXmpData(xmpChunks) {\n return Array.isArray(xmpChunks) && xmpChunks.length > 0;\n}\n\nfunction hasIccData(iccDataOffsets) {\n return Array.isArray(iccDataOffsets) && iccDataOffsets.length > 0;\n}\n\nfunction hasMpfData(mpfDataOffset) {\n return mpfDataOffset !== undefined;\n}\n\nfunction hasPngFileData(pngFileDataOffset) {\n return pngFileDataOffset !== undefined;\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/src/xmp-tags.js b/src/xmp-tags.js index e7f467e..5e379e3 100644 --- a/src/xmp-tags.js +++ b/src/xmp-tags.js @@ -217,6 +217,9 @@ function isNamespaceDefinition(name) { } function getLocalName(name) { + if (/^MicrosoftPhoto(_\d+_)?:Rating$/i.test(name)) { + return 'RatingPercent'; + } return name.split(':')[1]; } diff --git a/test/build/update.js b/test/build/update.js index 30cb46e..2974809 100644 --- a/test/build/update.js +++ b/test/build/update.js @@ -1,3 +1,5 @@ +// Add/update a single file: +// npm run test:build:update -- --image= const path = require('path'); const fs = require('fs'); const {execSync} = require('child_process'); diff --git a/test/unit/xmp-tags-spec.js b/test/unit/xmp-tags-spec.js index f48e921..fb1a39c 100644 --- a/test/unit/xmp-tags-spec.js +++ b/test/unit/xmp-tags-spec.js @@ -726,6 +726,32 @@ describe('xmp-tags', () => { } }); }); + + describe('exceptions', () => { + it('should rename MicrosoftPhoto:Rating to RatingPercent', () => { + const xmlString = getXmlString(` + + 3 + 50 + 50 + + `); + const dataView = getDataView(xmlString); + const tags = XmpTags.read(dataView, [{dataOffset: 0, length: xmlString.length}]); + expect(tags).to.deep.equal({ + Rating: { + value: '3', + attributes: {}, + description: '3' + }, + RatingPercent: { + value: '50', + attributes: {}, + description: '50' + } + }); + }); + }); }); function getXmlStringWithPacketWrapper(content) {