First commit

This commit is contained in:
2026-01-12 13:12:46 +01:00
parent b2d9501f6d
commit a1fbd8acf5
4413 changed files with 1245183 additions and 0 deletions

5
node_modules/jpeg-exif/.babelrc generated vendored Normal file
View File

@@ -0,0 +1,5 @@
{
"presets": [
"env"
]
}

3
node_modules/jpeg-exif/.eslintrc.json generated vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"extends": "airbnb-base"
}

7
node_modules/jpeg-exif/.travis.yml generated vendored Normal file
View File

@@ -0,0 +1,7 @@
language: node_js
node_js:
- "10"
before_script:
- "npm i mocha chai coveralls istanbul"
after_success:
- "rm -rf ./coverage && npm r mocha chai istanbul coveralls"

22
node_modules/jpeg-exif/LICENSE.txt generated vendored Normal file
View File

@@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2015 邵振华
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

77
node_modules/jpeg-exif/README.md generated vendored Normal file
View File

@@ -0,0 +1,77 @@
# jpeg-exif
Get exif information from jpeg format file. Works with TIFF too!
[![npm](https://img.shields.io/npm/dm/jpeg-exif.svg)][npm-url] [![Inline docs](http://inch-ci.org/github/zhso/jpeg-exif.svg?branch=master&style=shields)](http://inch-ci.org/github/zhso/jpeg-exif) [![Build Status](https://travis-ci.org/zhso/jpeg-exif.svg?branch=master)](https://travis-ci.org/zhso/jpeg-exif) [![Coverage Status](https://coveralls.io/repos/github/zhso/jpeg-exif/badge.svg?branch=master)](https://coveralls.io/github/zhso/jpeg-exif?branch=master)
[npm-url]: https://npmjs.org/package/jpeg-exif
### Async
```js
import exif from "jpeg-exif";
const filePath = "~/Photo/IMG_0001.JPG";
exif.parse(filePath, (err, data) => {
if (err) {
console.log(err);
} else {
console.log(data);
}
});
```
### Sync
```js
import exif from "jpeg-exif";
const filePath = "~/Photo/IMG_0001.JPG";
const data = exif.parseSync(filePath);
console.log(data);
```
## From Buffer
```js
import fs from "fs";
import exif from "jpeg-exif";
const filePath = "~/Documents/DOC_0001.TIFF";
const buffer = fs.readFileSync(filePath);
const data = exif.fromBuffer(buffer);
console.log(data);
```
## Features
* Support All CP3451 Standard Tags (Include GPS & SubExif Tags)
* Support Sync, Async
* Support pass Buffer Type
## Installation
```bash
$ npm i jpeg-exif
```
## Callback Data Format
```js
{
"Make": "Apple",
"Model": "Apple",
//...
"SubExif": [
"DateTimeOriginal": "2015:10:06 17:19:36",
"CreateDate": "2015:10:06 17:19:36",
//...
],
"GPSInfo":[
"GPSLatitudeRef": "N",
"GPSLatitude": [ 35, 39, 40.08 ],
//...
]
}
```

376
node_modules/jpeg-exif/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,376 @@
'use strict';
var _fs = require('fs');
var _fs2 = _interopRequireDefault(_fs);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var tags = require('./tags.json');
/*
unsignedByte,
asciiStrings,
unsignedShort,
unsignedLong,
unsignedRational,
signedByte,
undefined,
signedShort,
signedLong,
signedRational,
singleFloat,
doubleFloat
*/
var bytes = [0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8];
var SOIMarkerLength = 2;
var JPEGSOIMarker = 0xffd8;
var TIFFINTEL = 0x4949;
var TIFFMOTOROLA = 0x4d4d;
var APPMarkerLength = 2;
var APPMarkerBegin = 0xffe0;
var APPMarkerEnd = 0xffef;
var data = void 0;
/**
* @param buffer {Buffer}
* @returns {Boolean}
* @example
* var content = fs.readFileSync("~/Picture/IMG_0911.JPG");
* var isImage = isValid(content);
* console.log(isImage);
*/
var isValid = function isValid(buffer) {
try {
var SOIMarker = buffer.readUInt16BE(0);
return SOIMarker === JPEGSOIMarker;
} catch (e) {
throw new Error('Unsupport file format.');
}
};
/**
* @param buffer {Buffer}
* @returns {Boolean}
* @example
*/
var isTiff = function isTiff(buffer) {
try {
var SOIMarker = buffer.readUInt16BE(0);
return SOIMarker === TIFFINTEL || SOIMarker === TIFFMOTOROLA;
} catch (e) {
throw new Error('Unsupport file format.');
}
};
/**
* @param buffer {Buffer}
* @returns {Number}
* @example
* var content = fs.readFileSync("~/Picture/IMG_0911.JPG");
* var APPNumber = checkAPPn(content);
* console.log(APPNumber);
*/
var checkAPPn = function checkAPPn(buffer) {
try {
var APPMarkerTag = buffer.readUInt16BE(0);
var isInRange = APPMarkerTag >= APPMarkerBegin && APPMarkerTag <= APPMarkerEnd;
return isInRange ? APPMarkerTag - APPMarkerBegin : false;
} catch (e) {
throw new Error('Invalid APP Tag.');
}
};
/**
* @param buffer {Buffer}
* @param tagCollection {Object}
* @param order {Boolean}
* @param offset {Number}
* @returns {Object}
* @example
* var content = fs.readFileSync("~/Picture/IMG_0911.JPG");
* var exifFragments = IFDHandler(content, 0, true, 8);
* console.log(exifFragments.value);
*/
var IFDHandler = function IFDHandler(buffer, tagCollection, order, offset) {
var entriesNumber = order ? buffer.readUInt16BE(0) : buffer.readUInt16LE(0);
if (entriesNumber === 0) {
return {};
}
var entriesNumberLength = 2;
var entries = buffer.slice(entriesNumberLength);
var entryLength = 12;
// let nextIFDPointerBegin = entriesNumberLength + entryLength * entriesNumber;
// let bigNextIFDPointer= buffer.readUInt32BE(nextIFDPointerBegin) ;
// let littleNextIFDPointer= buffer.readUInt32LE(nextIFDPointerBegin);
// let nextIFDPointer = order ?bigNextIFDPointer:littleNextIFDPointer;
var exif = {};
var entryCount = 0;
for (entryCount; entryCount < entriesNumber; entryCount += 1) {
var entryBegin = entryCount * entryLength;
var entry = entries.slice(entryBegin, entryBegin + entryLength);
var tagBegin = 0;
var tagLength = 2;
var dataFormatBegin = tagBegin + tagLength;
var dataFormatLength = 2;
var componentsBegin = dataFormatBegin + dataFormatLength;
var componentsNumberLength = 4;
var dataValueBegin = componentsBegin + componentsNumberLength;
var dataValueLength = 4;
var tagAddress = entry.slice(tagBegin, dataFormatBegin);
var tagNumber = order ? tagAddress.toString('hex') : tagAddress.reverse().toString('hex');
var tagName = tagCollection[tagNumber];
var bigDataFormat = entry.readUInt16BE(dataFormatBegin);
var littleDataFormat = entry.readUInt16LE(dataFormatBegin);
var dataFormat = order ? bigDataFormat : littleDataFormat;
var componentsByte = bytes[dataFormat];
var bigComponentsNumber = entry.readUInt32BE(componentsBegin);
var littleComponentNumber = entry.readUInt32LE(componentsBegin);
var componentsNumber = order ? bigComponentsNumber : littleComponentNumber;
var dataLength = componentsNumber * componentsByte;
var dataValue = entry.slice(dataValueBegin, dataValueBegin + dataValueLength);
if (dataLength > 4) {
var dataOffset = (order ? dataValue.readUInt32BE(0) : dataValue.readUInt32LE(0)) - offset;
dataValue = buffer.slice(dataOffset, dataOffset + dataLength);
}
var tagValue = void 0;
if (tagName) {
switch (dataFormat) {
case 1:
tagValue = dataValue.readUInt8(0);
break;
case 2:
tagValue = dataValue.toString('ascii').replace(/\0+$/, '');
break;
case 3:
tagValue = order ? dataValue.readUInt16BE(0) : dataValue.readUInt16LE(0);
break;
case 4:
tagValue = order ? dataValue.readUInt32BE(0) : dataValue.readUInt32LE(0);
break;
case 5:
tagValue = [];
for (var i = 0; i < dataValue.length; i += 8) {
var bigTagValue = dataValue.readUInt32BE(i) / dataValue.readUInt32BE(i + 4);
var littleTagValue = dataValue.readUInt32LE(i) / dataValue.readUInt32LE(i + 4);
tagValue.push(order ? bigTagValue : littleTagValue);
}
break;
case 7:
switch (tagName) {
case 'ExifVersion':
tagValue = dataValue.toString();
break;
case 'FlashPixVersion':
tagValue = dataValue.toString();
break;
case 'SceneType':
tagValue = dataValue.readUInt8(0);
break;
default:
tagValue = '0x' + dataValue.toString('hex', 0, 15);
break;
}
break;
case 10:
{
var bigOrder = dataValue.readInt32BE(0) / dataValue.readInt32BE(4);
var littleOrder = dataValue.readInt32LE(0) / dataValue.readInt32LE(4);
tagValue = order ? bigOrder : littleOrder;
break;
}
default:
tagValue = '0x' + dataValue.toString('hex');
break;
}
exif[tagName] = tagValue;
}
/*
else {
console.log(`Unkown Tag [0x${tagNumber}].`);
}
*/
}
return exif;
};
/**
* @param buf {Buffer}
* @returns {Undefined}
* @example
* var content = fs.readFileSync("~/Picture/IMG_0911.JPG");
* var exifFragments = EXIFHandler(content);
*/
var EXIFHandler = function EXIFHandler(buf) {
var pad = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
var buffer = buf;
if (pad) {
buffer = buf.slice(APPMarkerLength);
var length = buffer.readUInt16BE(0);
buffer = buffer.slice(0, length);
var lengthLength = 2;
buffer = buffer.slice(lengthLength);
var identifierLength = 5;
buffer = buffer.slice(identifierLength);
var padLength = 1;
buffer = buffer.slice(padLength);
}
var byteOrderLength = 2;
var byteOrder = buffer.toString('ascii', 0, byteOrderLength) === 'MM';
var fortyTwoLength = 2;
var fortyTwoEnd = byteOrderLength + fortyTwoLength;
var big42 = buffer.readUInt32BE(fortyTwoEnd);
var little42 = buffer.readUInt32LE(fortyTwoEnd);
var offsetOfIFD = byteOrder ? big42 : little42;
buffer = buffer.slice(offsetOfIFD);
if (buffer.length > 0) {
data = IFDHandler(buffer, tags.ifd, byteOrder, offsetOfIFD);
if (data.ExifIFDPointer) {
buffer = buffer.slice(data.ExifIFDPointer - offsetOfIFD);
data.SubExif = IFDHandler(buffer, tags.ifd, byteOrder, data.ExifIFDPointer);
}
if (data.GPSInfoIFDPointer) {
var gps = data.GPSInfoIFDPointer;
buffer = buffer.slice(data.ExifIFDPointer ? gps - data.ExifIFDPointer : gps - offsetOfIFD);
data.GPSInfo = IFDHandler(buffer, tags.gps, byteOrder, gps);
}
}
};
/**
* @param buffer {Buffer}
* @returns {Undefined}
* @example
* var content = fs.readFileSync("~/Picture/IMG_0911.JPG");
* var exifFragments = APPnHandler(content);
*/
var APPnHandler = function APPnHandler(buffer) {
var APPMarkerTag = checkAPPn(buffer);
if (APPMarkerTag !== false) {
// APP0 is 0, and 0==false
var length = buffer.readUInt16BE(APPMarkerLength);
switch (APPMarkerTag) {
case 1:
// EXIF
EXIFHandler(buffer);
break;
default:
APPnHandler(buffer.slice(APPMarkerLength + length));
break;
}
}
};
/**
* @param buffer {Buffer}
* @returns {Object}
* @example
*/
var fromBuffer = function fromBuffer(buffer) {
if (!buffer) {
throw new Error('buffer not found');
}
data = undefined;
if (isValid(buffer)) {
buffer = buffer.slice(SOIMarkerLength);
data = {};
APPnHandler(buffer);
} else if (isTiff(buffer)) {
data = {};
EXIFHandler(buffer, false);
}
return data;
};
/**
* @param file {String}
* @returns {Object}
* @example
* var exif = sync("~/Picture/IMG_1981.JPG");
* console.log(exif.createTime);
*/
var sync = function sync(file) {
if (!file) {
throw new Error('File not found');
}
var buffer = _fs2.default.readFileSync(file);
return fromBuffer(buffer);
};
/**
* @param file {String}
* @param callback {Function}
* @example
* async("~/Picture/IMG_0707.JPG", (err, data) => {
* if(err) {
* console.log(err);
* }
* if(data) {
* console.log(data.ExifOffset.createTime);
* }
* }
*/
var async = function async(file, callback) {
data = undefined;
new Promise(function (resolve, reject) {
if (!file) {
reject(new Error('❓File not found.'));
}
_fs2.default.readFile(file, function (err, buffer) {
if (err) {
reject(err);
} else {
try {
if (isValid(buffer)) {
var buf = buffer.slice(SOIMarkerLength);
data = {};
APPnHandler(buf);
resolve(data);
} else if (isTiff(buffer)) {
data = {};
EXIFHandler(buffer, false);
resolve(data);
} else {
reject(new Error('😱Unsupport file type.'));
}
} catch (e) {
reject(e);
}
}
});
}, function (error) {
callback(error, undefined);
}).then(function (d) {
callback(undefined, d);
}).catch(function (error) {
callback(error, undefined);
});
};
exports.fromBuffer = fromBuffer;
exports.parse = async;
exports.parseSync = sync;
//# sourceMappingURL=index.js.map

1
node_modules/jpeg-exif/lib/index.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

348
node_modules/jpeg-exif/lib/plus.json generated vendored Normal file
View File

@@ -0,0 +1,348 @@
{
"00fe": "SubfileType",
"00ff": "OldSubfileType",
"000b": "ProcessingSoftware",
"0001": "InteropIndex",
"01b1": "Decode",
"01b2": "DefaultImageColor",
"01b3": "T82Options",
"01b5": "JPEGTables",
"0002": "InteropVersion",
"02bc": "XMP",
"03e7": "USPTOMiscellaneous",
"9c9b": "XPTitle",
"9c9c": "XPComment",
"9c9d": "XPAuthor",
"9c9e": "XPKeywords",
"9c9f": "XPSubject",
"010a": "FillOrder",
"010d": "DocumentName",
"011d": "PageName",
"011e": "XPosition",
"011f": "YPosition",
"012c": "ColorResponseUnit",
"013c": "HostComputer",
"013d": "Predictor",
"014a": "SubIFD",
"014c": "InkSet",
"014d": "InkNames",
"014e": "NumberOfInks",
"015a": "Indexed",
"015b": "JPEGTables",
"015f": "OPIProxy",
"022f": "StripRowCounts",
"80a3": "WangTag1",
"80a4": "WangAnnotation",
"80a5": "WangTag3",
"80a6": "WangTag4",
"80b8": "ImageReferencePoints",
"80b9": "RegionXformTackPoint",
"80ba": "WarpQuadrilateral",
"80bb": "AffineTransformMat",
"80e3": "Matteing",
"80e4": "DataType",
"80e5": "ImageDepth",
"80e6": "TileDepth",
"82a5": "MDFileTag",
"82a6": "MDScalePixel",
"82a7": "MDColorTable",
"82a8": "MDLabName",
"82a9": "MDSampleInfo",
"82aa": "MDPrepDate",
"82ab": "MDPrepTime",
"82ac": "MDFileUnits",
"83bb": "IPTC-NAA",
"84e0": "Site",
"84e1": "ColorSequence",
"84e2": "IT8Header",
"84e3": "RasterPadding",
"84e4": "BitsPerRunLength",
"84e5": "BitsPerExtendedRunLength",
"84e6": "ColorTable",
"84e7": "ImageColorIndicator",
"84e8": "BackgroundColorIndicator",
"84e9": "ImageColorValue",
"84ea": "BackgroundColorValue",
"84eb": "PixelIntensityRange",
"84ec": "TransparencyIndicator",
"84ed": "ColorCharacterization",
"84ee": "HCUsage",
"84ef": "TrapIndicator",
"84f0": "CMYKEquivalent",
"85b8": "PixelMagicJBIGOptions",
"85d7": "JPLCartoIFD",
"85d8": "ModelTransform",
"87ac": "ImageLayer",
"87af": "GeoTiffDirectory",
"87b0": "GeoTiffDoubleParams",
"87b1": "GeoTiffAsciiParams",
"87be": "JBIGOptions",
"0107": "Thresholding",
"0108": "CellWidth",
"0109": "CellLength",
"0118": "MinSampleValue",
"0119": "MaxSampleValue",
"0120": "FreeOffsets",
"0121": "FreeByteCounts",
"0122": "GrayResponseUnit",
"0123": "GrayResponseCurve",
"0124": "T4Options",
"0125": "T6Options",
"0129": "PageNumber",
"0140": "ColorMap",
"0141": "HalftoneHints",
"0142": "TileWidth",
"0143": "TileLength",
"0144": "TileOffsets",
"0145": "TileByteCounts",
"0146": "BadFaxLines",
"0147": "CleanFaxData",
"0148": "ConsecutiveBadFaxLines",
"0150": "DotRange",
"0151": "TargetPrinter",
"0152": "ExtraSamples",
"0153": "SampleFormat",
"0154": "SMinSampleValue",
"0155": "SMaxSampleValue",
"0156": "TransferRange",
"0157": "ClipPath",
"0158": "XClipPathUnits",
"0159": "YClipPathUnits",
"0190": "GlobalParametersIFD",
"0191": "ProfileType",
"0192": "FaxProfile",
"0193": "CodingMethods",
"0194": "VersionYear",
"0195": "ModeNumber",
"0200": "JPEGProc",
"0203": "JPEGRestartInterval",
"0205": "JPEGLosslessPredictors",
"0206": "JPEGPointTransforms",
"0207": "JPEGQTables",
"0208": "JPEGDCTables",
"0209": "JPEGACTables",
"800d": "ImageID",
"821a": "MatrixWorldToCamera",
"827d": "Model2",
"828d": "CFARepeatPatternDim",
"828e": "CFAPattern2",
"828f": "BatteryLevel",
"830e": "PixelScale",
"835c": "UIC1Tag",
"835d": "UIC2Tag",
"835e": "UIC3Tag",
"835f": "UIC4Tag",
"847e": "IntergraphPacketData",
"847f": "IntergraphFlagRegisters",
"877f": "TIFF_FXExtensions",
"882a": "TimeZoneOffset",
"882b": "SelfTimerMode",
"885c": "FaxRecvParams",
"885d": "FaxSubAddress",
"885e": "FaxRecvTime",
"888a": "LeafSubIFD",
"920b": "FlashEnergy",
"920c": "SpatialFrequencyResponse",
"920d": "Noise",
"920e": "FocalPlaneXResolution",
"920f": "FocalPlaneYResolution",
"923a": "CIP3DataFile",
"923b": "CIP3Sheet",
"923c": "CIP3Side",
"923f": "StoNits",
"932f": "MSDocumentText",
"935c": "ImageSourceData",
"1000": "RelatedImageFileFormat",
"1001": "RelatedImageWidth",
"1002": "RelatedImageHeight",
"4746": "Rating",
"4747": "XP_DIP_XML",
"4748": "StitchInfo",
"4749": "RatingPercent",
"7035": "ChromaticAberrationCorrParams",
"7037": "DistortionCorrParams",
"8214": "ImageFullWidth",
"8215": "ImageFullHeight",
"8216": "TextureFormat",
"8217": "WrapModes",
"8218": "FovCot",
"8219": "MatrixWorldToScreen",
"8290": "KodakIFD",
"8335": "AdventScale",
"8336": "AdventRevision",
"8480": "IntergraphMatrix",
"8481": "INGRReserved",
"8482": "ModelTiePoint",
"8546": "SEMInfo",
"8568": "AFCP_IPTC",
"8602": "WB_GRGBLevels",
"8606": "LeafData",
"8649": "PhotoshopSettings",
"8773": "ICC_Profile",
"8780": "MultiProfiles",
"8781": "SharedData",
"8782": "T88Options",
"8829": "Interlace",
"8871": "FedexEDR",
"9009": "GooglePlusUploadCode",
"9210": "FocalPlaneResolutionUnit",
"9211": "ImageNumber",
"9212": "SecurityClassification",
"9213": "ImageHistory",
"9215": "ExposureIndex",
"9216": "TIFF-EPStandardID",
"9217": "SensingMethod",
"9330": "MSPropertySetStorage",
"9331": "MSDocumentTextPosition",
"a20d": "Noise",
"a211": "ImageNumber",
"a212": "SecurityClassification",
"a213": "ImageHistory",
"a216": "TIFF-EPStandardID",
"a480": "GDALMetadata",
"a481": "GDALNoData",
"afc0": "ExpandSoftware",
"afc1": "ExpandLens",
"afc2": "ExpandFilm",
"afc3": "ExpandFilterLens",
"afc4": "ExpandScanner",
"afc5": "ExpandFlashLamp",
"bc01": "PixelFormat",
"bc02": "Transformation",
"bc03": "Uncompressed",
"bc04": "ImageType",
"bc80": "ImageWidth",
"bc81": "ImageHeight",
"bc82": "WidthResolution",
"bc83": "HeightResolution",
"bcc0": "ImageOffset",
"bcc1": "ImageByteCount",
"bcc2": "AlphaOffset",
"bcc3": "AlphaByteCount",
"bcc4": "ImageDataDiscard",
"bcc5": "AlphaDataDiscard",
"c4a5": "PrintIM",
"c6bf": "ColorimetricReference",
"c6c5": "SRawType",
"c6d2": "PanasonicTitle",
"c6d3": "PanasonicTitle2",
"c6f3": "CameraCalibrationSig",
"c6f4": "ProfileCalibrationSig",
"c6f5": "ProfileIFD",
"c6f6": "AsShotProfileName",
"c6f7": "NoiseReductionApplied",
"c6f8": "ProfileName",
"c6f9": "ProfileHueSatMapDims",
"c6fa": "ProfileHueSatMapData1",
"c6fb": "ProfileHueSatMapData2",
"c6fc": "ProfileToneCurve",
"c6fd": "ProfileEmbedPolicy",
"c6fe": "ProfileCopyright",
"c7a1": "CameraLabel",
"c7a3": "ProfileHueSatMapEncoding",
"c7a4": "ProfileLookTableEncoding",
"c7a5": "BaselineExposureOffset",
"c7a6": "DefaultBlackRender",
"c7a7": "NewRawImageDigest",
"c7a8": "RawToPreviewGain",
"c7b5": "DefaultUserCrop",
"c42a": "OceImageLogic",
"c44f": "Annotations",
"c61a": "BlackLevel",
"c61b": "BlackLevelDeltaH",
"c61c": "BlackLevelDeltaV",
"c61d": "WhiteLevel",
"c61e": "DefaultScale",
"c61f": "DefaultCropOrigin",
"c62a": "BaselineExposure",
"c62b": "BaselineNoise",
"c62c": "BaselineSharpness",
"c62d": "BayerGreenSplit",
"c62e": "LinearResponseLimit",
"c62f": "CameraSerialNumber",
"c65a": "CalibrationIlluminant1",
"c65b": "CalibrationIlluminant2",
"c65c": "BestQualityScale",
"c65d": "RawDataUniqueID",
"c68b": "OriginalRawFileName",
"c68c": "OriginalRawFileData",
"c68d": "ActiveArea",
"c68e": "MaskedAreas",
"c68f": "AsShotICCProfile",
"c71a": "PreviewColorSpace",
"c71b": "PreviewDateTime",
"c71c": "RawImageDigest",
"c71d": "OriginalRawFileDigest",
"c71e": "SubTileBlockSize",
"c71f": "RowInterleaveFactor",
"c74e": "OpcodeList3",
"c427": "OceScanjobDesc",
"c428": "OceApplicationSelector",
"c429": "OceIDNumber",
"c573": "OriginalFileName",
"c580": "USPTOOriginalContentType",
"c612": "DNGVersion",
"c613": "DNGBackwardVersion",
"c614": "UniqueCameraModel",
"c615": "LocalizedCameraModel",
"c616": "CFAPlaneColor",
"c617": "CFALayout",
"c618": "LinearizationTable",
"c619": "BlackLevelRepeatDim",
"c620": "DefaultCropSize",
"c621": "ColorMatrix1",
"c622": "ColorMatrix2",
"c623": "CameraCalibration1",
"c624": "CameraCalibration2",
"c625": "ReductionMatrix1",
"c626": "ReductionMatrix2",
"c627": "AnalogBalance",
"c628": "AsShotNeutral",
"c629": "AsShotWhiteXY",
"c630": "DNGLensInfo",
"c631": "ChromaBlurRadius",
"c632": "AntiAliasStrength",
"c633": "ShadowScale",
"c634": "SR2Private",
"c635": "MakerNoteSafety",
"c640": "RawImageSegmentation",
"c660": "AliasLayerMetadata",
"c690": "AsShotPreProfileMatrix",
"c691": "CurrentICCProfile",
"c692": "CurrentPreProfileMatrix",
"c714": "ForwardMatrix1",
"c715": "ForwardMatrix2",
"c716": "PreviewApplicationName",
"c717": "PreviewApplicationVersion",
"c718": "PreviewSettingsName",
"c719": "PreviewSettingsDigest",
"c725": "ProfileLookTableDims",
"c726": "ProfileLookTableData",
"c740": "OpcodeList1",
"c741": "OpcodeList2",
"c761": "NoiseProfile",
"c763": "TimeCodes",
"c764": "FrameRate",
"c772": "TStop",
"c789": "ReelName",
"c791": "OriginalDefaultFinalSize",
"c792": "OriginalBestQualitySize",
"c793": "OriginalDefaultCropSize",
"ea1c": "Padding",
"ea1d": "OffsetSchema",
"fde8": "OwnerName",
"fde9": "SerialNumber",
"fdea": "Lens",
"fe00": "KDC_IFD",
"fe4c": "RawFile",
"fe4d": "Converter",
"fe4e": "WhiteBalance",
"fe51": "Exposure",
"fe52": "Shadows",
"fe53": "Brightness",
"fe54": "Contrast",
"fe55": "Saturation",
"fe56": "Sharpness",
"fe57": "Smoothness",
"fe58": "MoireFilter"
}

140
node_modules/jpeg-exif/lib/tags.json generated vendored Normal file
View File

@@ -0,0 +1,140 @@
{
"ifd": {
"010e": "ImageDescription",
"010f": "Make",
"011a": "XResolution",
"011b": "YResolution",
"011c": "PlanarConfiguration",
"012d": "TransferFunction",
"013b": "Artist",
"013e": "WhitePoint",
"013f": "PrimaryChromaticities",
"0100": "ImageWidth",
"0101": "ImageHeight",
"0102": "BitsPerSample",
"0103": "Compression",
"0106": "PhotometricInterpretation",
"0110": "Model",
"0111": "StripOffsets",
"0112": "Orientation",
"0115": "SamplesPerPixel",
"0116": "RowsPerStrip",
"0117": "StripByteCounts",
"0128": "ResolutionUnit",
"0131": "Software",
"0132": "DateTime",
"0201": "JPEGInterchangeFormat",
"0202": "JPEGInterchangeFormatLength",
"0211": "YCbCrCoefficients",
"0212": "YCbCrSubSampling",
"0213": "YCbCrPositioning",
"0214": "ReferenceBlackWhite",
"829a": "ExposureTime",
"829d": "FNumber",
"920a": "FocalLength",
"927c": "MakerNote",
"8298": "Copyright",
"8769": "ExifIFDPointer",
"8822": "ExposureProgram",
"8824": "SpectralSensitivity",
"8825": "GPSInfoIFDPointer",
"8827": "PhotographicSensitivity",
"8828": "OECF",
"8830": "SensitivityType",
"8831": "StandardOutputSensitivity",
"8832": "RecommendedExposureIndex",
"8833": "ISOSpeed",
"8834": "ISOSpeedLatitudeyyy",
"8835": "ISOSpeedLatitudezzz",
"9000": "ExifVersion",
"9003": "DateTimeOriginal",
"9004": "DateTimeDigitized",
"9101": "ComponentsConfiguration",
"9102": "CompressedBitsPerPixel",
"9201": "ShutterSpeedValue",
"9202": "ApertureValue",
"9203": "BrightnessValue",
"9204": "ExposureBiasValue",
"9205": "MaxApertureValue",
"9206": "SubjectDistance",
"9207": "MeteringMode",
"9208": "LightSource",
"9209": "Flash",
"9214": "SubjectArea",
"9286": "UserComment",
"9290": "SubSecTime",
"9291": "SubSecTimeOriginal",
"9292": "SubSecTimeDigitized",
"a000": "FlashpixVersion",
"a001": "ColorSpace",
"a002": "PixelXDimension",
"a003": "PixelYDimension",
"a004": "RelatedSoundFile",
"a005": "InteroperabilityIFDPointer",
"a20b": "FlashEnergy",
"a20c": "SpatialFrequencyResponse",
"a20e": "FocalPlaneXResolution",
"a20f": "FocalPlaneYResolution",
"a40a": "Sharpness",
"a40b": "DeviceSettingDescription",
"a40c": "SubjectDistanceRange",
"a210": "FocalPlaneResolutionUnit",
"a214": "SubjectLocation",
"a215": "ExposureIndex",
"a217": "SensingMethod",
"a300": "FileSource",
"a301": "SceneType",
"a302": "CFAPattern",
"a401": "CustomRendered",
"a402": "ExposureMode",
"a403": "WhiteBalance",
"a404": "DigitalZoomRatio",
"a405": "FocalLengthIn35mmFilm",
"a406": "SceneCaptureType",
"a407": "GainControl",
"a408": "Contrast",
"a409": "Saturation",
"a420": "ImageUniqueID",
"a430": "CameraOwnerName",
"a431": "BodySerialNumber",
"a432": "LensSpecification",
"a433": "LensMake",
"a434": "LensModel",
"a435": "LensSerialNumber",
"a500": "Gamma"
},
"gps": {
"0000": "GPSVersionID",
"0001": "GPSLatitudeRef",
"0002": "GPSLatitude",
"0003": "GPSLongitudeRef",
"0004": "GPSLongitude",
"0005": "GPSAltitudeRef",
"0006": "GPSAltitude",
"0007": "GPSTimeStamp",
"0008": "GPSSatellites",
"0009": "GPSStatus",
"000a": "GPSMeasureMode",
"000b": "GPSDOP",
"000c": "GPSSpeedRef",
"000d": "GPSSpeed",
"000e": "GPSTrackRef",
"000f": "GPSTrack",
"0010": "GPSImgDirectionRef",
"0011": "GPSImgDirection",
"0012": "GPSMapDatum",
"0013": "GPSDestLatitudeRef",
"0014": "GPSDestLatitude",
"0015": "GPSDestLongitudeRef",
"0016": "GPSDestLongitude",
"0017": "GPSDestBearingRef",
"0018": "GPSDestBearing",
"0019": "GPSDestDistanceRef",
"001a": "GPSDestDistance",
"001b": "GPSProcessingMethod",
"001c": "GPSAreaInformation",
"001d": "GPSDateStamp",
"001e": "GPSDifferential",
"001f": "GPSHPositioningError"
}
}

42
node_modules/jpeg-exif/package.json generated vendored Normal file
View File

@@ -0,0 +1,42 @@
{
"name": "jpeg-exif",
"version": "1.1.4",
"description": "Use for parse .jpg file exif info (including GPS info.).",
"main": "lib/index.js",
"scripts": {
"test": "./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha -report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
"lint": "./node_modules/.bin/eslint ./src/index.js ./test/index.test.js --fix",
"build": "babel ./src -d lib --source-maps && cp ./src/*.json ./lib"
},
"keywords": [
"jpeg",
"exif",
"gps",
"image",
"picture",
"photo",
"jfif"
],
"homepage": "https://github.com/zhso/jpeg-exif",
"repository": {
"type": "git",
"url": "https://github.com/zhso/jpeg-exif.git"
},
"bugs": {
"url": "https://github.com/zhso/jpeg-exif/issues",
"email": "s@zhso.net"
},
"author": "s@zhso.net",
"license": "MIT",
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-preset-env": "^1.7.0",
"chai": "^4.2.0",
"coveralls": "^3.0.6",
"eslint": "^6.2.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-plugin-import": "^2.18.2",
"istanbul": "^0.4.5",
"mocha": "^6.2.0"
}
}

364
node_modules/jpeg-exif/src/index.js generated vendored Normal file
View File

@@ -0,0 +1,364 @@
import fs from 'fs';
const tags = require('./tags.json');
/*
unsignedByte,
asciiStrings,
unsignedShort,
unsignedLong,
unsignedRational,
signedByte,
undefined,
signedShort,
signedLong,
signedRational,
singleFloat,
doubleFloat
*/
const bytes = [0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8];
const SOIMarkerLength = 2;
const JPEGSOIMarker = 0xffd8;
const TIFFINTEL = 0x4949;
const TIFFMOTOROLA = 0x4d4d;
const APPMarkerLength = 2;
const APPMarkerBegin = 0xffe0;
const APPMarkerEnd = 0xffef;
let data;
/**
* @param buffer {Buffer}
* @returns {Boolean}
* @example
* var content = fs.readFileSync("~/Picture/IMG_0911.JPG");
* var isImage = isValid(content);
* console.log(isImage);
*/
const isValid = (buffer) => {
try {
const SOIMarker = buffer.readUInt16BE(0);
return SOIMarker === JPEGSOIMarker;
} catch (e) {
throw new Error('Unsupport file format.');
}
};
/**
* @param buffer {Buffer}
* @returns {Boolean}
* @example
*/
const isTiff = (buffer) => {
try {
const SOIMarker = buffer.readUInt16BE(0);
return SOIMarker === TIFFINTEL || SOIMarker === TIFFMOTOROLA;
} catch (e) {
throw new Error('Unsupport file format.');
}
};
/**
* @param buffer {Buffer}
* @returns {Number}
* @example
* var content = fs.readFileSync("~/Picture/IMG_0911.JPG");
* var APPNumber = checkAPPn(content);
* console.log(APPNumber);
*/
const checkAPPn = (buffer) => {
try {
const APPMarkerTag = buffer.readUInt16BE(0);
const isInRange = APPMarkerTag >= APPMarkerBegin && APPMarkerTag <= APPMarkerEnd;
return isInRange ? APPMarkerTag - APPMarkerBegin : false;
} catch (e) {
throw new Error('Invalid APP Tag.');
}
};
/**
* @param buffer {Buffer}
* @param tagCollection {Object}
* @param order {Boolean}
* @param offset {Number}
* @returns {Object}
* @example
* var content = fs.readFileSync("~/Picture/IMG_0911.JPG");
* var exifFragments = IFDHandler(content, 0, true, 8);
* console.log(exifFragments.value);
*/
const IFDHandler = (buffer, tagCollection, order, offset) => {
const entriesNumber = order ? buffer.readUInt16BE(0) : buffer.readUInt16LE(0);
if (entriesNumber === 0) {
return {};
}
const entriesNumberLength = 2;
const entries = buffer.slice(entriesNumberLength);
const entryLength = 12;
// let nextIFDPointerBegin = entriesNumberLength + entryLength * entriesNumber;
// let bigNextIFDPointer= buffer.readUInt32BE(nextIFDPointerBegin) ;
// let littleNextIFDPointer= buffer.readUInt32LE(nextIFDPointerBegin);
// let nextIFDPointer = order ?bigNextIFDPointer:littleNextIFDPointer;
const exif = {};
let entryCount = 0;
for (entryCount; entryCount < entriesNumber; entryCount += 1) {
const entryBegin = entryCount * entryLength;
const entry = entries.slice(entryBegin, entryBegin + entryLength);
const tagBegin = 0;
const tagLength = 2;
const dataFormatBegin = tagBegin + tagLength;
const dataFormatLength = 2;
const componentsBegin = dataFormatBegin + dataFormatLength;
const componentsNumberLength = 4;
const dataValueBegin = componentsBegin + componentsNumberLength;
const dataValueLength = 4;
const tagAddress = entry.slice(tagBegin, dataFormatBegin);
const tagNumber = order ? tagAddress.toString('hex') : tagAddress.reverse().toString('hex');
const tagName = tagCollection[tagNumber];
const bigDataFormat = entry.readUInt16BE(dataFormatBegin);
const littleDataFormat = entry.readUInt16LE(dataFormatBegin);
const dataFormat = order ? bigDataFormat : littleDataFormat;
const componentsByte = bytes[dataFormat];
const bigComponentsNumber = entry.readUInt32BE(componentsBegin);
const littleComponentNumber = entry.readUInt32LE(componentsBegin);
const componentsNumber = order ? bigComponentsNumber : littleComponentNumber;
const dataLength = componentsNumber * componentsByte;
let dataValue = entry.slice(dataValueBegin, dataValueBegin + dataValueLength);
if (dataLength > 4) {
const dataOffset = (order ? dataValue.readUInt32BE(0) : dataValue.readUInt32LE(0)) - offset;
dataValue = buffer.slice(dataOffset, dataOffset + dataLength);
}
let tagValue;
if (tagName) {
switch (dataFormat) {
case 1:
tagValue = dataValue.readUInt8(0);
break;
case 2:
tagValue = dataValue.toString('ascii').replace(/\0+$/, '');
break;
case 3:
tagValue = order ? dataValue.readUInt16BE(0) : dataValue.readUInt16LE(0);
break;
case 4:
tagValue = order ? dataValue.readUInt32BE(0) : dataValue.readUInt32LE(0);
break;
case 5:
tagValue = [];
for (let i = 0; i < dataValue.length; i += 8) {
const bigTagValue = dataValue.readUInt32BE(i) / dataValue.readUInt32BE(i + 4);
const littleTagValue = dataValue.readUInt32LE(i) / dataValue.readUInt32LE(i + 4);
tagValue.push(order ? bigTagValue : littleTagValue);
}
break;
case 7:
switch (tagName) {
case 'ExifVersion':
tagValue = dataValue.toString();
break;
case 'FlashPixVersion':
tagValue = dataValue.toString();
break;
case 'SceneType':
tagValue = dataValue.readUInt8(0);
break;
default:
tagValue = `0x${dataValue.toString('hex', 0, 15)}`;
break;
}
break;
case 10: {
const bigOrder = dataValue.readInt32BE(0) / dataValue.readInt32BE(4);
const littleOrder = dataValue.readInt32LE(0) / dataValue.readInt32LE(4);
tagValue = order ? bigOrder : littleOrder;
break;
}
default:
tagValue = `0x${dataValue.toString('hex')}`;
break;
}
exif[tagName] = tagValue;
}
/*
else {
console.log(`Unkown Tag [0x${tagNumber}].`);
}
*/
}
return exif;
};
/**
* @param buf {Buffer}
* @returns {Undefined}
* @example
* var content = fs.readFileSync("~/Picture/IMG_0911.JPG");
* var exifFragments = EXIFHandler(content);
*/
const EXIFHandler = (buf, pad = true) => {
let buffer = buf;
if (pad) {
buffer = buf.slice(APPMarkerLength);
const length = buffer.readUInt16BE(0);
buffer = buffer.slice(0, length);
const lengthLength = 2;
buffer = buffer.slice(lengthLength);
const identifierLength = 5;
buffer = buffer.slice(identifierLength);
const padLength = 1;
buffer = buffer.slice(padLength);
}
const byteOrderLength = 2;
const byteOrder = buffer.toString('ascii', 0, byteOrderLength) === 'MM';
const fortyTwoLength = 2;
const fortyTwoEnd = byteOrderLength + fortyTwoLength;
const big42 = buffer.readUInt32BE(fortyTwoEnd);
const little42 = buffer.readUInt32LE(fortyTwoEnd);
const offsetOfIFD = byteOrder ? big42 : little42;
buffer = buffer.slice(offsetOfIFD);
if (buffer.length > 0) {
data = IFDHandler(buffer, tags.ifd, byteOrder, offsetOfIFD);
if (data.ExifIFDPointer) {
buffer = buffer.slice(data.ExifIFDPointer - offsetOfIFD);
data.SubExif = IFDHandler(buffer, tags.ifd, byteOrder, data.ExifIFDPointer);
}
if (data.GPSInfoIFDPointer) {
const gps = data.GPSInfoIFDPointer;
buffer = buffer.slice(data.ExifIFDPointer ? gps - data.ExifIFDPointer : gps - offsetOfIFD);
data.GPSInfo = IFDHandler(buffer, tags.gps, byteOrder, gps);
}
}
};
/**
* @param buffer {Buffer}
* @returns {Undefined}
* @example
* var content = fs.readFileSync("~/Picture/IMG_0911.JPG");
* var exifFragments = APPnHandler(content);
*/
const APPnHandler = (buffer) => {
const APPMarkerTag = checkAPPn(buffer);
if (APPMarkerTag !== false) { // APP0 is 0, and 0==false
const length = buffer.readUInt16BE(APPMarkerLength);
switch (APPMarkerTag) {
case 1: // EXIF
EXIFHandler(buffer);
break;
default:
APPnHandler(buffer.slice(APPMarkerLength + length));
break;
}
}
};
/**
* @param buffer {Buffer}
* @returns {Object}
* @example
*/
const fromBuffer = (buffer) => {
if (!buffer) {
throw new Error('buffer not found');
}
data = undefined;
if (isValid(buffer)) {
buffer = buffer.slice(SOIMarkerLength);
data = {};
APPnHandler(buffer);
} else if (isTiff(buffer)) {
data = {};
EXIFHandler(buffer, false);
}
return data;
};
/**
* @param file {String}
* @returns {Object}
* @example
* var exif = sync("~/Picture/IMG_1981.JPG");
* console.log(exif.createTime);
*/
const sync = (file) => {
if (!file) {
throw new Error('File not found');
}
const buffer = fs.readFileSync(file);
return fromBuffer(buffer);
};
/**
* @param file {String}
* @param callback {Function}
* @example
* async("~/Picture/IMG_0707.JPG", (err, data) => {
* if(err) {
* console.log(err);
* }
* if(data) {
* console.log(data.ExifOffset.createTime);
* }
* }
*/
const async = (file, callback) => {
data = undefined;
new Promise((resolve, reject) => {
if (!file) {
reject(new Error('❓File not found.'));
}
fs.readFile(file, (err, buffer) => {
if (err) {
reject(err);
} else {
try {
if (isValid(buffer)) {
const buf = buffer.slice(SOIMarkerLength);
data = {};
APPnHandler(buf);
resolve(data);
} else if (isTiff(buffer)) {
data = {};
EXIFHandler(buffer, false);
resolve(data);
} else {
reject(new Error('😱Unsupport file type.'));
}
} catch (e) {
reject(e);
}
}
});
}, (error) => {
callback(error, undefined);
}).then((d) => {
callback(undefined, d);
}).catch((error) => {
callback(error, undefined);
});
};
exports.fromBuffer = fromBuffer;
exports.parse = async;
exports.parseSync = sync;

348
node_modules/jpeg-exif/src/plus.json generated vendored Normal file
View File

@@ -0,0 +1,348 @@
{
"00fe": "SubfileType",
"00ff": "OldSubfileType",
"000b": "ProcessingSoftware",
"0001": "InteropIndex",
"01b1": "Decode",
"01b2": "DefaultImageColor",
"01b3": "T82Options",
"01b5": "JPEGTables",
"0002": "InteropVersion",
"02bc": "XMP",
"03e7": "USPTOMiscellaneous",
"9c9b": "XPTitle",
"9c9c": "XPComment",
"9c9d": "XPAuthor",
"9c9e": "XPKeywords",
"9c9f": "XPSubject",
"010a": "FillOrder",
"010d": "DocumentName",
"011d": "PageName",
"011e": "XPosition",
"011f": "YPosition",
"012c": "ColorResponseUnit",
"013c": "HostComputer",
"013d": "Predictor",
"014a": "SubIFD",
"014c": "InkSet",
"014d": "InkNames",
"014e": "NumberOfInks",
"015a": "Indexed",
"015b": "JPEGTables",
"015f": "OPIProxy",
"022f": "StripRowCounts",
"80a3": "WangTag1",
"80a4": "WangAnnotation",
"80a5": "WangTag3",
"80a6": "WangTag4",
"80b8": "ImageReferencePoints",
"80b9": "RegionXformTackPoint",
"80ba": "WarpQuadrilateral",
"80bb": "AffineTransformMat",
"80e3": "Matteing",
"80e4": "DataType",
"80e5": "ImageDepth",
"80e6": "TileDepth",
"82a5": "MDFileTag",
"82a6": "MDScalePixel",
"82a7": "MDColorTable",
"82a8": "MDLabName",
"82a9": "MDSampleInfo",
"82aa": "MDPrepDate",
"82ab": "MDPrepTime",
"82ac": "MDFileUnits",
"83bb": "IPTC-NAA",
"84e0": "Site",
"84e1": "ColorSequence",
"84e2": "IT8Header",
"84e3": "RasterPadding",
"84e4": "BitsPerRunLength",
"84e5": "BitsPerExtendedRunLength",
"84e6": "ColorTable",
"84e7": "ImageColorIndicator",
"84e8": "BackgroundColorIndicator",
"84e9": "ImageColorValue",
"84ea": "BackgroundColorValue",
"84eb": "PixelIntensityRange",
"84ec": "TransparencyIndicator",
"84ed": "ColorCharacterization",
"84ee": "HCUsage",
"84ef": "TrapIndicator",
"84f0": "CMYKEquivalent",
"85b8": "PixelMagicJBIGOptions",
"85d7": "JPLCartoIFD",
"85d8": "ModelTransform",
"87ac": "ImageLayer",
"87af": "GeoTiffDirectory",
"87b0": "GeoTiffDoubleParams",
"87b1": "GeoTiffAsciiParams",
"87be": "JBIGOptions",
"0107": "Thresholding",
"0108": "CellWidth",
"0109": "CellLength",
"0118": "MinSampleValue",
"0119": "MaxSampleValue",
"0120": "FreeOffsets",
"0121": "FreeByteCounts",
"0122": "GrayResponseUnit",
"0123": "GrayResponseCurve",
"0124": "T4Options",
"0125": "T6Options",
"0129": "PageNumber",
"0140": "ColorMap",
"0141": "HalftoneHints",
"0142": "TileWidth",
"0143": "TileLength",
"0144": "TileOffsets",
"0145": "TileByteCounts",
"0146": "BadFaxLines",
"0147": "CleanFaxData",
"0148": "ConsecutiveBadFaxLines",
"0150": "DotRange",
"0151": "TargetPrinter",
"0152": "ExtraSamples",
"0153": "SampleFormat",
"0154": "SMinSampleValue",
"0155": "SMaxSampleValue",
"0156": "TransferRange",
"0157": "ClipPath",
"0158": "XClipPathUnits",
"0159": "YClipPathUnits",
"0190": "GlobalParametersIFD",
"0191": "ProfileType",
"0192": "FaxProfile",
"0193": "CodingMethods",
"0194": "VersionYear",
"0195": "ModeNumber",
"0200": "JPEGProc",
"0203": "JPEGRestartInterval",
"0205": "JPEGLosslessPredictors",
"0206": "JPEGPointTransforms",
"0207": "JPEGQTables",
"0208": "JPEGDCTables",
"0209": "JPEGACTables",
"800d": "ImageID",
"821a": "MatrixWorldToCamera",
"827d": "Model2",
"828d": "CFARepeatPatternDim",
"828e": "CFAPattern2",
"828f": "BatteryLevel",
"830e": "PixelScale",
"835c": "UIC1Tag",
"835d": "UIC2Tag",
"835e": "UIC3Tag",
"835f": "UIC4Tag",
"847e": "IntergraphPacketData",
"847f": "IntergraphFlagRegisters",
"877f": "TIFF_FXExtensions",
"882a": "TimeZoneOffset",
"882b": "SelfTimerMode",
"885c": "FaxRecvParams",
"885d": "FaxSubAddress",
"885e": "FaxRecvTime",
"888a": "LeafSubIFD",
"920b": "FlashEnergy",
"920c": "SpatialFrequencyResponse",
"920d": "Noise",
"920e": "FocalPlaneXResolution",
"920f": "FocalPlaneYResolution",
"923a": "CIP3DataFile",
"923b": "CIP3Sheet",
"923c": "CIP3Side",
"923f": "StoNits",
"932f": "MSDocumentText",
"935c": "ImageSourceData",
"1000": "RelatedImageFileFormat",
"1001": "RelatedImageWidth",
"1002": "RelatedImageHeight",
"4746": "Rating",
"4747": "XP_DIP_XML",
"4748": "StitchInfo",
"4749": "RatingPercent",
"7035": "ChromaticAberrationCorrParams",
"7037": "DistortionCorrParams",
"8214": "ImageFullWidth",
"8215": "ImageFullHeight",
"8216": "TextureFormat",
"8217": "WrapModes",
"8218": "FovCot",
"8219": "MatrixWorldToScreen",
"8290": "KodakIFD",
"8335": "AdventScale",
"8336": "AdventRevision",
"8480": "IntergraphMatrix",
"8481": "INGRReserved",
"8482": "ModelTiePoint",
"8546": "SEMInfo",
"8568": "AFCP_IPTC",
"8602": "WB_GRGBLevels",
"8606": "LeafData",
"8649": "PhotoshopSettings",
"8773": "ICC_Profile",
"8780": "MultiProfiles",
"8781": "SharedData",
"8782": "T88Options",
"8829": "Interlace",
"8871": "FedexEDR",
"9009": "GooglePlusUploadCode",
"9210": "FocalPlaneResolutionUnit",
"9211": "ImageNumber",
"9212": "SecurityClassification",
"9213": "ImageHistory",
"9215": "ExposureIndex",
"9216": "TIFF-EPStandardID",
"9217": "SensingMethod",
"9330": "MSPropertySetStorage",
"9331": "MSDocumentTextPosition",
"a20d": "Noise",
"a211": "ImageNumber",
"a212": "SecurityClassification",
"a213": "ImageHistory",
"a216": "TIFF-EPStandardID",
"a480": "GDALMetadata",
"a481": "GDALNoData",
"afc0": "ExpandSoftware",
"afc1": "ExpandLens",
"afc2": "ExpandFilm",
"afc3": "ExpandFilterLens",
"afc4": "ExpandScanner",
"afc5": "ExpandFlashLamp",
"bc01": "PixelFormat",
"bc02": "Transformation",
"bc03": "Uncompressed",
"bc04": "ImageType",
"bc80": "ImageWidth",
"bc81": "ImageHeight",
"bc82": "WidthResolution",
"bc83": "HeightResolution",
"bcc0": "ImageOffset",
"bcc1": "ImageByteCount",
"bcc2": "AlphaOffset",
"bcc3": "AlphaByteCount",
"bcc4": "ImageDataDiscard",
"bcc5": "AlphaDataDiscard",
"c4a5": "PrintIM",
"c6bf": "ColorimetricReference",
"c6c5": "SRawType",
"c6d2": "PanasonicTitle",
"c6d3": "PanasonicTitle2",
"c6f3": "CameraCalibrationSig",
"c6f4": "ProfileCalibrationSig",
"c6f5": "ProfileIFD",
"c6f6": "AsShotProfileName",
"c6f7": "NoiseReductionApplied",
"c6f8": "ProfileName",
"c6f9": "ProfileHueSatMapDims",
"c6fa": "ProfileHueSatMapData1",
"c6fb": "ProfileHueSatMapData2",
"c6fc": "ProfileToneCurve",
"c6fd": "ProfileEmbedPolicy",
"c6fe": "ProfileCopyright",
"c7a1": "CameraLabel",
"c7a3": "ProfileHueSatMapEncoding",
"c7a4": "ProfileLookTableEncoding",
"c7a5": "BaselineExposureOffset",
"c7a6": "DefaultBlackRender",
"c7a7": "NewRawImageDigest",
"c7a8": "RawToPreviewGain",
"c7b5": "DefaultUserCrop",
"c42a": "OceImageLogic",
"c44f": "Annotations",
"c61a": "BlackLevel",
"c61b": "BlackLevelDeltaH",
"c61c": "BlackLevelDeltaV",
"c61d": "WhiteLevel",
"c61e": "DefaultScale",
"c61f": "DefaultCropOrigin",
"c62a": "BaselineExposure",
"c62b": "BaselineNoise",
"c62c": "BaselineSharpness",
"c62d": "BayerGreenSplit",
"c62e": "LinearResponseLimit",
"c62f": "CameraSerialNumber",
"c65a": "CalibrationIlluminant1",
"c65b": "CalibrationIlluminant2",
"c65c": "BestQualityScale",
"c65d": "RawDataUniqueID",
"c68b": "OriginalRawFileName",
"c68c": "OriginalRawFileData",
"c68d": "ActiveArea",
"c68e": "MaskedAreas",
"c68f": "AsShotICCProfile",
"c71a": "PreviewColorSpace",
"c71b": "PreviewDateTime",
"c71c": "RawImageDigest",
"c71d": "OriginalRawFileDigest",
"c71e": "SubTileBlockSize",
"c71f": "RowInterleaveFactor",
"c74e": "OpcodeList3",
"c427": "OceScanjobDesc",
"c428": "OceApplicationSelector",
"c429": "OceIDNumber",
"c573": "OriginalFileName",
"c580": "USPTOOriginalContentType",
"c612": "DNGVersion",
"c613": "DNGBackwardVersion",
"c614": "UniqueCameraModel",
"c615": "LocalizedCameraModel",
"c616": "CFAPlaneColor",
"c617": "CFALayout",
"c618": "LinearizationTable",
"c619": "BlackLevelRepeatDim",
"c620": "DefaultCropSize",
"c621": "ColorMatrix1",
"c622": "ColorMatrix2",
"c623": "CameraCalibration1",
"c624": "CameraCalibration2",
"c625": "ReductionMatrix1",
"c626": "ReductionMatrix2",
"c627": "AnalogBalance",
"c628": "AsShotNeutral",
"c629": "AsShotWhiteXY",
"c630": "DNGLensInfo",
"c631": "ChromaBlurRadius",
"c632": "AntiAliasStrength",
"c633": "ShadowScale",
"c634": "SR2Private",
"c635": "MakerNoteSafety",
"c640": "RawImageSegmentation",
"c660": "AliasLayerMetadata",
"c690": "AsShotPreProfileMatrix",
"c691": "CurrentICCProfile",
"c692": "CurrentPreProfileMatrix",
"c714": "ForwardMatrix1",
"c715": "ForwardMatrix2",
"c716": "PreviewApplicationName",
"c717": "PreviewApplicationVersion",
"c718": "PreviewSettingsName",
"c719": "PreviewSettingsDigest",
"c725": "ProfileLookTableDims",
"c726": "ProfileLookTableData",
"c740": "OpcodeList1",
"c741": "OpcodeList2",
"c761": "NoiseProfile",
"c763": "TimeCodes",
"c764": "FrameRate",
"c772": "TStop",
"c789": "ReelName",
"c791": "OriginalDefaultFinalSize",
"c792": "OriginalBestQualitySize",
"c793": "OriginalDefaultCropSize",
"ea1c": "Padding",
"ea1d": "OffsetSchema",
"fde8": "OwnerName",
"fde9": "SerialNumber",
"fdea": "Lens",
"fe00": "KDC_IFD",
"fe4c": "RawFile",
"fe4d": "Converter",
"fe4e": "WhiteBalance",
"fe51": "Exposure",
"fe52": "Shadows",
"fe53": "Brightness",
"fe54": "Contrast",
"fe55": "Saturation",
"fe56": "Sharpness",
"fe57": "Smoothness",
"fe58": "MoireFilter"
}

140
node_modules/jpeg-exif/src/tags.json generated vendored Normal file
View File

@@ -0,0 +1,140 @@
{
"ifd": {
"010e": "ImageDescription",
"010f": "Make",
"011a": "XResolution",
"011b": "YResolution",
"011c": "PlanarConfiguration",
"012d": "TransferFunction",
"013b": "Artist",
"013e": "WhitePoint",
"013f": "PrimaryChromaticities",
"0100": "ImageWidth",
"0101": "ImageHeight",
"0102": "BitsPerSample",
"0103": "Compression",
"0106": "PhotometricInterpretation",
"0110": "Model",
"0111": "StripOffsets",
"0112": "Orientation",
"0115": "SamplesPerPixel",
"0116": "RowsPerStrip",
"0117": "StripByteCounts",
"0128": "ResolutionUnit",
"0131": "Software",
"0132": "DateTime",
"0201": "JPEGInterchangeFormat",
"0202": "JPEGInterchangeFormatLength",
"0211": "YCbCrCoefficients",
"0212": "YCbCrSubSampling",
"0213": "YCbCrPositioning",
"0214": "ReferenceBlackWhite",
"829a": "ExposureTime",
"829d": "FNumber",
"920a": "FocalLength",
"927c": "MakerNote",
"8298": "Copyright",
"8769": "ExifIFDPointer",
"8822": "ExposureProgram",
"8824": "SpectralSensitivity",
"8825": "GPSInfoIFDPointer",
"8827": "PhotographicSensitivity",
"8828": "OECF",
"8830": "SensitivityType",
"8831": "StandardOutputSensitivity",
"8832": "RecommendedExposureIndex",
"8833": "ISOSpeed",
"8834": "ISOSpeedLatitudeyyy",
"8835": "ISOSpeedLatitudezzz",
"9000": "ExifVersion",
"9003": "DateTimeOriginal",
"9004": "DateTimeDigitized",
"9101": "ComponentsConfiguration",
"9102": "CompressedBitsPerPixel",
"9201": "ShutterSpeedValue",
"9202": "ApertureValue",
"9203": "BrightnessValue",
"9204": "ExposureBiasValue",
"9205": "MaxApertureValue",
"9206": "SubjectDistance",
"9207": "MeteringMode",
"9208": "LightSource",
"9209": "Flash",
"9214": "SubjectArea",
"9286": "UserComment",
"9290": "SubSecTime",
"9291": "SubSecTimeOriginal",
"9292": "SubSecTimeDigitized",
"a000": "FlashpixVersion",
"a001": "ColorSpace",
"a002": "PixelXDimension",
"a003": "PixelYDimension",
"a004": "RelatedSoundFile",
"a005": "InteroperabilityIFDPointer",
"a20b": "FlashEnergy",
"a20c": "SpatialFrequencyResponse",
"a20e": "FocalPlaneXResolution",
"a20f": "FocalPlaneYResolution",
"a40a": "Sharpness",
"a40b": "DeviceSettingDescription",
"a40c": "SubjectDistanceRange",
"a210": "FocalPlaneResolutionUnit",
"a214": "SubjectLocation",
"a215": "ExposureIndex",
"a217": "SensingMethod",
"a300": "FileSource",
"a301": "SceneType",
"a302": "CFAPattern",
"a401": "CustomRendered",
"a402": "ExposureMode",
"a403": "WhiteBalance",
"a404": "DigitalZoomRatio",
"a405": "FocalLengthIn35mmFilm",
"a406": "SceneCaptureType",
"a407": "GainControl",
"a408": "Contrast",
"a409": "Saturation",
"a420": "ImageUniqueID",
"a430": "CameraOwnerName",
"a431": "BodySerialNumber",
"a432": "LensSpecification",
"a433": "LensMake",
"a434": "LensModel",
"a435": "LensSerialNumber",
"a500": "Gamma"
},
"gps": {
"0000": "GPSVersionID",
"0001": "GPSLatitudeRef",
"0002": "GPSLatitude",
"0003": "GPSLongitudeRef",
"0004": "GPSLongitude",
"0005": "GPSAltitudeRef",
"0006": "GPSAltitude",
"0007": "GPSTimeStamp",
"0008": "GPSSatellites",
"0009": "GPSStatus",
"000a": "GPSMeasureMode",
"000b": "GPSDOP",
"000c": "GPSSpeedRef",
"000d": "GPSSpeed",
"000e": "GPSTrackRef",
"000f": "GPSTrack",
"0010": "GPSImgDirectionRef",
"0011": "GPSImgDirection",
"0012": "GPSMapDatum",
"0013": "GPSDestLatitudeRef",
"0014": "GPSDestLatitude",
"0015": "GPSDestLongitudeRef",
"0016": "GPSDestLongitude",
"0017": "GPSDestBearingRef",
"0018": "GPSDestBearing",
"0019": "GPSDestDistanceRef",
"001a": "GPSDestDistance",
"001b": "GPSProcessingMethod",
"001c": "GPSAreaInformation",
"001d": "GPSDateStamp",
"001e": "GPSDifferential",
"001f": "GPSHPositioningError"
}
}

BIN
node_modules/jpeg-exif/test/Arbitro.tiff generated vendored Normal file

Binary file not shown.

BIN
node_modules/jpeg-exif/test/IMG_0001.JPG generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 KiB

BIN
node_modules/jpeg-exif/test/IMG_0003.JPG generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

135
node_modules/jpeg-exif/test/index.test.js generated vendored Normal file
View File

@@ -0,0 +1,135 @@
/* global it, describe */
const fs = require('fs');
const { expect } = require('chai');
const exif = require('../lib/index.js');
describe('.parse()', () => {
it('file {undefined}', () => {
exif.parse(undefined, (err) => {
expect(err).to.throw(Error);
});
});
it('file {null}', () => {
exif.parse('./test/null.jpg', (err) => {
expect(err).to.throw(Error);
});
});
it('APP1:#0xffe1', (done) => {
exif.parse('./test/IMG_0001.JPG', (err, data) => {
expect(data).to.be.an('object');
done();
});
});
it('APP0:#0xffe0', (done) => {
exif.parse('./test/IMG_0003.JPG', (err, data) => {
expect(data).to.be.an('undefined');
done();
});
});
it('!(APP1:#0xffe1||APP0:#0xffe0)', (done) => {
exif.parse('./test/index.test.js', (err, data) => {
expect(data).to.be.an('undefined');
done();
});
});
it('[SubExif]', (done) => {
exif.parse('./test/IMG_0001.JPG', (err, data) => {
expect(data.SubExif).to.be.an('object');
done();
});
});
it('[GPSInfo]', (done) => {
exif.parse('./test/IMG_0001.JPG', (err, data) => {
expect(data.GPSInfo).to.be.an('object');
done();
});
});
});
describe('.parseSync()', () => {
it('file {undefined}', () => {
expect(exif.parseSync).to.throw(Error);
});
it('file {null}', () => {
expect(exif.parseSync).to.throw(Error);
});
it('APP1:#0xffe1', () => {
const data = exif.parseSync('./test/IMG_0001.JPG');
expect(data).to.be.an('object');
});
it('!APP1:#0xffe1', () => {
const data = exif.parseSync('./test/IMG_0003.JPG');
expect(data).to.be.an('object');
});
it('[SubExif]', () => {
const data = exif.parseSync('./test/IMG_0001.JPG');
expect(data.SubExif).to.be.an('object');
});
it('[GPSInfo]', () => {
const data = exif.parseSync('./test/IMG_0001.JPG');
expect(data.GPSInfo).to.be.an('object');
});
it('TIFF', () => {
const data = exif.parseSync('./test/Arbitro.tiff');
expect(data).to.be.eql({
ImageWidth: 174,
ImageHeight: 38,
BitsPerSample: 8,
Compression: 5,
PhotometricInterpretation: 2,
StripOffsets: 8,
Orientation: 1,
SamplesPerPixel: 4,
RowsPerStrip: 38,
StripByteCounts: 6391,
PlanarConfiguration: 1,
});
});
});
describe('.fromBuffer()', () => {
it('file {undefined}', () => {
expect(exif.fromBuffer).to.throw(Error);
});
it('APP1:#0xffe1', () => {
const buffer = fs.readFileSync('./test/IMG_0001.JPG');
const data = exif.fromBuffer(buffer);
expect(data).to.be.an('object');
});
it('!APP1:#0xffe1', () => {
const buffer = fs.readFileSync('./test/IMG_0003.JPG');
const data = exif.fromBuffer(buffer);
expect(data).to.be.an('object');
});
it('[SubExif]', () => {
const buffer = fs.readFileSync('./test/IMG_0001.JPG');
const data = exif.fromBuffer(buffer);
expect(data.SubExif).to.be.an('object');
});
it('[GPSInfo]', () => {
const buffer = fs.readFileSync('./test/IMG_0001.JPG');
const data = exif.fromBuffer(buffer);
expect(data.GPSInfo).to.be.an('object');
});
});