load-image.all.min.js 23.3 KB
!function(a){"use strict";function s(i,n,a){var o,r=document.createElement("img");function e(e,t){t&&console.log(t),e&&s.isInstanceOf("Blob",e)?o=s.createObjectURL(i=e):(o=i,a&&a.crossOrigin&&(r.crossOrigin=a.crossOrigin)),r.src=o}return r.onerror=function(e){return s.onerror(r,e,i,o,n,a)},r.onload=function(e){return s.onload(r,e,i,o,n,a)},"string"==typeof i?(s.hasMetaOption(a)?s.fetchBlob(i,e,a):e(),r):s.isInstanceOf("Blob",i)||s.isInstanceOf("File",i)?(o=s.createObjectURL(i))?(r.src=o,r):s.readFile(i,function(e){var t=e.target;t&&t.result?r.src=t.result:n&&n(e)}):void 0}var t=a.createObjectURL&&a||a.URL&&URL.revokeObjectURL&&URL||a.webkitURL&&webkitURL;function r(e,t){!e||"blob:"!==e.slice(0,5)||t&&t.noRevoke||s.revokeObjectURL(e)}s.hasMetaOption=function(e){return e&&e.meta},s.fetchBlob=function(e,t){t()},s.isInstanceOf=function(e,t){return Object.prototype.toString.call(t)==="[object "+e+"]"},s.transform=function(e,t,i,n,a){i(e,a)},s.onerror=function(e,t,i,n,a,o){r(n,o),a&&a.call(e,t)},s.onload=function(e,t,i,n,a,o){r(n,o),a&&s.transform(e,o,a,i,{originalWidth:e.naturalWidth||e.width,originalHeight:e.naturalHeight||e.height})},s.createObjectURL=function(e){return!!t&&t.createObjectURL(e)},s.revokeObjectURL=function(e){return!!t&&t.revokeObjectURL(e)},s.readFile=function(e,t,i){if(a.FileReader){var n=new FileReader;if(n.onload=n.onerror=t,n[i=i||"readAsDataURL"])return n[i](e),n}return!1},"function"==typeof define&&define.amd?define(function(){return s}):"object"==typeof module&&module.exports?module.exports=s:a.loadImage=s}("undefined"!=typeof window&&window||this),function(e){"use strict";"function"==typeof define&&define.amd?define(["./load-image"],e):"object"==typeof module&&module.exports?e(require("./load-image")):e(window.loadImage)}(function(x){"use strict";var o=x.transform;x.transform=function(e,t,i,n,a){o.call(x,x.scale(e,t,a),t,i,n,a)},x.transformCoordinates=function(){},x.getTransformedOptions=function(e,t){var i,n,a,o,r=t.aspectRatio;if(!r)return t;for(n in i={},t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n]);return i.crop=!0,r<(a=e.naturalWidth||e.width)/(o=e.naturalHeight||e.height)?(i.maxWidth=o*r,i.maxHeight=o):(i.maxWidth=a,i.maxHeight=a/r),i},x.renderImageToCanvas=function(e,t,i,n,a,o,r,s,l,c,d){var u=e.getContext("2d");return!1===d.imageSmoothingEnabled?u.imageSmoothingEnabled=!1:d.imageSmoothingQuality&&(u.imageSmoothingQuality=d.imageSmoothingQuality),u.drawImage(t,i,n,a,o,r,s,l,c),e},x.hasCanvasOption=function(e){return e.canvas||e.crop||!!e.aspectRatio},x.scale=function(e,t,i){t=t||{};var n,a,o,r,s,l,c,d,u,f,g,m=document.createElement("canvas"),h=e.getContext||x.hasCanvasOption(t)&&m.getContext,p=e.naturalWidth||e.width,A=e.naturalHeight||e.height,b=p,y=A;function S(){var e=Math.max((o||b)/b,(r||y)/y);1<e&&(b*=e,y*=e)}function v(){var e=Math.min((n||b)/b,(a||y)/y);e<1&&(b*=e,y*=e)}if(h&&(c=(t=x.getTransformedOptions(e,t,i)).left||0,d=t.top||0,t.sourceWidth?(s=t.sourceWidth,void 0!==t.right&&void 0===t.left&&(c=p-s-t.right)):s=p-c-(t.right||0),t.sourceHeight?(l=t.sourceHeight,void 0!==t.bottom&&void 0===t.top&&(d=A-l-t.bottom)):l=A-d-(t.bottom||0),b=s,y=l),n=t.maxWidth,a=t.maxHeight,o=t.minWidth,r=t.minHeight,h&&n&&a&&t.crop?(g=s/l-(b=n)/(y=a))<0?(l=a*s/n,void 0===t.top&&void 0===t.bottom&&(d=(A-l)/2)):0<g&&(s=n*l/a,void 0===t.left&&void 0===t.right&&(c=(p-s)/2)):((t.contain||t.cover)&&(o=n=n||o,r=a=a||r),t.cover?(v(),S()):(S(),v())),h){if(1<(u=t.pixelRatio)&&(m.style.width=b+"px",m.style.height=y+"px",b*=u,y*=u,m.getContext("2d").scale(u,u)),0<(f=t.downsamplingRatio)&&f<1&&b<s&&y<l)for(;b<s*f;)m.width=s*f,m.height=l*f,x.renderImageToCanvas(m,e,c,d,s,l,0,0,m.width,m.height,t),d=c=0,s=m.width,l=m.height,(e=document.createElement("canvas")).width=s,e.height=l,x.renderImageToCanvas(e,m,0,0,s,l,0,0,s,l,t);return m.width=b,m.height=y,x.transformCoordinates(m,t),x.renderImageToCanvas(m,e,c,d,s,l,0,0,b,y,t)}return e.width=b,e.height=y,e}}),function(e){"use strict";"function"==typeof define&&define.amd?define(["./load-image"],e):"object"==typeof module&&module.exports?e(require("./load-image")):e(window.loadImage)}(function(m){"use strict";var e="undefined"!=typeof Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice);m.blobSlice=e&&function(){return(this.slice||this.webkitSlice||this.mozSlice).apply(this,arguments)},m.metaDataParsers={jpeg:{65505:[],65517:[]}},m.parseMetaData=function(e,d,u,f){f=f||{};var g=this,t=(u=u||{}).maxMetaDataSize||262144;!!("undefined"!=typeof DataView&&e&&12<=e.size&&"image/jpeg"===e.type&&m.blobSlice)&&m.readFile(m.blobSlice.call(e,0,t),function(e){if(e.target.error)return console.log(e.target.error),void d(f);var t,i,n,a,o=e.target.result,r=new DataView(o),s=2,l=r.byteLength-4,c=s;if(65496===r.getUint16(0)){for(;s<l&&(65504<=(t=r.getUint16(s))&&t<=65519||65534===t);){if(s+(i=r.getUint16(s+2)+2)>r.byteLength){console.log("Invalid meta data: Invalid segment size.");break}if((n=m.metaDataParsers.jpeg[t])&&!u.disableMetaDataParsers)for(a=0;a<n.length;a+=1)n[a].call(g,r,s,i,f,u);c=s+=i}!u.disableImageHead&&6<c&&(o.slice?f.imageHead=o.slice(0,c):f.imageHead=new Uint8Array(o).subarray(0,c))}else console.log("Invalid JPEG file: Missing JPEG marker.");d(f)},"readAsArrayBuffer")||d(f)},m.replaceHead=function(t,i,n){m.parseMetaData(t,function(e){n(new Blob([i,m.blobSlice.call(t,e.imageHead.byteLength)],{type:"image/jpeg"}))},{maxMetaDataSize:256,disableMetaDataParsers:!0})};var o=m.transform;m.transform=function(t,i,n,a,e){m.hasMetaOption(i)?m.parseMetaData(a,function(e){o.call(m,t,i,n,a,e)},i,e):o.apply(m,arguments)}}),function(e){"use strict";"function"==typeof define&&define.amd?define(["./load-image"],e):"object"==typeof module&&module.exports?e(require("./load-image")):e(window.loadImage)}(function(e){"use strict";"undefined"!=typeof fetch&&"undefined"!=typeof Request?e.fetchBlob=function(e,t,i){fetch(new Request(e,i)).then(function(e){return e.blob()}).then(t).catch(function(e){t(null,e)})}:"undefined"!=typeof XMLHttpRequest&&"undefined"!=typeof ProgressEvent&&(e.fetchBlob=function(e,t,i){i=i||{};var n=new XMLHttpRequest;n.open(i.method||"GET",e),i.headers&&Object.keys(i.headers).forEach(function(e){n.setRequestHeader(e,i.headers[e])}),n.withCredentials="include"===i.credentials,n.responseType="blob",n.onload=function(){t(n.response)},n.onerror=n.onabort=n.ontimeout=function(e){t(null,e)},n.send(i.body)})}),function(e){"use strict";"function"==typeof define&&define.amd?define(["./load-image","./load-image-scale","./load-image-meta"],e):"object"==typeof module&&module.exports?e(require("./load-image"),require("./load-image-scale"),require("./load-image-meta")):e(window.loadImage)}(function(l){"use strict";var e,t=l.hasCanvasOption,i=l.hasMetaOption,c=l.transformCoordinates,s=l.getTransformedOptions;(e=document.createElement("img")).onload=function(){l.orientation=1===e.width&&2===e.height},e.src="data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==",l.hasCanvasOption=function(e){return!0==!!e.orientation&&!l.orientation||1<e.orientation&&e.orientation<9||t.call(l,e)},l.hasMetaOption=function(e){return e&&!0===e.orientation&&!l.orientation||i.call(l,e)},l.transformCoordinates=function(e,t){c.call(l,e,t);var i=e.getContext("2d"),n=e.width,a=e.height,o=e.style.width,r=e.style.height,s=t.orientation;if(1<s&&s<9)switch(4<s&&(e.width=a,e.height=n,e.style.width=r,e.style.height=o),s){case 2:i.translate(n,0),i.scale(-1,1);break;case 3:i.translate(n,a),i.rotate(Math.PI);break;case 4:i.translate(0,a),i.scale(1,-1);break;case 5:i.rotate(.5*Math.PI),i.scale(1,-1);break;case 6:i.rotate(.5*Math.PI),i.translate(0,-a);break;case 7:i.rotate(.5*Math.PI),i.translate(n,-a),i.scale(-1,1);break;case 8:i.rotate(-.5*Math.PI),i.translate(-n,0)}},l.getTransformedOptions=function(e,t,i){var n,a,o=s.call(l,e,t),r=o.orientation;if(!0===r){if(l.orientation)return o;r=i&&i.exif&&i.exif.get("Orientation")}if(!(1<r&&r<9))return o;for(a in n={},o)Object.prototype.hasOwnProperty.call(o,a)&&(n[a]=o[a]);switch(n.orientation=r){case 2:n.left=o.right,n.right=o.left;break;case 3:n.left=o.right,n.top=o.bottom,n.right=o.left,n.bottom=o.top;break;case 4:n.top=o.bottom,n.bottom=o.top;break;case 5:n.left=o.top,n.top=o.left,n.right=o.bottom,n.bottom=o.right;break;case 6:n.left=o.top,n.top=o.right,n.right=o.bottom,n.bottom=o.left;break;case 7:n.left=o.bottom,n.top=o.right,n.right=o.top,n.bottom=o.left;break;case 8:n.left=o.bottom,n.top=o.left,n.right=o.top,n.bottom=o.right}return 4<n.orientation&&(n.maxWidth=o.maxHeight,n.maxHeight=o.maxWidth,n.minWidth=o.minHeight,n.minHeight=o.minWidth,n.sourceWidth=o.sourceHeight,n.sourceHeight=o.sourceWidth),n}}),function(e){"use strict";"function"==typeof define&&define.amd?define(["./load-image","./load-image-meta"],e):"object"==typeof module&&module.exports?e(require("./load-image"),require("./load-image-meta")):e(window.loadImage)}(function(a){"use strict";function h(e){e&&(Object.defineProperty(this,"map",{value:this.privateIFDs[e].map}),Object.defineProperty(this,"tags",{value:this.tags&&this.tags[e]||{}}))}h.prototype.map={Orientation:274,Thumbnail:513,Exif:34665,GPSInfo:34853,Interoperability:40965},h.prototype.privateIFDs={34665:{name:"Exif",map:{}},34853:{name:"GPSInfo",map:{}},40965:{name:"Interoperability",map:{}}},h.prototype.get=function(e){return this[e]||this[this.map[e]]};var g={1:{getValue:function(e,t){return e.getUint8(t)},size:1},2:{getValue:function(e,t){return String.fromCharCode(e.getUint8(t))},size:1,ascii:!0},3:{getValue:function(e,t,i){return e.getUint16(t,i)},size:2},4:{getValue:function(e,t,i){return e.getUint32(t,i)},size:4},5:{getValue:function(e,t,i){return e.getUint32(t,i)/e.getUint32(t+4,i)},size:8},9:{getValue:function(e,t,i){return e.getInt32(t,i)},size:4},10:{getValue:function(e,t,i){return e.getInt32(t,i)/e.getInt32(t+4,i)},size:8}};function m(e,t,i,n,a,o){var r,s,l,c,d,u,f=g[n];if(f){if(!((s=4<(r=f.size*a)?t+e.getUint32(i+8,o):i+8)+r>e.byteLength)){if(1===a)return f.getValue(e,s,o);for(l=[],c=0;c<a;c+=1)l[c]=f.getValue(e,s+c*f.size,o);if(f.ascii){for(d="",c=0;c<l.length&&"\0"!==(u=l[c]);c+=1)d+=u;return d}return l}console.log("Invalid Exif data: Invalid data offset.")}else console.log("Invalid Exif data: Invalid tag type.")}function p(e,t,i,n,a,o,r,s){var l,c,d,u,f,g;if(i+6>e.byteLength)console.log("Invalid Exif data: Invalid directory offset.");else{if(!((c=i+2+12*(l=e.getUint16(i,n)))+4>e.byteLength)){for(d=0;d<l;d+=1)u=i+2+12*d,f=e.getUint16(u,n),r&&!r[f]||s&&!0===s[f]||(g=m(e,t,u,e.getUint16(u+2,n),e.getUint32(u+4,n),n),a[f]=g,o&&(o[f]=u));return e.getUint32(c,n)}console.log("Invalid Exif data: Invalid directory size.")}}g[7]=g[1],a.parseExifData=function(c,e,t,d,i){if(!i.disableExif){var u,n,f=i.includeExifTags,g=i.excludeExifTags||{34665:{37500:!0}},m=e+10;if(1165519206===c.getUint32(e+4))if(m+8>c.byteLength)console.log("Invalid Exif data: Invalid segment size.");else if(0===c.getUint16(e+8)){switch(c.getUint16(m)){case 18761:u=!0;break;case 19789:u=!1;break;default:return void console.log("Invalid Exif data: Invalid byte alignment marker.")}42===c.getUint16(m+2,u)?(n=c.getUint32(m+4,u),d.exif=new h,i.disableExifOffsets||(d.exifOffsets=new h,d.exifTiffOffset=m,d.exifLittleEndian=u),(n=p(c,m,m+n,u,d.exif,d.exifOffsets,f,g))&&!i.disableExifThumbnail&&(n=p(c,m,m+n,u,d.exif,d.exifOffsets,f,g),d.exif[513]&&d.exif[514]&&(d.exif[513]=function(e,t,i){if(i&&!(t+i>e.byteLength))return new Blob([e.buffer.slice(t,t+i)],{type:"image/jpeg"});console.log("Invalid Exif data: Invalid thumbnail data.")}(c,m+d.exif[513],d.exif[514]))),Object.keys(d.exif.privateIFDs).forEach(function(e){var t,i,n,a,o,r,s,l;i=e,n=c,a=m,o=u,r=f,s=g,(l=(t=d).exif[i])&&(t.exif[i]=new h(i),t.exifOffsets&&(t.exifOffsets[i]=new h(i)),p(n,a,a+l,o,t.exif[i],t.exifOffsets&&t.exifOffsets[i],r&&r[i],s&&s[i]))})):console.log("Invalid Exif data: Missing TIFF marker.")}else console.log("Invalid Exif data: Missing byte alignment offset.")}},a.metaDataParsers.jpeg[65505].push(a.parseExifData),a.exifWriters={274:function(e,t,i){return new DataView(e,t.exifOffsets[274]+8,2).setUint16(0,i,t.exifLittleEndian),e}},a.writeExifData=function(e,t,i,n){a.exifWriters[t.exif.map[i]](e,t,n)},a.ExifMap=h}),function(e){"use strict";"function"==typeof define&&define.amd?define(["./load-image","./load-image-exif"],e):"object"==typeof module&&module.exports?e(require("./load-image"),require("./load-image-exif")):e(window.loadImage)}(function(e){"use strict";var a=e.ExifMap.prototype;a.tags={256:"ImageWidth",257:"ImageHeight",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright",34665:{36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",42240:"Gamma",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"PhotographicSensitivity",34856:"OECF",34864:"SensitivityType",34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRatio",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:"LensSpecification",42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber"},34853:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential",31:"GPSHPositioningError"},40965:{1:"InteroperabilityIndex"}},a.stringValues={ExposureProgram:{0:"Undefined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},SensingMethod:{1:"Undefined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},ComponentsConfiguration:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"},Orientation:{1:"top-left",2:"top-right",3:"bottom-right",4:"bottom-left",5:"left-top",6:"right-top",7:"right-bottom",8:"left-bottom"}},a.getText=function(e){var t=this.get(e);switch(e){case"LightSource":case"Flash":case"MeteringMode":case"ExposureProgram":case"SensingMethod":case"SceneCaptureType":case"SceneType":case"CustomRendered":case"WhiteBalance":case"GainControl":case"Contrast":case"Saturation":case"Sharpness":case"SubjectDistanceRange":case"FileSource":case"Orientation":return this.stringValues[e][t];case"ExifVersion":case"FlashpixVersion":if(!t)return;return String.fromCharCode(t[0],t[1],t[2],t[3]);case"ComponentsConfiguration":if(!t)return;return this.stringValues[e][t[0]]+this.stringValues[e][t[1]]+this.stringValues[e][t[2]]+this.stringValues[e][t[3]];case"GPSVersionID":if(!t)return;return t[0]+"."+t[1]+"."+t[2]+"."+t[3]}return String(t)},a.getAll=function(){var e,t,i,n={};for(e in this)Object.prototype.hasOwnProperty.call(this,e)&&((t=this[e])&&t.getAll?n[this.privateIFDs[e].name]=t.getAll():(i=this.tags[e])&&(n[i]=this.getText(i)));return n},a.getName=function(e){var t=this.tags[e];return"object"==typeof t?this.privateIFDs[e].name:t},function(){var e,t,i,n=a.tags;for(e in n)if(Object.prototype.hasOwnProperty.call(n,e))if(t=a.privateIFDs[e])for(e in i=n[e])Object.prototype.hasOwnProperty.call(i,e)&&(t.map[i[e]]=Number(e));else a.map[n[e]]=Number(e)}()}),function(e){"use strict";"function"==typeof define&&define.amd?define(["./load-image","./load-image-meta"],e):"object"==typeof module&&module.exports?e(require("./load-image"),require("./load-image-meta")):e(window.loadImage)}(function(e){"use strict";function g(){}function m(e,t,i,n,a){return"binary"===t.types[e]?new Blob([i.buffer.slice(n,n+a)]):"Uint16"===t.types[e]?i.getUint16(n):function(e,t,i){for(var n="",a=t+i,o=t;o<a;o+=1)n+=String.fromCharCode(e.getUint8(o));return n}(i,n,a)}function h(e,t,i,n,a,o){for(var r,s,l,c,d,u=t+i,f=t;f<u;)28===e.getUint8(f)&&2===e.getUint8(f+1)&&(l=e.getUint8(f+2),a&&!a[l]||o&&o[l]||(s=e.getInt16(f+3),r=m(l,n.iptc,e,f+5,s),n.iptc[l]=(c=n.iptc[l],d=r,void 0===c?d:c instanceof Array?(c.push(d),c):[c,d]),n.iptcOffsets&&(n.iptcOffsets[l]=f))),f+=1}g.prototype.map={ObjectName:5},g.prototype.types={0:"Uint16",200:"Uint16",201:"Uint16",202:"binary"},g.prototype.get=function(e){return this[e]||this[this.map[e]]},e.parseIptcData=function(e,t,i,n,a){if(!a.disableIptc)for(var o,r,s,l,c=t+i;t+8<c;){if(l=t,943868237===(s=e).getUint32(l)&&1028===s.getUint16(l+4)){var d=(o=t,r=void 0,(r=e.getUint8(o+7))%2!=0&&(r+=1),0===r&&(r=4),r),u=t+8+d;if(c<u){console.log("Invalid IPTC data: Invalid segment offset.");break}var f=e.getUint16(t+6+d);if(c<t+f){console.log("Invalid IPTC data: Invalid segment size.");break}return n.iptc=new g,a.disableIptcOffsets||(n.iptcOffsets=new g),void h(e,u,f,n,a.includeIptcTags,a.excludeIptcTags||{202:!0})}t+=1}},e.metaDataParsers.jpeg[65517].push(e.parseIptcData),e.IptcMap=g}),function(e){"use strict";"function"==typeof define&&define.amd?define(["./load-image","./load-image-iptc"],e):"object"==typeof module&&module.exports?e(require("./load-image"),require("./load-image-iptc")):e(window.loadImage)}(function(e){"use strict";var n=e.IptcMap.prototype;n.tags={0:"ApplicationRecordVersion",3:"ObjectTypeReference",4:"ObjectAttributeReference",5:"ObjectName",7:"EditStatus",8:"EditorialUpdate",10:"Urgency",12:"SubjectReference",15:"Category",20:"SupplementalCategories",22:"FixtureIdentifier",25:"Keywords",26:"ContentLocationCode",27:"ContentLocationName",30:"ReleaseDate",35:"ReleaseTime",37:"ExpirationDate",38:"ExpirationTime",40:"SpecialInstructions",42:"ActionAdvised",45:"ReferenceService",47:"ReferenceDate",50:"ReferenceNumber",55:"DateCreated",60:"TimeCreated",62:"DigitalCreationDate",63:"DigitalCreationTime",65:"OriginatingProgram",70:"ProgramVersion",75:"ObjectCycle",80:"Byline",85:"BylineTitle",90:"City",92:"Sublocation",95:"State",100:"CountryCode",101:"Country",103:"OriginalTransmissionReference",105:"Headline",110:"Credit",115:"Source",116:"CopyrightNotice",118:"Contact",120:"Caption",121:"LocalCaption",122:"Writer",125:"RasterizedCaption",130:"ImageType",131:"ImageOrientation",135:"LanguageIdentifier",150:"AudioType",151:"AudioSamplingRate",152:"AudioSamplingResolution",153:"AudioDuration",154:"AudioOutcue",184:"JobID",185:"MasterDocumentID",186:"ShortDocumentID",187:"UniqueDocumentID",188:"OwnerID",200:"ObjectPreviewFileFormat",201:"ObjectPreviewFileVersion",202:"ObjectPreviewData",221:"Prefs",225:"ClassifyState",228:"SimilarityIndex",230:"DocumentNotes",231:"DocumentHistory",232:"ExifCameraInfo",255:"CatalogSets"},n.stringValues={10:{0:"0 (reserved)",1:"1 (most urgent)",2:"2",3:"3",4:"4",5:"5 (normal urgency)",6:"6",7:"7",8:"8 (least urgent)",9:"9 (user-defined priority)"},75:{a:"Morning",b:"Both Morning and Evening",p:"Evening"},131:{L:"Landscape",P:"Portrait",S:"Square"}},n.getText=function(e){var t=this.get(e),i=this.map[e],n=this.stringValues[i];return n?n[t]:String(t)},n.getAll=function(){var e,t,i={};for(e in this)Object.prototype.hasOwnProperty.call(this,e)&&(t=this.tags[e])&&(i[t]=this.getText(t));return i},n.getName=function(e){return this.tags[e]},function(){var e,t=n.tags,i=n.map||{};for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&(i[t[e]]=Number(e))}()});
//# sourceMappingURL=load-image.all.min.js.map