Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fengyuanchen/exif

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fengyuanchen/exif - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

5

CHANGELOG.md
# Changelog
## 0.1.1 (Apr 16, 2016)
- Fixed a mistake.
## 0.1.0 (Dec 25, 2015)

@@ -5,0 +10,0 @@

8

demo/js/exif.js
/*!
* Exif v0.1.0
* Exif v0.1.1
* https://github.com/fengyuanchen/exif
*
* Copyright (c) 2015 Fengyuan Chen
* Copyright (c) 2016 Fengyuan Chen
* Released under the MIT license
*
* Date: 2015-12-25T06:51:28.298Z
* Date: 2016-04-16T08:19:39.302Z
*/

@@ -490,3 +490,3 @@

denominator = dataView.getUint32(valueOffset + 4 + 8 * i, littleEndian);
value[i] = value = numerator / denominator;
value[i] = numerator / denominator;
}

@@ -493,0 +493,0 @@ }

/*!
* Exif v0.1.0
* Exif v0.1.1
* https://github.com/fengyuanchen/exif
*
* Copyright (c) 2015 Fengyuan Chen
* Copyright (c) 2016 Fengyuan Chen
* Released under the MIT license
*
* Date: 2015-12-25T06:51:28.298Z
* Date: 2016-04-16T08:19:39.302Z
*/

@@ -490,3 +490,3 @@

denominator = dataView.getUint32(valueOffset + 4 + 8 * i, littleEndian);
value[i] = value = numerator / denominator;
value[i] = numerator / denominator;
}

@@ -493,0 +493,0 @@ }

/*!
* Exif v0.1.0
* Exif v0.1.1
* https://github.com/fengyuanchen/exif
*
* Copyright (c) 2015 Fengyuan Chen
* Copyright (c) 2016 Fengyuan Chen
* Released under the MIT license
*
* Date: 2015-12-25T06:51:28.298Z
* Date: 2016-04-16T08:19:39.302Z
*/
!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=t(e,!0):t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";function i(e){return I.call(e).slice(8,-1).toLowerCase()}function r(e){return"string"==typeof e}function n(e){return"number"==typeof e&&!isNaN(e)}function o(e){return"object"==typeof e&&null!==e}function a(e){var t,i;if(!o(e))return!1;try{return t=e.constructor,i=t.prototype,t&&i&&F.call(i,"isPrototypeOf")}catch(r){return!1}}function s(e){return"function"===i(e)}function d(e){return Array.isArray?Array.isArray(e):"array"===i(e)}function u(e,t){var i=[];return t=t>=0?t:0,Array.from?Array.from(e).slice(t):i.slice.call(e,t)}function l(e,t){var i=-1;return f(t,function(t,r){return t===e?(i=r,!1):void 0}),i}function f(e,t){var i,r;if(e&&s(t))if(d(e)||n(e.length))for(r=0,i=e.length;i>r&&t.call(e,e[r],r,e)!==!1;r++);else if(o(e))for(r in e)if(e.hasOwnProperty(r)&&t.call(e,e[r],r,e)===!1)break;return e}function c(e){var t;if(arguments.length>1){if(t=u(arguments),Object.assign)return Object.assign.apply(Object,t);t.shift(),f(t,function(t){f(t,function(t,i){e[i]=t})})}return e}function g(e,t,i){var r="",n=t;for(i+=t;i>n;n++)r+=String.fromCharCode(e.getUint8(n));return r}function h(e){var t,i=e.replace(y,""),r=atob(i),n=r.length,o=new S(n),a=new Uint8Array(o);for(t=0;n>t;t++)a[t]=r.charCodeAt(t);return o}function p(e,t){this.image=e,this.options=c({},p.DEFAULTS,a(t)&&t),this.tiffTags=null,this.exifTags=null,this.gpsTags=null,this.interoperabilityTags=null,this.init()}var S=e.ArrayBuffer,m=/^data\:/,y=/^data\:([^\;]+)\;base64,/,P=/^data\:image\/jpeg.*;base64,/,T=Object.prototype,I=T.toString,F=T.hasOwnProperty;p.prototype={constructor:p,init:function(){var e,t,i=this,n=this.image;if(n&&S)if(n instanceof Blob)e=new FileReader,e.onerror=e.onabort=function(){i.readEnd("Fails to read image as ArrayBuffer")},e.onload=function(){i.read(this.result)},e.readAsArrayBuffer(n);else if(n instanceof HTMLImageElement&&(n=n.src),r(n)){if(m.test(n))return P.test(n)?this.read(h(n)):this.readEnd();t=new XMLHttpRequest,t.onerror=t.onabort=function(){i.readEnd("Fails to load image as ArrayBuffer")},t.onload=function(){i.read(this.response)},t.open("get",n),t.responseType="arraybuffer",t.send()}},read:function(e){var t,i,r,n,o=this.options,a=new DataView(e),s=this.getSOIOffset(a),d=this.getAPP1Offset(a,s+2),u=d+4,l=d+10;"Exif"===g(a,u,4)?(r=a.getUint16(l),i=18761===r,i||19789===r?(this.littleEndian=i,42===a.getUint16(l+2,i)?(t=a.getUint32(l+4,i),8>t&&(n="Not valid TIFF data (0th IFD offset less than 8)")):n="Not valid TIFF data (no 0x002A)"):n="Not valid TIFF data (no 0x4949 or 0x4D4D)"):n="Not valid Exif data (no Exif ID code)",n||(this.dataView=a,this.tiffOffset=l,this.tiffTags=this.readTags(t,p.TIFF_TAGS),(o.exif||o.interoperability)&&this.readExifTags(),o.gps&&this.readGPSTags(),o.interoperability&&this.readInteroperabilityTags(),this.dataView=null),this.readEnd(n)},getSOIOffset:function(e){for(var t=e.byteLength,i=0,r=0;t>i;){if(255===e.getUint8(i)&&216===e.getUint8(i+1)){r=i;break}i++}return r},getAPP1Offset:function(e,t){for(var i=e.byteLength,r=t;i>t;){if(255===e.getUint8(t)&&225===e.getUint8(t+1)){r=t;break}t++}return r},readTags:function(e,t){var i,r,o,a,s,u=this.options,f=u.ignored,c=this.dataView,g=this.tiffOffset+e,h=this.littleEndian,S=c.getUint16(g,h),m={};for(d(f)&&f.length||(f=!1),s=0;S>s;s++)if(a=g+12*s+2,i=t[c.getUint16(a,h)]){if(f&&l(i,f)>-1)continue;r=this.readTagValue(a,i),o=p.TAG_VALUE_OPTIONS[i],o&&n(r)&&(r=o[r]),m[i]=r}return m},readTagValue:function(e,t){var i,r,n,o,a,s=this.dataView,d=this.littleEndian,u=e+2,f=e+4,c=e+8,h=s.getUint16(u,d),p=s.getUint32(f,d),S=this.tiffOffset+s.getUint32(c,d);switch(h){case 1:case 7:if(1===p)o=s.getUint8(c,d);else if(n=p>4?S:c,l(t,["ExifVersion","FlashpixVersion"])>-1)o=g(s,n,p);else for(o=[],a=0;p>a;a++)o[a]=s.getUint8(n+a);break;case 2:n=p>4?S:c,o=g(s,n,p-1);break;case 3:if(1===p)o=s.getUint16(c,d);else for(n=p>2?S:c,o=[],a=0;p>a;a++)o[a]=s.getUint16(n+2*a,d);break;case 4:if(1===p)o=s.getUint32(c,d);else for(o=[],a=0;p>a;a++)o[a]=s.getUint32(S+4*a,d);break;case 5:if(1===p)r=s.getUint32(S,d),i=s.getUint32(S+4,d),o=r/i;else for(o=[],a=0;p>a;a++)r=s.getUint32(S+8*a,d),i=s.getUint32(S+4+8*a,d),o[a]=o=r/i;break;case 9:if(1===p)o=s.getInt32(c,d);else for(o=[],a=0;p>a;a++)o[a]=s.getInt32(S+4*a,d);break;case 10:if(1===p)r=s.getInt32(S,d),i=s.getInt32(S+4,d),o=r/i;else for(o=[],a=0;p>a;a++)r=s.getInt32(S+8*a,d),i=s.getInt32(S+4+8*a,d),o[a]=r/i}return o},readExifTags:function(){var e=this.tiffTags,t=e&&e.ExifIFDPointer;t&&(this.exifTags=this.readTags(t,p.EXIF_TAGS))},readGPSTags:function(){var e=this.tiffTags,t=e&&e.GPSInfoIFDPointer;t&&(this.gpsTags=this.readTags(t,p.GPS_TAGS))},readInteroperabilityTags:function(){var e=this.exifTags,t=e&&e.InteroperabilityIFDPointer;t&&(this.interoperabilityTags=this.readTags(t,p.INTEROPERABILITY_TAGS))},readEnd:function(e){var t=this.options;e?s(t.fail)&&t.fail.call(this,e):s(t.done)&&t.done.call(this,this.getTags())},getTags:function(){var e=this.options;return c({},this.tiffTags,e.exif&&this.exifTags,e.gps&&this.gpsTags,e.interoperability&&this.interoperabilityTags)}},p.DEFAULTS={exif:!0,gps:!0,interoperability:!0,ignored:["MakerNote","UserComment"],done:null,fail:null},p.TIFF_TAGS={256:"ImageWidth",257:"ImageLength",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:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},p.EXIF_TAGS={36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",42240:"Gamma",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",40962:"PixelXDimension",40963:"PixelYDimension",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:"ExposureBiasValue",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",37396:"SubjectArea",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",40965:"InteroperabilityIFDPointer"},p.GPS_TAGS={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"},p.INTEROPERABILITY_TAGS={1:"InteroperabilityIndex"},p.TAG_VALUE_OPTIONS={Compression:{1:"Uncompressed",6:"JPEG compression"},PhotometricInterpretation:{1:"RGB",6:"YCbCr"},PlanarConfiguration:{1:"Chunky format",2:"Planar format"},YCbCrPositioning:{1:"Centered",2:"Co-sited"},ResolutionUnit:{1:"Inches",2:"Centimeters"},ColorSpace:{1:"sRGB",65535:"Uncalibrated"},ComponentsConfiguration:{0:"Does not exist",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"},ExposureProgram:{0:"Not defined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program (based toward depth of field)",6:"Action program (based toward fast shutter speed)",7:"Portrait mode (for closeup photos with the background out of focus)",8:"Landscape mode (for landscape photos with the background in focus)"},SensitivityType:{0:"Unknown",1:"Standard output sensitivity (SOS)",2:"Recommended exposure index (REI)",3:"ISO speed",4:"Standard output sensitivity (SOS) and recommended exposure index (REI)",5:"Standard output sensitivity (SOS) and ISO speed",6:"Recommended exposure index (REI) and ISO speed",7:"Standard output sensitivity (SOS) and recommended exposure index (REI) and ISO speed"},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 - 5500K)",14:"Cool white fluorescent (W 3800 - 4500K)",15:"White fluorescent (WW 3250 - 3800K)",16:"Warm white fluorescent (WW 2600 - 3250K)",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 light source"},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:"Not defined",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"},FileSource:{0:"Others",1:"Scanner of transparent type",2:"Scanner of reflex type",3:"DSC"},SceneType:{1:"A directly photographed image"},CustomRendered:{0:"Normal process",1:"Custom process"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},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"}};var b=e.Exif;return p.noConflict=function(){return e.Exif=b,p},"function"==typeof define&&define.amd&&define("exif",[],function(){return p}),"undefined"==typeof t&&(e.Exif=p),p});
!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=t(e,!0):t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";function i(e){return I.call(e).slice(8,-1).toLowerCase()}function r(e){return"string"==typeof e}function n(e){return"number"==typeof e&&!isNaN(e)}function o(e){return"object"==typeof e&&null!==e}function a(e){var t,i;if(!o(e))return!1;try{return t=e.constructor,i=t.prototype,t&&i&&F.call(i,"isPrototypeOf")}catch(r){return!1}}function s(e){return"function"===i(e)}function d(e){return Array.isArray?Array.isArray(e):"array"===i(e)}function u(e,t){var i=[];return t=t>=0?t:0,Array.from?Array.from(e).slice(t):i.slice.call(e,t)}function l(e,t){var i=-1;return f(t,function(t,r){return t===e?(i=r,!1):void 0}),i}function f(e,t){var i,r;if(e&&s(t))if(d(e)||n(e.length))for(r=0,i=e.length;i>r&&t.call(e,e[r],r,e)!==!1;r++);else if(o(e))for(r in e)if(e.hasOwnProperty(r)&&t.call(e,e[r],r,e)===!1)break;return e}function c(e){var t;if(arguments.length>1){if(t=u(arguments),Object.assign)return Object.assign.apply(Object,t);t.shift(),f(t,function(t){f(t,function(t,i){e[i]=t})})}return e}function h(e,t,i){var r="",n=t;for(i+=t;i>n;n++)r+=String.fromCharCode(e.getUint8(n));return r}function g(e){var t,i=e.replace(y,""),r=atob(i),n=r.length,o=new S(n),a=new Uint8Array(o);for(t=0;n>t;t++)a[t]=r.charCodeAt(t);return o}function p(e,t){this.image=e,this.options=c({},p.DEFAULTS,a(t)&&t),this.tiffTags=null,this.exifTags=null,this.gpsTags=null,this.interoperabilityTags=null,this.init()}var S=e.ArrayBuffer,m=/^data\:/,y=/^data\:([^\;]+)\;base64,/,P=/^data\:image\/jpeg.*;base64,/,T=Object.prototype,I=T.toString,F=T.hasOwnProperty;p.prototype={constructor:p,init:function(){var e,t,i=this,n=this.image;if(n&&S)if(n instanceof Blob)e=new FileReader,e.onerror=e.onabort=function(){i.readEnd("Fails to read image as ArrayBuffer")},e.onload=function(){i.read(this.result)},e.readAsArrayBuffer(n);else if(n instanceof HTMLImageElement&&(n=n.src),r(n)){if(m.test(n))return P.test(n)?this.read(g(n)):this.readEnd();t=new XMLHttpRequest,t.onerror=t.onabort=function(){i.readEnd("Fails to load image as ArrayBuffer")},t.onload=function(){i.read(this.response)},t.open("get",n),t.responseType="arraybuffer",t.send()}},read:function(e){var t,i,r,n,o=this.options,a=new DataView(e),s=this.getSOIOffset(a),d=this.getAPP1Offset(a,s+2),u=d+4,l=d+10;"Exif"===h(a,u,4)?(r=a.getUint16(l),i=18761===r,i||19789===r?(this.littleEndian=i,42===a.getUint16(l+2,i)?(t=a.getUint32(l+4,i),8>t&&(n="Not valid TIFF data (0th IFD offset less than 8)")):n="Not valid TIFF data (no 0x002A)"):n="Not valid TIFF data (no 0x4949 or 0x4D4D)"):n="Not valid Exif data (no Exif ID code)",n||(this.dataView=a,this.tiffOffset=l,this.tiffTags=this.readTags(t,p.TIFF_TAGS),(o.exif||o.interoperability)&&this.readExifTags(),o.gps&&this.readGPSTags(),o.interoperability&&this.readInteroperabilityTags(),this.dataView=null),this.readEnd(n)},getSOIOffset:function(e){for(var t=e.byteLength,i=0,r=0;t>i;){if(255===e.getUint8(i)&&216===e.getUint8(i+1)){r=i;break}i++}return r},getAPP1Offset:function(e,t){for(var i=e.byteLength,r=t;i>t;){if(255===e.getUint8(t)&&225===e.getUint8(t+1)){r=t;break}t++}return r},readTags:function(e,t){var i,r,o,a,s,u=this.options,f=u.ignored,c=this.dataView,h=this.tiffOffset+e,g=this.littleEndian,S=c.getUint16(h,g),m={};for(d(f)&&f.length||(f=!1),s=0;S>s;s++)if(a=h+12*s+2,i=t[c.getUint16(a,g)]){if(f&&l(i,f)>-1)continue;r=this.readTagValue(a,i),o=p.TAG_VALUE_OPTIONS[i],o&&n(r)&&(r=o[r]),m[i]=r}return m},readTagValue:function(e,t){var i,r,n,o,a,s=this.dataView,d=this.littleEndian,u=e+2,f=e+4,c=e+8,g=s.getUint16(u,d),p=s.getUint32(f,d),S=this.tiffOffset+s.getUint32(c,d);switch(g){case 1:case 7:if(1===p)o=s.getUint8(c,d);else if(n=p>4?S:c,l(t,["ExifVersion","FlashpixVersion"])>-1)o=h(s,n,p);else for(o=[],a=0;p>a;a++)o[a]=s.getUint8(n+a);break;case 2:n=p>4?S:c,o=h(s,n,p-1);break;case 3:if(1===p)o=s.getUint16(c,d);else for(n=p>2?S:c,o=[],a=0;p>a;a++)o[a]=s.getUint16(n+2*a,d);break;case 4:if(1===p)o=s.getUint32(c,d);else for(o=[],a=0;p>a;a++)o[a]=s.getUint32(S+4*a,d);break;case 5:if(1===p)r=s.getUint32(S,d),i=s.getUint32(S+4,d),o=r/i;else for(o=[],a=0;p>a;a++)r=s.getUint32(S+8*a,d),i=s.getUint32(S+4+8*a,d),o[a]=r/i;break;case 9:if(1===p)o=s.getInt32(c,d);else for(o=[],a=0;p>a;a++)o[a]=s.getInt32(S+4*a,d);break;case 10:if(1===p)r=s.getInt32(S,d),i=s.getInt32(S+4,d),o=r/i;else for(o=[],a=0;p>a;a++)r=s.getInt32(S+8*a,d),i=s.getInt32(S+4+8*a,d),o[a]=r/i}return o},readExifTags:function(){var e=this.tiffTags,t=e&&e.ExifIFDPointer;t&&(this.exifTags=this.readTags(t,p.EXIF_TAGS))},readGPSTags:function(){var e=this.tiffTags,t=e&&e.GPSInfoIFDPointer;t&&(this.gpsTags=this.readTags(t,p.GPS_TAGS))},readInteroperabilityTags:function(){var e=this.exifTags,t=e&&e.InteroperabilityIFDPointer;t&&(this.interoperabilityTags=this.readTags(t,p.INTEROPERABILITY_TAGS))},readEnd:function(e){var t=this.options;e?s(t.fail)&&t.fail.call(this,e):s(t.done)&&t.done.call(this,this.getTags())},getTags:function(){var e=this.options;return c({},this.tiffTags,e.exif&&this.exifTags,e.gps&&this.gpsTags,e.interoperability&&this.interoperabilityTags)}},p.DEFAULTS={exif:!0,gps:!0,interoperability:!0,ignored:["MakerNote","UserComment"],done:null,fail:null},p.TIFF_TAGS={256:"ImageWidth",257:"ImageLength",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:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},p.EXIF_TAGS={36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",42240:"Gamma",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",40962:"PixelXDimension",40963:"PixelYDimension",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:"ExposureBiasValue",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",37396:"SubjectArea",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",40965:"InteroperabilityIFDPointer"},p.GPS_TAGS={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"},p.INTEROPERABILITY_TAGS={1:"InteroperabilityIndex"},p.TAG_VALUE_OPTIONS={Compression:{1:"Uncompressed",6:"JPEG compression"},PhotometricInterpretation:{1:"RGB",6:"YCbCr"},PlanarConfiguration:{1:"Chunky format",2:"Planar format"},YCbCrPositioning:{1:"Centered",2:"Co-sited"},ResolutionUnit:{1:"Inches",2:"Centimeters"},ColorSpace:{1:"sRGB",65535:"Uncalibrated"},ComponentsConfiguration:{0:"Does not exist",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"},ExposureProgram:{0:"Not defined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program (based toward depth of field)",6:"Action program (based toward fast shutter speed)",7:"Portrait mode (for closeup photos with the background out of focus)",8:"Landscape mode (for landscape photos with the background in focus)"},SensitivityType:{0:"Unknown",1:"Standard output sensitivity (SOS)",2:"Recommended exposure index (REI)",3:"ISO speed",4:"Standard output sensitivity (SOS) and recommended exposure index (REI)",5:"Standard output sensitivity (SOS) and ISO speed",6:"Recommended exposure index (REI) and ISO speed",7:"Standard output sensitivity (SOS) and recommended exposure index (REI) and ISO speed"},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 - 5500K)",14:"Cool white fluorescent (W 3800 - 4500K)",15:"White fluorescent (WW 3250 - 3800K)",16:"Warm white fluorescent (WW 2600 - 3250K)",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 light source"},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:"Not defined",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"},FileSource:{0:"Others",1:"Scanner of transparent type",2:"Scanner of reflex type",3:"DSC"},SceneType:{1:"A directly photographed image"},CustomRendered:{0:"Normal process",1:"Custom process"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},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"}};var b=e.Exif;return p.noConflict=function(){return e.Exif=b,p},"function"==typeof define&&define.amd&&define("exif",[],function(){return p}),"undefined"==typeof t&&(e.Exif=p),p});
{
"name": "@fengyuanchen/exif",
"description": "JavaScript Exif reader.",
"version": "0.1.0",
"version": "0.1.1",
"main": "dist/exif.js",

@@ -10,3 +10,3 @@ "license": "MIT",

"name": "Fengyuan Chen",
"url": "chenfengyuan.com"
"url": "http://chenfengyuan.com"
},

@@ -24,10 +24,10 @@ "keywords": [

"devDependencies": {
"gulp": "^3.9.0",
"gulp": "^3.9.1",
"gulp-jscs": "^3.0.2",
"gulp-jshint": "^1.12.0",
"gulp-load-plugins": "^1.1.0",
"gulp-load-plugins": "^1.2.2",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.5.4",
"gulp-uglify": "^1.5.1"
"gulp-uglify": "^1.5.3"
}
}

@@ -490,3 +490,3 @@ /*!

denominator = dataView.getUint32(valueOffset + 4 + 8 * i, littleEndian);
value[i] = value = numerator / denominator;
value[i] = numerator / denominator;
}

@@ -493,0 +493,0 @@ }

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc