dpzvc-ui 1.2.5 → 1.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dpzvc.esm.js +591 -1155
- package/dist/dpzvc.esm.js.map +1 -1
- package/dist/dpzvc.esm.min.js +1 -1
- package/dist/dpzvc.esm.min.js.map +1 -1
- package/dist/dpzvc.js +522 -1105
- package/dist/dpzvc.js.map +1 -1
- package/dist/dpzvc.min.js +1 -1
- package/dist/dpzvc.min.js.map +1 -1
- package/dist-prod/573.d34afb948745a30ef054.js +3 -0
- package/dist-prod/573.d34afb948745a30ef054.js.LICENSE.txt +7 -0
- package/dist-prod/573.d34afb948745a30ef054.js.map +1 -0
- package/dist-prod/index.html +1 -1
- package/dist-prod/main.5ea7bcd95498f23800fb.js +2 -0
- package/dist-prod/main.5ea7bcd95498f23800fb.js.map +1 -0
- package/package.json +3 -3
- package/src/components/upload/upload.vue +65 -25
- package/src/lib/exif-js.js +235 -0
- package/src/lib/exif.js +2 -1
package/dist/dpzvc.js
CHANGED
|
@@ -4007,6 +4007,16 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__154__;
|
|
|
4007
4007
|
|
|
4008
4008
|
/***/ },
|
|
4009
4009
|
|
|
4010
|
+
/***/ 172
|
|
4011
|
+
(module) {
|
|
4012
|
+
|
|
4013
|
+
function _OverloadYield(e, d) {
|
|
4014
|
+
this.v = e, this.k = d;
|
|
4015
|
+
}
|
|
4016
|
+
module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
4017
|
+
|
|
4018
|
+
/***/ },
|
|
4019
|
+
|
|
4010
4020
|
/***/ 265
|
|
4011
4021
|
(module, __webpack_exports__, __webpack_require__) {
|
|
4012
4022
|
|
|
@@ -4135,1073 +4145,6 @@ module.exports = function (cssWithMappingToString) {
|
|
|
4135
4145
|
return list;
|
|
4136
4146
|
};
|
|
4137
4147
|
|
|
4138
|
-
/***/ },
|
|
4139
|
-
|
|
4140
|
-
/***/ 335
|
|
4141
|
-
(module, exports) {
|
|
4142
|
-
|
|
4143
|
-
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function() {
|
|
4144
|
-
|
|
4145
|
-
var debug = false;
|
|
4146
|
-
|
|
4147
|
-
var root = this;
|
|
4148
|
-
|
|
4149
|
-
var EXIF = function(obj) {
|
|
4150
|
-
if (obj instanceof EXIF) return obj;
|
|
4151
|
-
if (!(this instanceof EXIF)) return new EXIF(obj);
|
|
4152
|
-
this.EXIFwrapped = obj;
|
|
4153
|
-
};
|
|
4154
|
-
|
|
4155
|
-
if (true) {
|
|
4156
|
-
if ( true && module.exports) {
|
|
4157
|
-
exports = module.exports = EXIF;
|
|
4158
|
-
}
|
|
4159
|
-
exports.EXIF = EXIF;
|
|
4160
|
-
} else // removed by dead control flow
|
|
4161
|
-
{}
|
|
4162
|
-
|
|
4163
|
-
var ExifTags = EXIF.Tags = {
|
|
4164
|
-
|
|
4165
|
-
// version tags
|
|
4166
|
-
0x9000 : "ExifVersion", // EXIF version
|
|
4167
|
-
0xA000 : "FlashpixVersion", // Flashpix format version
|
|
4168
|
-
|
|
4169
|
-
// colorspace tags
|
|
4170
|
-
0xA001 : "ColorSpace", // Color space information tag
|
|
4171
|
-
|
|
4172
|
-
// image configuration
|
|
4173
|
-
0xA002 : "PixelXDimension", // Valid width of meaningful image
|
|
4174
|
-
0xA003 : "PixelYDimension", // Valid height of meaningful image
|
|
4175
|
-
0x9101 : "ComponentsConfiguration", // Information about channels
|
|
4176
|
-
0x9102 : "CompressedBitsPerPixel", // Compressed bits per pixel
|
|
4177
|
-
|
|
4178
|
-
// user information
|
|
4179
|
-
0x927C : "MakerNote", // Any desired information written by the manufacturer
|
|
4180
|
-
0x9286 : "UserComment", // Comments by user
|
|
4181
|
-
|
|
4182
|
-
// related file
|
|
4183
|
-
0xA004 : "RelatedSoundFile", // Name of related sound file
|
|
4184
|
-
|
|
4185
|
-
// date and time
|
|
4186
|
-
0x9003 : "DateTimeOriginal", // Date and time when the original image was generated
|
|
4187
|
-
0x9004 : "DateTimeDigitized", // Date and time when the image was stored digitally
|
|
4188
|
-
0x9290 : "SubsecTime", // Fractions of seconds for DateTime
|
|
4189
|
-
0x9291 : "SubsecTimeOriginal", // Fractions of seconds for DateTimeOriginal
|
|
4190
|
-
0x9292 : "SubsecTimeDigitized", // Fractions of seconds for DateTimeDigitized
|
|
4191
|
-
|
|
4192
|
-
// picture-taking conditions
|
|
4193
|
-
0x829A : "ExposureTime", // Exposure time (in seconds)
|
|
4194
|
-
0x829D : "FNumber", // F number
|
|
4195
|
-
0x8822 : "ExposureProgram", // Exposure program
|
|
4196
|
-
0x8824 : "SpectralSensitivity", // Spectral sensitivity
|
|
4197
|
-
0x8827 : "ISOSpeedRatings", // ISO speed rating
|
|
4198
|
-
0x8828 : "OECF", // Optoelectric conversion factor
|
|
4199
|
-
0x9201 : "ShutterSpeedValue", // Shutter speed
|
|
4200
|
-
0x9202 : "ApertureValue", // Lens aperture
|
|
4201
|
-
0x9203 : "BrightnessValue", // Value of brightness
|
|
4202
|
-
0x9204 : "ExposureBias", // Exposure bias
|
|
4203
|
-
0x9205 : "MaxApertureValue", // Smallest F number of lens
|
|
4204
|
-
0x9206 : "SubjectDistance", // Distance to subject in meters
|
|
4205
|
-
0x9207 : "MeteringMode", // Metering mode
|
|
4206
|
-
0x9208 : "LightSource", // Kind of light source
|
|
4207
|
-
0x9209 : "Flash", // Flash status
|
|
4208
|
-
0x9214 : "SubjectArea", // Location and area of main subject
|
|
4209
|
-
0x920A : "FocalLength", // Focal length of the lens in mm
|
|
4210
|
-
0xA20B : "FlashEnergy", // Strobe energy in BCPS
|
|
4211
|
-
0xA20C : "SpatialFrequencyResponse", //
|
|
4212
|
-
0xA20E : "FocalPlaneXResolution", // Number of pixels in width direction per FocalPlaneResolutionUnit
|
|
4213
|
-
0xA20F : "FocalPlaneYResolution", // Number of pixels in height direction per FocalPlaneResolutionUnit
|
|
4214
|
-
0xA210 : "FocalPlaneResolutionUnit", // Unit for measuring FocalPlaneXResolution and FocalPlaneYResolution
|
|
4215
|
-
0xA214 : "SubjectLocation", // Location of subject in image
|
|
4216
|
-
0xA215 : "ExposureIndex", // Exposure index selected on camera
|
|
4217
|
-
0xA217 : "SensingMethod", // Image sensor type
|
|
4218
|
-
0xA300 : "FileSource", // Image source (3 == DSC)
|
|
4219
|
-
0xA301 : "SceneType", // Scene type (1 == directly photographed)
|
|
4220
|
-
0xA302 : "CFAPattern", // Color filter array geometric pattern
|
|
4221
|
-
0xA401 : "CustomRendered", // Special processing
|
|
4222
|
-
0xA402 : "ExposureMode", // Exposure mode
|
|
4223
|
-
0xA403 : "WhiteBalance", // 1 = auto white balance, 2 = manual
|
|
4224
|
-
0xA404 : "DigitalZoomRation", // Digital zoom ratio
|
|
4225
|
-
0xA405 : "FocalLengthIn35mmFilm", // Equivalent foacl length assuming 35mm film camera (in mm)
|
|
4226
|
-
0xA406 : "SceneCaptureType", // Type of scene
|
|
4227
|
-
0xA407 : "GainControl", // Degree of overall image gain adjustment
|
|
4228
|
-
0xA408 : "Contrast", // Direction of contrast processing applied by camera
|
|
4229
|
-
0xA409 : "Saturation", // Direction of saturation processing applied by camera
|
|
4230
|
-
0xA40A : "Sharpness", // Direction of sharpness processing applied by camera
|
|
4231
|
-
0xA40B : "DeviceSettingDescription", //
|
|
4232
|
-
0xA40C : "SubjectDistanceRange", // Distance to subject
|
|
4233
|
-
|
|
4234
|
-
// other tags
|
|
4235
|
-
0xA005 : "InteroperabilityIFDPointer",
|
|
4236
|
-
0xA420 : "ImageUniqueID" // Identifier assigned uniquely to each image
|
|
4237
|
-
};
|
|
4238
|
-
|
|
4239
|
-
var TiffTags = EXIF.TiffTags = {
|
|
4240
|
-
0x0100 : "ImageWidth",
|
|
4241
|
-
0x0101 : "ImageHeight",
|
|
4242
|
-
0x8769 : "ExifIFDPointer",
|
|
4243
|
-
0x8825 : "GPSInfoIFDPointer",
|
|
4244
|
-
0xA005 : "InteroperabilityIFDPointer",
|
|
4245
|
-
0x0102 : "BitsPerSample",
|
|
4246
|
-
0x0103 : "Compression",
|
|
4247
|
-
0x0106 : "PhotometricInterpretation",
|
|
4248
|
-
0x0112 : "Orientation",
|
|
4249
|
-
0x0115 : "SamplesPerPixel",
|
|
4250
|
-
0x011C : "PlanarConfiguration",
|
|
4251
|
-
0x0212 : "YCbCrSubSampling",
|
|
4252
|
-
0x0213 : "YCbCrPositioning",
|
|
4253
|
-
0x011A : "XResolution",
|
|
4254
|
-
0x011B : "YResolution",
|
|
4255
|
-
0x0128 : "ResolutionUnit",
|
|
4256
|
-
0x0111 : "StripOffsets",
|
|
4257
|
-
0x0116 : "RowsPerStrip",
|
|
4258
|
-
0x0117 : "StripByteCounts",
|
|
4259
|
-
0x0201 : "JPEGInterchangeFormat",
|
|
4260
|
-
0x0202 : "JPEGInterchangeFormatLength",
|
|
4261
|
-
0x012D : "TransferFunction",
|
|
4262
|
-
0x013E : "WhitePoint",
|
|
4263
|
-
0x013F : "PrimaryChromaticities",
|
|
4264
|
-
0x0211 : "YCbCrCoefficients",
|
|
4265
|
-
0x0214 : "ReferenceBlackWhite",
|
|
4266
|
-
0x0132 : "DateTime",
|
|
4267
|
-
0x010E : "ImageDescription",
|
|
4268
|
-
0x010F : "Make",
|
|
4269
|
-
0x0110 : "Model",
|
|
4270
|
-
0x0131 : "Software",
|
|
4271
|
-
0x013B : "Artist",
|
|
4272
|
-
0x8298 : "Copyright"
|
|
4273
|
-
};
|
|
4274
|
-
|
|
4275
|
-
var GPSTags = EXIF.GPSTags = {
|
|
4276
|
-
0x0000 : "GPSVersionID",
|
|
4277
|
-
0x0001 : "GPSLatitudeRef",
|
|
4278
|
-
0x0002 : "GPSLatitude",
|
|
4279
|
-
0x0003 : "GPSLongitudeRef",
|
|
4280
|
-
0x0004 : "GPSLongitude",
|
|
4281
|
-
0x0005 : "GPSAltitudeRef",
|
|
4282
|
-
0x0006 : "GPSAltitude",
|
|
4283
|
-
0x0007 : "GPSTimeStamp",
|
|
4284
|
-
0x0008 : "GPSSatellites",
|
|
4285
|
-
0x0009 : "GPSStatus",
|
|
4286
|
-
0x000A : "GPSMeasureMode",
|
|
4287
|
-
0x000B : "GPSDOP",
|
|
4288
|
-
0x000C : "GPSSpeedRef",
|
|
4289
|
-
0x000D : "GPSSpeed",
|
|
4290
|
-
0x000E : "GPSTrackRef",
|
|
4291
|
-
0x000F : "GPSTrack",
|
|
4292
|
-
0x0010 : "GPSImgDirectionRef",
|
|
4293
|
-
0x0011 : "GPSImgDirection",
|
|
4294
|
-
0x0012 : "GPSMapDatum",
|
|
4295
|
-
0x0013 : "GPSDestLatitudeRef",
|
|
4296
|
-
0x0014 : "GPSDestLatitude",
|
|
4297
|
-
0x0015 : "GPSDestLongitudeRef",
|
|
4298
|
-
0x0016 : "GPSDestLongitude",
|
|
4299
|
-
0x0017 : "GPSDestBearingRef",
|
|
4300
|
-
0x0018 : "GPSDestBearing",
|
|
4301
|
-
0x0019 : "GPSDestDistanceRef",
|
|
4302
|
-
0x001A : "GPSDestDistance",
|
|
4303
|
-
0x001B : "GPSProcessingMethod",
|
|
4304
|
-
0x001C : "GPSAreaInformation",
|
|
4305
|
-
0x001D : "GPSDateStamp",
|
|
4306
|
-
0x001E : "GPSDifferential"
|
|
4307
|
-
};
|
|
4308
|
-
|
|
4309
|
-
// EXIF 2.3 Spec
|
|
4310
|
-
var IFD1Tags = EXIF.IFD1Tags = {
|
|
4311
|
-
0x0100: "ImageWidth",
|
|
4312
|
-
0x0101: "ImageHeight",
|
|
4313
|
-
0x0102: "BitsPerSample",
|
|
4314
|
-
0x0103: "Compression",
|
|
4315
|
-
0x0106: "PhotometricInterpretation",
|
|
4316
|
-
0x0111: "StripOffsets",
|
|
4317
|
-
0x0112: "Orientation",
|
|
4318
|
-
0x0115: "SamplesPerPixel",
|
|
4319
|
-
0x0116: "RowsPerStrip",
|
|
4320
|
-
0x0117: "StripByteCounts",
|
|
4321
|
-
0x011A: "XResolution",
|
|
4322
|
-
0x011B: "YResolution",
|
|
4323
|
-
0x011C: "PlanarConfiguration",
|
|
4324
|
-
0x0128: "ResolutionUnit",
|
|
4325
|
-
0x0201: "JpegIFOffset", // When image format is JPEG, this value show offset to JPEG data stored.(aka "ThumbnailOffset" or "JPEGInterchangeFormat")
|
|
4326
|
-
0x0202: "JpegIFByteCount", // When image format is JPEG, this value shows data size of JPEG image (aka "ThumbnailLength" or "JPEGInterchangeFormatLength")
|
|
4327
|
-
0x0211: "YCbCrCoefficients",
|
|
4328
|
-
0x0212: "YCbCrSubSampling",
|
|
4329
|
-
0x0213: "YCbCrPositioning",
|
|
4330
|
-
0x0214: "ReferenceBlackWhite"
|
|
4331
|
-
};
|
|
4332
|
-
|
|
4333
|
-
var StringValues = EXIF.StringValues = {
|
|
4334
|
-
ExposureProgram : {
|
|
4335
|
-
0 : "Not defined",
|
|
4336
|
-
1 : "Manual",
|
|
4337
|
-
2 : "Normal program",
|
|
4338
|
-
3 : "Aperture priority",
|
|
4339
|
-
4 : "Shutter priority",
|
|
4340
|
-
5 : "Creative program",
|
|
4341
|
-
6 : "Action program",
|
|
4342
|
-
7 : "Portrait mode",
|
|
4343
|
-
8 : "Landscape mode"
|
|
4344
|
-
},
|
|
4345
|
-
MeteringMode : {
|
|
4346
|
-
0 : "Unknown",
|
|
4347
|
-
1 : "Average",
|
|
4348
|
-
2 : "CenterWeightedAverage",
|
|
4349
|
-
3 : "Spot",
|
|
4350
|
-
4 : "MultiSpot",
|
|
4351
|
-
5 : "Pattern",
|
|
4352
|
-
6 : "Partial",
|
|
4353
|
-
255 : "Other"
|
|
4354
|
-
},
|
|
4355
|
-
LightSource : {
|
|
4356
|
-
0 : "Unknown",
|
|
4357
|
-
1 : "Daylight",
|
|
4358
|
-
2 : "Fluorescent",
|
|
4359
|
-
3 : "Tungsten (incandescent light)",
|
|
4360
|
-
4 : "Flash",
|
|
4361
|
-
9 : "Fine weather",
|
|
4362
|
-
10 : "Cloudy weather",
|
|
4363
|
-
11 : "Shade",
|
|
4364
|
-
12 : "Daylight fluorescent (D 5700 - 7100K)",
|
|
4365
|
-
13 : "Day white fluorescent (N 4600 - 5400K)",
|
|
4366
|
-
14 : "Cool white fluorescent (W 3900 - 4500K)",
|
|
4367
|
-
15 : "White fluorescent (WW 3200 - 3700K)",
|
|
4368
|
-
17 : "Standard light A",
|
|
4369
|
-
18 : "Standard light B",
|
|
4370
|
-
19 : "Standard light C",
|
|
4371
|
-
20 : "D55",
|
|
4372
|
-
21 : "D65",
|
|
4373
|
-
22 : "D75",
|
|
4374
|
-
23 : "D50",
|
|
4375
|
-
24 : "ISO studio tungsten",
|
|
4376
|
-
255 : "Other"
|
|
4377
|
-
},
|
|
4378
|
-
Flash : {
|
|
4379
|
-
0x0000 : "Flash did not fire",
|
|
4380
|
-
0x0001 : "Flash fired",
|
|
4381
|
-
0x0005 : "Strobe return light not detected",
|
|
4382
|
-
0x0007 : "Strobe return light detected",
|
|
4383
|
-
0x0009 : "Flash fired, compulsory flash mode",
|
|
4384
|
-
0x000D : "Flash fired, compulsory flash mode, return light not detected",
|
|
4385
|
-
0x000F : "Flash fired, compulsory flash mode, return light detected",
|
|
4386
|
-
0x0010 : "Flash did not fire, compulsory flash mode",
|
|
4387
|
-
0x0018 : "Flash did not fire, auto mode",
|
|
4388
|
-
0x0019 : "Flash fired, auto mode",
|
|
4389
|
-
0x001D : "Flash fired, auto mode, return light not detected",
|
|
4390
|
-
0x001F : "Flash fired, auto mode, return light detected",
|
|
4391
|
-
0x0020 : "No flash function",
|
|
4392
|
-
0x0041 : "Flash fired, red-eye reduction mode",
|
|
4393
|
-
0x0045 : "Flash fired, red-eye reduction mode, return light not detected",
|
|
4394
|
-
0x0047 : "Flash fired, red-eye reduction mode, return light detected",
|
|
4395
|
-
0x0049 : "Flash fired, compulsory flash mode, red-eye reduction mode",
|
|
4396
|
-
0x004D : "Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",
|
|
4397
|
-
0x004F : "Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",
|
|
4398
|
-
0x0059 : "Flash fired, auto mode, red-eye reduction mode",
|
|
4399
|
-
0x005D : "Flash fired, auto mode, return light not detected, red-eye reduction mode",
|
|
4400
|
-
0x005F : "Flash fired, auto mode, return light detected, red-eye reduction mode"
|
|
4401
|
-
},
|
|
4402
|
-
SensingMethod : {
|
|
4403
|
-
1 : "Not defined",
|
|
4404
|
-
2 : "One-chip color area sensor",
|
|
4405
|
-
3 : "Two-chip color area sensor",
|
|
4406
|
-
4 : "Three-chip color area sensor",
|
|
4407
|
-
5 : "Color sequential area sensor",
|
|
4408
|
-
7 : "Trilinear sensor",
|
|
4409
|
-
8 : "Color sequential linear sensor"
|
|
4410
|
-
},
|
|
4411
|
-
SceneCaptureType : {
|
|
4412
|
-
0 : "Standard",
|
|
4413
|
-
1 : "Landscape",
|
|
4414
|
-
2 : "Portrait",
|
|
4415
|
-
3 : "Night scene"
|
|
4416
|
-
},
|
|
4417
|
-
SceneType : {
|
|
4418
|
-
1 : "Directly photographed"
|
|
4419
|
-
},
|
|
4420
|
-
CustomRendered : {
|
|
4421
|
-
0 : "Normal process",
|
|
4422
|
-
1 : "Custom process"
|
|
4423
|
-
},
|
|
4424
|
-
WhiteBalance : {
|
|
4425
|
-
0 : "Auto white balance",
|
|
4426
|
-
1 : "Manual white balance"
|
|
4427
|
-
},
|
|
4428
|
-
GainControl : {
|
|
4429
|
-
0 : "None",
|
|
4430
|
-
1 : "Low gain up",
|
|
4431
|
-
2 : "High gain up",
|
|
4432
|
-
3 : "Low gain down",
|
|
4433
|
-
4 : "High gain down"
|
|
4434
|
-
},
|
|
4435
|
-
Contrast : {
|
|
4436
|
-
0 : "Normal",
|
|
4437
|
-
1 : "Soft",
|
|
4438
|
-
2 : "Hard"
|
|
4439
|
-
},
|
|
4440
|
-
Saturation : {
|
|
4441
|
-
0 : "Normal",
|
|
4442
|
-
1 : "Low saturation",
|
|
4443
|
-
2 : "High saturation"
|
|
4444
|
-
},
|
|
4445
|
-
Sharpness : {
|
|
4446
|
-
0 : "Normal",
|
|
4447
|
-
1 : "Soft",
|
|
4448
|
-
2 : "Hard"
|
|
4449
|
-
},
|
|
4450
|
-
SubjectDistanceRange : {
|
|
4451
|
-
0 : "Unknown",
|
|
4452
|
-
1 : "Macro",
|
|
4453
|
-
2 : "Close view",
|
|
4454
|
-
3 : "Distant view"
|
|
4455
|
-
},
|
|
4456
|
-
FileSource : {
|
|
4457
|
-
3 : "DSC"
|
|
4458
|
-
},
|
|
4459
|
-
|
|
4460
|
-
Components : {
|
|
4461
|
-
0 : "",
|
|
4462
|
-
1 : "Y",
|
|
4463
|
-
2 : "Cb",
|
|
4464
|
-
3 : "Cr",
|
|
4465
|
-
4 : "R",
|
|
4466
|
-
5 : "G",
|
|
4467
|
-
6 : "B"
|
|
4468
|
-
}
|
|
4469
|
-
};
|
|
4470
|
-
|
|
4471
|
-
function addEvent(element, event, handler) {
|
|
4472
|
-
if (element.addEventListener) {
|
|
4473
|
-
element.addEventListener(event, handler, false);
|
|
4474
|
-
} else if (element.attachEvent) {
|
|
4475
|
-
element.attachEvent("on" + event, handler);
|
|
4476
|
-
}
|
|
4477
|
-
}
|
|
4478
|
-
|
|
4479
|
-
function imageHasData(img) {
|
|
4480
|
-
return !!(img.exifdata);
|
|
4481
|
-
}
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
function base64ToArrayBuffer(base64, contentType) {
|
|
4485
|
-
contentType = contentType || base64.match(/^data\:([^\;]+)\;base64,/mi)[1] || ''; // e.g. 'data:image/jpeg;base64,...' => 'image/jpeg'
|
|
4486
|
-
base64 = base64.replace(/^data\:([^\;]+)\;base64,/gmi, '');
|
|
4487
|
-
var binary = atob(base64);
|
|
4488
|
-
var len = binary.length;
|
|
4489
|
-
var buffer = new ArrayBuffer(len);
|
|
4490
|
-
var view = new Uint8Array(buffer);
|
|
4491
|
-
for (var i = 0; i < len; i++) {
|
|
4492
|
-
view[i] = binary.charCodeAt(i);
|
|
4493
|
-
}
|
|
4494
|
-
return buffer;
|
|
4495
|
-
}
|
|
4496
|
-
|
|
4497
|
-
function objectURLToBlob(url, callback) {
|
|
4498
|
-
var http = new XMLHttpRequest();
|
|
4499
|
-
http.open("GET", url, true);
|
|
4500
|
-
http.responseType = "blob";
|
|
4501
|
-
http.onload = function(e) {
|
|
4502
|
-
if (this.status == 200 || this.status === 0) {
|
|
4503
|
-
callback(this.response);
|
|
4504
|
-
}
|
|
4505
|
-
};
|
|
4506
|
-
http.send();
|
|
4507
|
-
}
|
|
4508
|
-
|
|
4509
|
-
function getImageData(img, callback) {
|
|
4510
|
-
function handleBinaryFile(binFile) {
|
|
4511
|
-
var data = findEXIFinJPEG(binFile);
|
|
4512
|
-
img.exifdata = data || {};
|
|
4513
|
-
var iptcdata = findIPTCinJPEG(binFile);
|
|
4514
|
-
img.iptcdata = iptcdata || {};
|
|
4515
|
-
if (EXIF.isXmpEnabled) {
|
|
4516
|
-
var xmpdata= findXMPinJPEG(binFile);
|
|
4517
|
-
img.xmpdata = xmpdata || {};
|
|
4518
|
-
}
|
|
4519
|
-
if (callback) {
|
|
4520
|
-
callback.call(img);
|
|
4521
|
-
}
|
|
4522
|
-
}
|
|
4523
|
-
|
|
4524
|
-
if (img.src) {
|
|
4525
|
-
if (/^data\:/i.test(img.src)) { // Data URI
|
|
4526
|
-
var arrayBuffer = base64ToArrayBuffer(img.src);
|
|
4527
|
-
handleBinaryFile(arrayBuffer);
|
|
4528
|
-
|
|
4529
|
-
} else if (/^blob\:/i.test(img.src)) { // Object URL
|
|
4530
|
-
var fileReader = new FileReader();
|
|
4531
|
-
fileReader.onload = function(e) {
|
|
4532
|
-
handleBinaryFile(e.target.result);
|
|
4533
|
-
};
|
|
4534
|
-
objectURLToBlob(img.src, function (blob) {
|
|
4535
|
-
fileReader.readAsArrayBuffer(blob);
|
|
4536
|
-
});
|
|
4537
|
-
} else {
|
|
4538
|
-
var http = new XMLHttpRequest();
|
|
4539
|
-
http.onload = function() {
|
|
4540
|
-
if (this.status == 200 || this.status === 0) {
|
|
4541
|
-
handleBinaryFile(http.response);
|
|
4542
|
-
} else {
|
|
4543
|
-
throw "Could not load image";
|
|
4544
|
-
}
|
|
4545
|
-
http = null;
|
|
4546
|
-
};
|
|
4547
|
-
http.open("GET", img.src, true);
|
|
4548
|
-
http.responseType = "arraybuffer";
|
|
4549
|
-
http.send(null);
|
|
4550
|
-
}
|
|
4551
|
-
} else if (self.FileReader && (img instanceof self.Blob || img instanceof self.File)) {
|
|
4552
|
-
var fileReader = new FileReader();
|
|
4553
|
-
fileReader.onload = function(e) {
|
|
4554
|
-
if (debug) console.log("Got file of length " + e.target.result.byteLength);
|
|
4555
|
-
handleBinaryFile(e.target.result);
|
|
4556
|
-
};
|
|
4557
|
-
|
|
4558
|
-
fileReader.readAsArrayBuffer(img);
|
|
4559
|
-
}
|
|
4560
|
-
}
|
|
4561
|
-
|
|
4562
|
-
function findEXIFinJPEG(file) {
|
|
4563
|
-
var dataView = new DataView(file);
|
|
4564
|
-
|
|
4565
|
-
if (debug) console.log("Got file of length " + file.byteLength);
|
|
4566
|
-
if ((dataView.getUint8(0) != 0xFF) || (dataView.getUint8(1) != 0xD8)) {
|
|
4567
|
-
if (debug) console.log("Not a valid JPEG");
|
|
4568
|
-
return false; // not a valid jpeg
|
|
4569
|
-
}
|
|
4570
|
-
|
|
4571
|
-
var offset = 2,
|
|
4572
|
-
length = file.byteLength,
|
|
4573
|
-
marker;
|
|
4574
|
-
|
|
4575
|
-
while (offset < length) {
|
|
4576
|
-
if (dataView.getUint8(offset) != 0xFF) {
|
|
4577
|
-
if (debug) console.log("Not a valid marker at offset " + offset + ", found: " + dataView.getUint8(offset));
|
|
4578
|
-
return false; // not a valid marker, something is wrong
|
|
4579
|
-
}
|
|
4580
|
-
|
|
4581
|
-
marker = dataView.getUint8(offset + 1);
|
|
4582
|
-
if (debug) console.log(marker);
|
|
4583
|
-
|
|
4584
|
-
// we could implement handling for other markers here,
|
|
4585
|
-
// but we're only looking for 0xFFE1 for EXIF data
|
|
4586
|
-
|
|
4587
|
-
if (marker == 225) {
|
|
4588
|
-
if (debug) console.log("Found 0xFFE1 marker");
|
|
4589
|
-
|
|
4590
|
-
return readEXIFData(dataView, offset + 4, dataView.getUint16(offset + 2) - 2);
|
|
4591
|
-
|
|
4592
|
-
// offset += 2 + file.getShortAt(offset+2, true);
|
|
4593
|
-
|
|
4594
|
-
} else {
|
|
4595
|
-
offset += 2 + dataView.getUint16(offset+2);
|
|
4596
|
-
}
|
|
4597
|
-
|
|
4598
|
-
}
|
|
4599
|
-
|
|
4600
|
-
}
|
|
4601
|
-
|
|
4602
|
-
function findIPTCinJPEG(file) {
|
|
4603
|
-
var dataView = new DataView(file);
|
|
4604
|
-
|
|
4605
|
-
if (debug) console.log("Got file of length " + file.byteLength);
|
|
4606
|
-
if ((dataView.getUint8(0) != 0xFF) || (dataView.getUint8(1) != 0xD8)) {
|
|
4607
|
-
if (debug) console.log("Not a valid JPEG");
|
|
4608
|
-
return false; // not a valid jpeg
|
|
4609
|
-
}
|
|
4610
|
-
|
|
4611
|
-
var offset = 2,
|
|
4612
|
-
length = file.byteLength;
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
var isFieldSegmentStart = function(dataView, offset){
|
|
4616
|
-
return (
|
|
4617
|
-
dataView.getUint8(offset) === 0x38 &&
|
|
4618
|
-
dataView.getUint8(offset+1) === 0x42 &&
|
|
4619
|
-
dataView.getUint8(offset+2) === 0x49 &&
|
|
4620
|
-
dataView.getUint8(offset+3) === 0x4D &&
|
|
4621
|
-
dataView.getUint8(offset+4) === 0x04 &&
|
|
4622
|
-
dataView.getUint8(offset+5) === 0x04
|
|
4623
|
-
);
|
|
4624
|
-
};
|
|
4625
|
-
|
|
4626
|
-
while (offset < length) {
|
|
4627
|
-
|
|
4628
|
-
if ( isFieldSegmentStart(dataView, offset )){
|
|
4629
|
-
|
|
4630
|
-
// Get the length of the name header (which is padded to an even number of bytes)
|
|
4631
|
-
var nameHeaderLength = dataView.getUint8(offset+7);
|
|
4632
|
-
if(nameHeaderLength % 2 !== 0) nameHeaderLength += 1;
|
|
4633
|
-
// Check for pre photoshop 6 format
|
|
4634
|
-
if(nameHeaderLength === 0) {
|
|
4635
|
-
// Always 4
|
|
4636
|
-
nameHeaderLength = 4;
|
|
4637
|
-
}
|
|
4638
|
-
|
|
4639
|
-
var startOffset = offset + 8 + nameHeaderLength;
|
|
4640
|
-
var sectionLength = dataView.getUint16(offset + 6 + nameHeaderLength);
|
|
4641
|
-
|
|
4642
|
-
return readIPTCData(file, startOffset, sectionLength);
|
|
4643
|
-
|
|
4644
|
-
// removed by dead control flow
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
}
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
// Not the marker, continue searching
|
|
4651
|
-
offset++;
|
|
4652
|
-
|
|
4653
|
-
}
|
|
4654
|
-
|
|
4655
|
-
}
|
|
4656
|
-
var IptcFieldMap = {
|
|
4657
|
-
0x78 : 'caption',
|
|
4658
|
-
0x6E : 'credit',
|
|
4659
|
-
0x19 : 'keywords',
|
|
4660
|
-
0x37 : 'dateCreated',
|
|
4661
|
-
0x50 : 'byline',
|
|
4662
|
-
0x55 : 'bylineTitle',
|
|
4663
|
-
0x7A : 'captionWriter',
|
|
4664
|
-
0x69 : 'headline',
|
|
4665
|
-
0x74 : 'copyright',
|
|
4666
|
-
0x0F : 'category'
|
|
4667
|
-
};
|
|
4668
|
-
function readIPTCData(file, startOffset, sectionLength){
|
|
4669
|
-
var dataView = new DataView(file);
|
|
4670
|
-
var data = {};
|
|
4671
|
-
var fieldValue, fieldName, dataSize, segmentType, segmentSize;
|
|
4672
|
-
var segmentStartPos = startOffset;
|
|
4673
|
-
while(segmentStartPos < startOffset+sectionLength) {
|
|
4674
|
-
if(dataView.getUint8(segmentStartPos) === 0x1C && dataView.getUint8(segmentStartPos+1) === 0x02){
|
|
4675
|
-
segmentType = dataView.getUint8(segmentStartPos+2);
|
|
4676
|
-
if(segmentType in IptcFieldMap) {
|
|
4677
|
-
dataSize = dataView.getInt16(segmentStartPos+3);
|
|
4678
|
-
segmentSize = dataSize + 5;
|
|
4679
|
-
fieldName = IptcFieldMap[segmentType];
|
|
4680
|
-
fieldValue = getStringFromDB(dataView, segmentStartPos+5, dataSize);
|
|
4681
|
-
// Check if we already stored a value with this name
|
|
4682
|
-
if(data.hasOwnProperty(fieldName)) {
|
|
4683
|
-
// Value already stored with this name, create multivalue field
|
|
4684
|
-
if(data[fieldName] instanceof Array) {
|
|
4685
|
-
data[fieldName].push(fieldValue);
|
|
4686
|
-
}
|
|
4687
|
-
else {
|
|
4688
|
-
data[fieldName] = [data[fieldName], fieldValue];
|
|
4689
|
-
}
|
|
4690
|
-
}
|
|
4691
|
-
else {
|
|
4692
|
-
data[fieldName] = fieldValue;
|
|
4693
|
-
}
|
|
4694
|
-
}
|
|
4695
|
-
|
|
4696
|
-
}
|
|
4697
|
-
segmentStartPos++;
|
|
4698
|
-
}
|
|
4699
|
-
return data;
|
|
4700
|
-
}
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
function readTags(file, tiffStart, dirStart, strings, bigEnd) {
|
|
4705
|
-
var entries = file.getUint16(dirStart, !bigEnd),
|
|
4706
|
-
tags = {},
|
|
4707
|
-
entryOffset, tag,
|
|
4708
|
-
i;
|
|
4709
|
-
|
|
4710
|
-
for (i=0;i<entries;i++) {
|
|
4711
|
-
entryOffset = dirStart + i*12 + 2;
|
|
4712
|
-
tag = strings[file.getUint16(entryOffset, !bigEnd)];
|
|
4713
|
-
if (!tag && debug) console.log("Unknown tag: " + file.getUint16(entryOffset, !bigEnd));
|
|
4714
|
-
tags[tag] = readTagValue(file, entryOffset, tiffStart, dirStart, bigEnd);
|
|
4715
|
-
}
|
|
4716
|
-
return tags;
|
|
4717
|
-
}
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
function readTagValue(file, entryOffset, tiffStart, dirStart, bigEnd) {
|
|
4721
|
-
var type = file.getUint16(entryOffset+2, !bigEnd),
|
|
4722
|
-
numValues = file.getUint32(entryOffset+4, !bigEnd),
|
|
4723
|
-
valueOffset = file.getUint32(entryOffset+8, !bigEnd) + tiffStart,
|
|
4724
|
-
offset,
|
|
4725
|
-
vals, val, n,
|
|
4726
|
-
numerator, denominator;
|
|
4727
|
-
|
|
4728
|
-
switch (type) {
|
|
4729
|
-
case 1: // byte, 8-bit unsigned int
|
|
4730
|
-
case 7: // undefined, 8-bit byte, value depending on field
|
|
4731
|
-
if (numValues == 1) {
|
|
4732
|
-
return file.getUint8(entryOffset + 8, !bigEnd);
|
|
4733
|
-
} else {
|
|
4734
|
-
offset = numValues > 4 ? valueOffset : (entryOffset + 8);
|
|
4735
|
-
vals = [];
|
|
4736
|
-
for (n=0;n<numValues;n++) {
|
|
4737
|
-
vals[n] = file.getUint8(offset + n);
|
|
4738
|
-
}
|
|
4739
|
-
return vals;
|
|
4740
|
-
}
|
|
4741
|
-
|
|
4742
|
-
case 2: // ascii, 8-bit byte
|
|
4743
|
-
offset = numValues > 4 ? valueOffset : (entryOffset + 8);
|
|
4744
|
-
return getStringFromDB(file, offset, numValues-1);
|
|
4745
|
-
|
|
4746
|
-
case 3: // short, 16 bit int
|
|
4747
|
-
if (numValues == 1) {
|
|
4748
|
-
return file.getUint16(entryOffset + 8, !bigEnd);
|
|
4749
|
-
} else {
|
|
4750
|
-
offset = numValues > 2 ? valueOffset : (entryOffset + 8);
|
|
4751
|
-
vals = [];
|
|
4752
|
-
for (n=0;n<numValues;n++) {
|
|
4753
|
-
vals[n] = file.getUint16(offset + 2*n, !bigEnd);
|
|
4754
|
-
}
|
|
4755
|
-
return vals;
|
|
4756
|
-
}
|
|
4757
|
-
|
|
4758
|
-
case 4: // long, 32 bit int
|
|
4759
|
-
if (numValues == 1) {
|
|
4760
|
-
return file.getUint32(entryOffset + 8, !bigEnd);
|
|
4761
|
-
} else {
|
|
4762
|
-
vals = [];
|
|
4763
|
-
for (n=0;n<numValues;n++) {
|
|
4764
|
-
vals[n] = file.getUint32(valueOffset + 4*n, !bigEnd);
|
|
4765
|
-
}
|
|
4766
|
-
return vals;
|
|
4767
|
-
}
|
|
4768
|
-
|
|
4769
|
-
case 5: // rational = two long values, first is numerator, second is denominator
|
|
4770
|
-
if (numValues == 1) {
|
|
4771
|
-
numerator = file.getUint32(valueOffset, !bigEnd);
|
|
4772
|
-
denominator = file.getUint32(valueOffset+4, !bigEnd);
|
|
4773
|
-
val = new Number(numerator / denominator);
|
|
4774
|
-
val.numerator = numerator;
|
|
4775
|
-
val.denominator = denominator;
|
|
4776
|
-
return val;
|
|
4777
|
-
} else {
|
|
4778
|
-
vals = [];
|
|
4779
|
-
for (n=0;n<numValues;n++) {
|
|
4780
|
-
numerator = file.getUint32(valueOffset + 8*n, !bigEnd);
|
|
4781
|
-
denominator = file.getUint32(valueOffset+4 + 8*n, !bigEnd);
|
|
4782
|
-
vals[n] = new Number(numerator / denominator);
|
|
4783
|
-
vals[n].numerator = numerator;
|
|
4784
|
-
vals[n].denominator = denominator;
|
|
4785
|
-
}
|
|
4786
|
-
return vals;
|
|
4787
|
-
}
|
|
4788
|
-
|
|
4789
|
-
case 9: // slong, 32 bit signed int
|
|
4790
|
-
if (numValues == 1) {
|
|
4791
|
-
return file.getInt32(entryOffset + 8, !bigEnd);
|
|
4792
|
-
} else {
|
|
4793
|
-
vals = [];
|
|
4794
|
-
for (n=0;n<numValues;n++) {
|
|
4795
|
-
vals[n] = file.getInt32(valueOffset + 4*n, !bigEnd);
|
|
4796
|
-
}
|
|
4797
|
-
return vals;
|
|
4798
|
-
}
|
|
4799
|
-
|
|
4800
|
-
case 10: // signed rational, two slongs, first is numerator, second is denominator
|
|
4801
|
-
if (numValues == 1) {
|
|
4802
|
-
return file.getInt32(valueOffset, !bigEnd) / file.getInt32(valueOffset+4, !bigEnd);
|
|
4803
|
-
} else {
|
|
4804
|
-
vals = [];
|
|
4805
|
-
for (n=0;n<numValues;n++) {
|
|
4806
|
-
vals[n] = file.getInt32(valueOffset + 8*n, !bigEnd) / file.getInt32(valueOffset+4 + 8*n, !bigEnd);
|
|
4807
|
-
}
|
|
4808
|
-
return vals;
|
|
4809
|
-
}
|
|
4810
|
-
}
|
|
4811
|
-
}
|
|
4812
|
-
|
|
4813
|
-
/**
|
|
4814
|
-
* Given an IFD (Image File Directory) start offset
|
|
4815
|
-
* returns an offset to next IFD or 0 if it's the last IFD.
|
|
4816
|
-
*/
|
|
4817
|
-
function getNextIFDOffset(dataView, dirStart, bigEnd){
|
|
4818
|
-
//the first 2bytes means the number of directory entries contains in this IFD
|
|
4819
|
-
var entries = dataView.getUint16(dirStart, !bigEnd);
|
|
4820
|
-
|
|
4821
|
-
// After last directory entry, there is a 4bytes of data,
|
|
4822
|
-
// it means an offset to next IFD.
|
|
4823
|
-
// If its value is '0x00000000', it means this is the last IFD and there is no linked IFD.
|
|
4824
|
-
|
|
4825
|
-
return dataView.getUint32(dirStart + 2 + entries * 12, !bigEnd); // each entry is 12 bytes long
|
|
4826
|
-
}
|
|
4827
|
-
|
|
4828
|
-
function readThumbnailImage(dataView, tiffStart, firstIFDOffset, bigEnd){
|
|
4829
|
-
// get the IFD1 offset
|
|
4830
|
-
var IFD1OffsetPointer = getNextIFDOffset(dataView, tiffStart+firstIFDOffset, bigEnd);
|
|
4831
|
-
|
|
4832
|
-
if (!IFD1OffsetPointer) {
|
|
4833
|
-
// console.log('******** IFD1Offset is empty, image thumb not found ********');
|
|
4834
|
-
return {};
|
|
4835
|
-
}
|
|
4836
|
-
else if (IFD1OffsetPointer > dataView.byteLength) { // this should not happen
|
|
4837
|
-
// console.log('******** IFD1Offset is outside the bounds of the DataView ********');
|
|
4838
|
-
return {};
|
|
4839
|
-
}
|
|
4840
|
-
// console.log('******* thumbnail IFD offset (IFD1) is: %s', IFD1OffsetPointer);
|
|
4841
|
-
|
|
4842
|
-
var thumbTags = readTags(dataView, tiffStart, tiffStart + IFD1OffsetPointer, IFD1Tags, bigEnd)
|
|
4843
|
-
|
|
4844
|
-
// EXIF 2.3 specification for JPEG format thumbnail
|
|
4845
|
-
|
|
4846
|
-
// If the value of Compression(0x0103) Tag in IFD1 is '6', thumbnail image format is JPEG.
|
|
4847
|
-
// Most of Exif image uses JPEG format for thumbnail. In that case, you can get offset of thumbnail
|
|
4848
|
-
// by JpegIFOffset(0x0201) Tag in IFD1, size of thumbnail by JpegIFByteCount(0x0202) Tag.
|
|
4849
|
-
// Data format is ordinary JPEG format, starts from 0xFFD8 and ends by 0xFFD9. It seems that
|
|
4850
|
-
// JPEG format and 160x120pixels of size are recommended thumbnail format for Exif2.1 or later.
|
|
4851
|
-
|
|
4852
|
-
if (thumbTags['Compression']) {
|
|
4853
|
-
// console.log('Thumbnail image found!');
|
|
4854
|
-
|
|
4855
|
-
switch (thumbTags['Compression']) {
|
|
4856
|
-
case 6:
|
|
4857
|
-
// console.log('Thumbnail image format is JPEG');
|
|
4858
|
-
if (thumbTags.JpegIFOffset && thumbTags.JpegIFByteCount) {
|
|
4859
|
-
// extract the thumbnail
|
|
4860
|
-
var tOffset = tiffStart + thumbTags.JpegIFOffset;
|
|
4861
|
-
var tLength = thumbTags.JpegIFByteCount;
|
|
4862
|
-
thumbTags['blob'] = new Blob([new Uint8Array(dataView.buffer, tOffset, tLength)], {
|
|
4863
|
-
type: 'image/jpeg'
|
|
4864
|
-
});
|
|
4865
|
-
}
|
|
4866
|
-
break;
|
|
4867
|
-
|
|
4868
|
-
case 1:
|
|
4869
|
-
console.log("Thumbnail image format is TIFF, which is not implemented.");
|
|
4870
|
-
break;
|
|
4871
|
-
default:
|
|
4872
|
-
console.log("Unknown thumbnail image format '%s'", thumbTags['Compression']);
|
|
4873
|
-
}
|
|
4874
|
-
}
|
|
4875
|
-
else if (thumbTags['PhotometricInterpretation'] == 2) {
|
|
4876
|
-
console.log("Thumbnail image format is RGB, which is not implemented.");
|
|
4877
|
-
}
|
|
4878
|
-
return thumbTags;
|
|
4879
|
-
}
|
|
4880
|
-
|
|
4881
|
-
function getStringFromDB(buffer, start, length) {
|
|
4882
|
-
var outstr = "";
|
|
4883
|
-
for (n = start; n < start+length; n++) {
|
|
4884
|
-
outstr += String.fromCharCode(buffer.getUint8(n));
|
|
4885
|
-
}
|
|
4886
|
-
return outstr;
|
|
4887
|
-
}
|
|
4888
|
-
|
|
4889
|
-
function readEXIFData(file, start) {
|
|
4890
|
-
if (getStringFromDB(file, start, 4) != "Exif") {
|
|
4891
|
-
if (debug) console.log("Not valid EXIF data! " + getStringFromDB(file, start, 4));
|
|
4892
|
-
return false;
|
|
4893
|
-
}
|
|
4894
|
-
|
|
4895
|
-
var bigEnd,
|
|
4896
|
-
tags, tag,
|
|
4897
|
-
exifData, gpsData,
|
|
4898
|
-
tiffOffset = start + 6;
|
|
4899
|
-
|
|
4900
|
-
// test for TIFF validity and endianness
|
|
4901
|
-
if (file.getUint16(tiffOffset) == 0x4949) {
|
|
4902
|
-
bigEnd = false;
|
|
4903
|
-
} else if (file.getUint16(tiffOffset) == 0x4D4D) {
|
|
4904
|
-
bigEnd = true;
|
|
4905
|
-
} else {
|
|
4906
|
-
if (debug) console.log("Not valid TIFF data! (no 0x4949 or 0x4D4D)");
|
|
4907
|
-
return false;
|
|
4908
|
-
}
|
|
4909
|
-
|
|
4910
|
-
if (file.getUint16(tiffOffset+2, !bigEnd) != 0x002A) {
|
|
4911
|
-
if (debug) console.log("Not valid TIFF data! (no 0x002A)");
|
|
4912
|
-
return false;
|
|
4913
|
-
}
|
|
4914
|
-
|
|
4915
|
-
var firstIFDOffset = file.getUint32(tiffOffset+4, !bigEnd);
|
|
4916
|
-
|
|
4917
|
-
if (firstIFDOffset < 0x00000008) {
|
|
4918
|
-
if (debug) console.log("Not valid TIFF data! (First offset less than 8)", file.getUint32(tiffOffset+4, !bigEnd));
|
|
4919
|
-
return false;
|
|
4920
|
-
}
|
|
4921
|
-
|
|
4922
|
-
tags = readTags(file, tiffOffset, tiffOffset + firstIFDOffset, TiffTags, bigEnd);
|
|
4923
|
-
|
|
4924
|
-
if (tags.ExifIFDPointer) {
|
|
4925
|
-
exifData = readTags(file, tiffOffset, tiffOffset + tags.ExifIFDPointer, ExifTags, bigEnd);
|
|
4926
|
-
for (tag in exifData) {
|
|
4927
|
-
switch (tag) {
|
|
4928
|
-
case "LightSource" :
|
|
4929
|
-
case "Flash" :
|
|
4930
|
-
case "MeteringMode" :
|
|
4931
|
-
case "ExposureProgram" :
|
|
4932
|
-
case "SensingMethod" :
|
|
4933
|
-
case "SceneCaptureType" :
|
|
4934
|
-
case "SceneType" :
|
|
4935
|
-
case "CustomRendered" :
|
|
4936
|
-
case "WhiteBalance" :
|
|
4937
|
-
case "GainControl" :
|
|
4938
|
-
case "Contrast" :
|
|
4939
|
-
case "Saturation" :
|
|
4940
|
-
case "Sharpness" :
|
|
4941
|
-
case "SubjectDistanceRange" :
|
|
4942
|
-
case "FileSource" :
|
|
4943
|
-
exifData[tag] = StringValues[tag][exifData[tag]];
|
|
4944
|
-
break;
|
|
4945
|
-
|
|
4946
|
-
case "ExifVersion" :
|
|
4947
|
-
case "FlashpixVersion" :
|
|
4948
|
-
exifData[tag] = String.fromCharCode(exifData[tag][0], exifData[tag][1], exifData[tag][2], exifData[tag][3]);
|
|
4949
|
-
break;
|
|
4950
|
-
|
|
4951
|
-
case "ComponentsConfiguration" :
|
|
4952
|
-
exifData[tag] =
|
|
4953
|
-
StringValues.Components[exifData[tag][0]] +
|
|
4954
|
-
StringValues.Components[exifData[tag][1]] +
|
|
4955
|
-
StringValues.Components[exifData[tag][2]] +
|
|
4956
|
-
StringValues.Components[exifData[tag][3]];
|
|
4957
|
-
break;
|
|
4958
|
-
}
|
|
4959
|
-
tags[tag] = exifData[tag];
|
|
4960
|
-
}
|
|
4961
|
-
}
|
|
4962
|
-
|
|
4963
|
-
if (tags.GPSInfoIFDPointer) {
|
|
4964
|
-
gpsData = readTags(file, tiffOffset, tiffOffset + tags.GPSInfoIFDPointer, GPSTags, bigEnd);
|
|
4965
|
-
for (tag in gpsData) {
|
|
4966
|
-
switch (tag) {
|
|
4967
|
-
case "GPSVersionID" :
|
|
4968
|
-
gpsData[tag] = gpsData[tag][0] +
|
|
4969
|
-
"." + gpsData[tag][1] +
|
|
4970
|
-
"." + gpsData[tag][2] +
|
|
4971
|
-
"." + gpsData[tag][3];
|
|
4972
|
-
break;
|
|
4973
|
-
}
|
|
4974
|
-
tags[tag] = gpsData[tag];
|
|
4975
|
-
}
|
|
4976
|
-
}
|
|
4977
|
-
|
|
4978
|
-
// extract thumbnail
|
|
4979
|
-
tags['thumbnail'] = readThumbnailImage(file, tiffOffset, firstIFDOffset, bigEnd);
|
|
4980
|
-
|
|
4981
|
-
return tags;
|
|
4982
|
-
}
|
|
4983
|
-
|
|
4984
|
-
function findXMPinJPEG(file) {
|
|
4985
|
-
|
|
4986
|
-
if (!('DOMParser' in self)) {
|
|
4987
|
-
// console.warn('XML parsing not supported without DOMParser');
|
|
4988
|
-
return;
|
|
4989
|
-
}
|
|
4990
|
-
var dataView = new DataView(file);
|
|
4991
|
-
|
|
4992
|
-
if (debug) console.log("Got file of length " + file.byteLength);
|
|
4993
|
-
if ((dataView.getUint8(0) != 0xFF) || (dataView.getUint8(1) != 0xD8)) {
|
|
4994
|
-
if (debug) console.log("Not a valid JPEG");
|
|
4995
|
-
return false; // not a valid jpeg
|
|
4996
|
-
}
|
|
4997
|
-
|
|
4998
|
-
var offset = 2,
|
|
4999
|
-
length = file.byteLength,
|
|
5000
|
-
dom = new DOMParser();
|
|
5001
|
-
|
|
5002
|
-
while (offset < (length-4)) {
|
|
5003
|
-
if (getStringFromDB(dataView, offset, 4) == "http") {
|
|
5004
|
-
var startOffset = offset - 1;
|
|
5005
|
-
var sectionLength = dataView.getUint16(offset - 2) - 1;
|
|
5006
|
-
var xmpString = getStringFromDB(dataView, startOffset, sectionLength)
|
|
5007
|
-
var xmpEndIndex = xmpString.indexOf('xmpmeta>') + 8;
|
|
5008
|
-
xmpString = xmpString.substring( xmpString.indexOf( '<x:xmpmeta' ), xmpEndIndex );
|
|
5009
|
-
|
|
5010
|
-
var indexOfXmp = xmpString.indexOf('x:xmpmeta') + 10
|
|
5011
|
-
//Many custom written programs embed xmp/xml without any namespace. Following are some of them.
|
|
5012
|
-
//Without these namespaces, XML is thought to be invalid by parsers
|
|
5013
|
-
xmpString = xmpString.slice(0, indexOfXmp)
|
|
5014
|
-
+ 'xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/" '
|
|
5015
|
-
+ 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '
|
|
5016
|
-
+ 'xmlns:tiff="http://ns.adobe.com/tiff/1.0/" '
|
|
5017
|
-
+ 'xmlns:plus="http://schemas.android.com/apk/lib/com.google.android.gms.plus" '
|
|
5018
|
-
+ 'xmlns:ext="http://www.gettyimages.com/xsltExtension/1.0" '
|
|
5019
|
-
+ 'xmlns:exif="http://ns.adobe.com/exif/1.0/" '
|
|
5020
|
-
+ 'xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" '
|
|
5021
|
-
+ 'xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" '
|
|
5022
|
-
+ 'xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/" '
|
|
5023
|
-
+ 'xmlns:xapGImg="http://ns.adobe.com/xap/1.0/g/img/" '
|
|
5024
|
-
+ 'xmlns:Iptc4xmpExt="http://iptc.org/std/Iptc4xmpExt/2008-02-29/" '
|
|
5025
|
-
+ xmpString.slice(indexOfXmp)
|
|
5026
|
-
|
|
5027
|
-
var domDocument = dom.parseFromString( xmpString, 'text/xml' );
|
|
5028
|
-
return xml2Object(domDocument);
|
|
5029
|
-
} else{
|
|
5030
|
-
offset++;
|
|
5031
|
-
}
|
|
5032
|
-
}
|
|
5033
|
-
}
|
|
5034
|
-
|
|
5035
|
-
function xml2json(xml) {
|
|
5036
|
-
var json = {};
|
|
5037
|
-
|
|
5038
|
-
if (xml.nodeType == 1) { // element node
|
|
5039
|
-
if (xml.attributes.length > 0) {
|
|
5040
|
-
json['@attributes'] = {};
|
|
5041
|
-
for (var j = 0; j < xml.attributes.length; j++) {
|
|
5042
|
-
var attribute = xml.attributes.item(j);
|
|
5043
|
-
json['@attributes'][attribute.nodeName] = attribute.nodeValue;
|
|
5044
|
-
}
|
|
5045
|
-
}
|
|
5046
|
-
} else if (xml.nodeType == 3) { // text node
|
|
5047
|
-
return xml.nodeValue;
|
|
5048
|
-
}
|
|
5049
|
-
|
|
5050
|
-
// deal with children
|
|
5051
|
-
if (xml.hasChildNodes()) {
|
|
5052
|
-
for(var i = 0; i < xml.childNodes.length; i++) {
|
|
5053
|
-
var child = xml.childNodes.item(i);
|
|
5054
|
-
var nodeName = child.nodeName;
|
|
5055
|
-
if (json[nodeName] == null) {
|
|
5056
|
-
json[nodeName] = xml2json(child);
|
|
5057
|
-
} else {
|
|
5058
|
-
if (json[nodeName].push == null) {
|
|
5059
|
-
var old = json[nodeName];
|
|
5060
|
-
json[nodeName] = [];
|
|
5061
|
-
json[nodeName].push(old);
|
|
5062
|
-
}
|
|
5063
|
-
json[nodeName].push(xml2json(child));
|
|
5064
|
-
}
|
|
5065
|
-
}
|
|
5066
|
-
}
|
|
5067
|
-
|
|
5068
|
-
return json;
|
|
5069
|
-
}
|
|
5070
|
-
|
|
5071
|
-
function xml2Object(xml) {
|
|
5072
|
-
try {
|
|
5073
|
-
var obj = {};
|
|
5074
|
-
if (xml.children.length > 0) {
|
|
5075
|
-
for (var i = 0; i < xml.children.length; i++) {
|
|
5076
|
-
var item = xml.children.item(i);
|
|
5077
|
-
var attributes = item.attributes;
|
|
5078
|
-
for(var idx in attributes) {
|
|
5079
|
-
var itemAtt = attributes[idx];
|
|
5080
|
-
var dataKey = itemAtt.nodeName;
|
|
5081
|
-
var dataValue = itemAtt.nodeValue;
|
|
5082
|
-
|
|
5083
|
-
if(dataKey !== undefined) {
|
|
5084
|
-
obj[dataKey] = dataValue;
|
|
5085
|
-
}
|
|
5086
|
-
}
|
|
5087
|
-
var nodeName = item.nodeName;
|
|
5088
|
-
|
|
5089
|
-
if (typeof (obj[nodeName]) == "undefined") {
|
|
5090
|
-
obj[nodeName] = xml2json(item);
|
|
5091
|
-
} else {
|
|
5092
|
-
if (typeof (obj[nodeName].push) == "undefined") {
|
|
5093
|
-
var old = obj[nodeName];
|
|
5094
|
-
|
|
5095
|
-
obj[nodeName] = [];
|
|
5096
|
-
obj[nodeName].push(old);
|
|
5097
|
-
}
|
|
5098
|
-
obj[nodeName].push(xml2json(item));
|
|
5099
|
-
}
|
|
5100
|
-
}
|
|
5101
|
-
} else {
|
|
5102
|
-
obj = xml.textContent;
|
|
5103
|
-
}
|
|
5104
|
-
return obj;
|
|
5105
|
-
} catch (e) {
|
|
5106
|
-
console.log(e.message);
|
|
5107
|
-
}
|
|
5108
|
-
}
|
|
5109
|
-
|
|
5110
|
-
EXIF.enableXmp = function() {
|
|
5111
|
-
EXIF.isXmpEnabled = true;
|
|
5112
|
-
}
|
|
5113
|
-
|
|
5114
|
-
EXIF.disableXmp = function() {
|
|
5115
|
-
EXIF.isXmpEnabled = false;
|
|
5116
|
-
}
|
|
5117
|
-
|
|
5118
|
-
EXIF.getData = function(img, callback) {
|
|
5119
|
-
if (((self.Image && img instanceof self.Image)
|
|
5120
|
-
|| (self.HTMLImageElement && img instanceof self.HTMLImageElement))
|
|
5121
|
-
&& !img.complete)
|
|
5122
|
-
return false;
|
|
5123
|
-
|
|
5124
|
-
if (!imageHasData(img)) {
|
|
5125
|
-
getImageData(img, callback);
|
|
5126
|
-
} else {
|
|
5127
|
-
if (callback) {
|
|
5128
|
-
callback.call(img);
|
|
5129
|
-
}
|
|
5130
|
-
}
|
|
5131
|
-
return true;
|
|
5132
|
-
}
|
|
5133
|
-
|
|
5134
|
-
EXIF.getTag = function(img, tag) {
|
|
5135
|
-
if (!imageHasData(img)) return;
|
|
5136
|
-
return img.exifdata[tag];
|
|
5137
|
-
}
|
|
5138
|
-
|
|
5139
|
-
EXIF.getIptcTag = function(img, tag) {
|
|
5140
|
-
if (!imageHasData(img)) return;
|
|
5141
|
-
return img.iptcdata[tag];
|
|
5142
|
-
}
|
|
5143
|
-
|
|
5144
|
-
EXIF.getAllTags = function(img) {
|
|
5145
|
-
if (!imageHasData(img)) return {};
|
|
5146
|
-
var a,
|
|
5147
|
-
data = img.exifdata,
|
|
5148
|
-
tags = {};
|
|
5149
|
-
for (a in data) {
|
|
5150
|
-
if (data.hasOwnProperty(a)) {
|
|
5151
|
-
tags[a] = data[a];
|
|
5152
|
-
}
|
|
5153
|
-
}
|
|
5154
|
-
return tags;
|
|
5155
|
-
}
|
|
5156
|
-
|
|
5157
|
-
EXIF.getAllIptcTags = function(img) {
|
|
5158
|
-
if (!imageHasData(img)) return {};
|
|
5159
|
-
var a,
|
|
5160
|
-
data = img.iptcdata,
|
|
5161
|
-
tags = {};
|
|
5162
|
-
for (a in data) {
|
|
5163
|
-
if (data.hasOwnProperty(a)) {
|
|
5164
|
-
tags[a] = data[a];
|
|
5165
|
-
}
|
|
5166
|
-
}
|
|
5167
|
-
return tags;
|
|
5168
|
-
}
|
|
5169
|
-
|
|
5170
|
-
EXIF.pretty = function(img) {
|
|
5171
|
-
if (!imageHasData(img)) return "";
|
|
5172
|
-
var a,
|
|
5173
|
-
data = img.exifdata,
|
|
5174
|
-
strPretty = "";
|
|
5175
|
-
for (a in data) {
|
|
5176
|
-
if (data.hasOwnProperty(a)) {
|
|
5177
|
-
if (typeof data[a] == "object") {
|
|
5178
|
-
if (data[a] instanceof Number) {
|
|
5179
|
-
strPretty += a + " : " + data[a] + " [" + data[a].numerator + "/" + data[a].denominator + "]\r\n";
|
|
5180
|
-
} else {
|
|
5181
|
-
strPretty += a + " : [" + data[a].length + " values]\r\n";
|
|
5182
|
-
}
|
|
5183
|
-
} else {
|
|
5184
|
-
strPretty += a + " : " + data[a] + "\r\n";
|
|
5185
|
-
}
|
|
5186
|
-
}
|
|
5187
|
-
}
|
|
5188
|
-
return strPretty;
|
|
5189
|
-
}
|
|
5190
|
-
|
|
5191
|
-
EXIF.readFromBinaryFile = function(file) {
|
|
5192
|
-
return findEXIFinJPEG(file);
|
|
5193
|
-
}
|
|
5194
|
-
|
|
5195
|
-
if (true) {
|
|
5196
|
-
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() {
|
|
5197
|
-
return EXIF;
|
|
5198
|
-
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
|
|
5199
|
-
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
5200
|
-
}
|
|
5201
|
-
}.call(this));
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
4148
|
/***/ },
|
|
5206
4149
|
|
|
5207
4150
|
/***/ 354
|
|
@@ -5227,6 +4170,22 @@ module.exports = function (item) {
|
|
|
5227
4170
|
|
|
5228
4171
|
/***/ },
|
|
5229
4172
|
|
|
4173
|
+
/***/ 373
|
|
4174
|
+
(module) {
|
|
4175
|
+
|
|
4176
|
+
function _regeneratorKeys(e) {
|
|
4177
|
+
var n = Object(e),
|
|
4178
|
+
r = [];
|
|
4179
|
+
for (var t in n) r.unshift(t);
|
|
4180
|
+
return function e() {
|
|
4181
|
+
for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e;
|
|
4182
|
+
return e.done = !0, e;
|
|
4183
|
+
};
|
|
4184
|
+
}
|
|
4185
|
+
module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
4186
|
+
|
|
4187
|
+
/***/ },
|
|
4188
|
+
|
|
5230
4189
|
/***/ 409
|
|
5231
4190
|
(module, __webpack_exports__, __webpack_require__) {
|
|
5232
4191
|
|
|
@@ -5521,6 +4480,142 @@ function applyToTag (styleElement, obj) {
|
|
|
5521
4480
|
}
|
|
5522
4481
|
|
|
5523
4482
|
|
|
4483
|
+
/***/ },
|
|
4484
|
+
|
|
4485
|
+
/***/ 546
|
|
4486
|
+
(module) {
|
|
4487
|
+
|
|
4488
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
4489
|
+
var i = Object.defineProperty;
|
|
4490
|
+
try {
|
|
4491
|
+
i({}, "", {});
|
|
4492
|
+
} catch (e) {
|
|
4493
|
+
i = 0;
|
|
4494
|
+
}
|
|
4495
|
+
module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) {
|
|
4496
|
+
function o(r, n) {
|
|
4497
|
+
_regeneratorDefine(e, r, function (e) {
|
|
4498
|
+
return this._invoke(r, n, e);
|
|
4499
|
+
});
|
|
4500
|
+
}
|
|
4501
|
+
r ? i ? i(e, r, {
|
|
4502
|
+
value: n,
|
|
4503
|
+
enumerable: !t,
|
|
4504
|
+
configurable: !t,
|
|
4505
|
+
writable: !t
|
|
4506
|
+
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
|
|
4507
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t);
|
|
4508
|
+
}
|
|
4509
|
+
module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
4510
|
+
|
|
4511
|
+
/***/ },
|
|
4512
|
+
|
|
4513
|
+
/***/ 579
|
|
4514
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
4515
|
+
|
|
4516
|
+
var _typeof = (__webpack_require__(738)["default"]);
|
|
4517
|
+
function _regeneratorValues(e) {
|
|
4518
|
+
if (null != e) {
|
|
4519
|
+
var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
|
|
4520
|
+
r = 0;
|
|
4521
|
+
if (t) return t.call(e);
|
|
4522
|
+
if ("function" == typeof e.next) return e;
|
|
4523
|
+
if (!isNaN(e.length)) return {
|
|
4524
|
+
next: function next() {
|
|
4525
|
+
return e && r >= e.length && (e = void 0), {
|
|
4526
|
+
value: e && e[r++],
|
|
4527
|
+
done: !e
|
|
4528
|
+
};
|
|
4529
|
+
}
|
|
4530
|
+
};
|
|
4531
|
+
}
|
|
4532
|
+
throw new TypeError(_typeof(e) + " is not iterable");
|
|
4533
|
+
}
|
|
4534
|
+
module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
4535
|
+
|
|
4536
|
+
/***/ },
|
|
4537
|
+
|
|
4538
|
+
/***/ 633
|
|
4539
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
4540
|
+
|
|
4541
|
+
var OverloadYield = __webpack_require__(172);
|
|
4542
|
+
var regenerator = __webpack_require__(993);
|
|
4543
|
+
var regeneratorAsync = __webpack_require__(869);
|
|
4544
|
+
var regeneratorAsyncGen = __webpack_require__(887);
|
|
4545
|
+
var regeneratorAsyncIterator = __webpack_require__(791);
|
|
4546
|
+
var regeneratorKeys = __webpack_require__(373);
|
|
4547
|
+
var regeneratorValues = __webpack_require__(579);
|
|
4548
|
+
function _regeneratorRuntime() {
|
|
4549
|
+
"use strict";
|
|
4550
|
+
|
|
4551
|
+
var r = regenerator(),
|
|
4552
|
+
e = r.m(_regeneratorRuntime),
|
|
4553
|
+
t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
|
|
4554
|
+
function n(r) {
|
|
4555
|
+
var e = "function" == typeof r && r.constructor;
|
|
4556
|
+
return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
|
|
4557
|
+
}
|
|
4558
|
+
var o = {
|
|
4559
|
+
"throw": 1,
|
|
4560
|
+
"return": 2,
|
|
4561
|
+
"break": 3,
|
|
4562
|
+
"continue": 3
|
|
4563
|
+
};
|
|
4564
|
+
function a(r) {
|
|
4565
|
+
var e, t;
|
|
4566
|
+
return function (n) {
|
|
4567
|
+
e || (e = {
|
|
4568
|
+
stop: function stop() {
|
|
4569
|
+
return t(n.a, 2);
|
|
4570
|
+
},
|
|
4571
|
+
"catch": function _catch() {
|
|
4572
|
+
return n.v;
|
|
4573
|
+
},
|
|
4574
|
+
abrupt: function abrupt(r, e) {
|
|
4575
|
+
return t(n.a, o[r], e);
|
|
4576
|
+
},
|
|
4577
|
+
delegateYield: function delegateYield(r, o, a) {
|
|
4578
|
+
return e.resultName = o, t(n.d, regeneratorValues(r), a);
|
|
4579
|
+
},
|
|
4580
|
+
finish: function finish(r) {
|
|
4581
|
+
return t(n.f, r);
|
|
4582
|
+
}
|
|
4583
|
+
}, t = function t(r, _t, o) {
|
|
4584
|
+
n.p = e.prev, n.n = e.next;
|
|
4585
|
+
try {
|
|
4586
|
+
return r(_t, o);
|
|
4587
|
+
} finally {
|
|
4588
|
+
e.next = n.n;
|
|
4589
|
+
}
|
|
4590
|
+
}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
|
|
4591
|
+
try {
|
|
4592
|
+
return r.call(this, e);
|
|
4593
|
+
} finally {
|
|
4594
|
+
n.p = e.prev, n.n = e.next;
|
|
4595
|
+
}
|
|
4596
|
+
};
|
|
4597
|
+
}
|
|
4598
|
+
return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
|
|
4599
|
+
return {
|
|
4600
|
+
wrap: function wrap(e, t, n, o) {
|
|
4601
|
+
return r.w(a(e), t, n, o && o.reverse());
|
|
4602
|
+
},
|
|
4603
|
+
isGeneratorFunction: n,
|
|
4604
|
+
mark: r.m,
|
|
4605
|
+
awrap: function awrap(r, e) {
|
|
4606
|
+
return new OverloadYield(r, e);
|
|
4607
|
+
},
|
|
4608
|
+
AsyncIterator: regeneratorAsyncIterator,
|
|
4609
|
+
async: function async(r, e, t, o, u) {
|
|
4610
|
+
return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u);
|
|
4611
|
+
},
|
|
4612
|
+
keys: regeneratorKeys,
|
|
4613
|
+
values: regeneratorValues
|
|
4614
|
+
};
|
|
4615
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports)();
|
|
4616
|
+
}
|
|
4617
|
+
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
4618
|
+
|
|
5524
4619
|
/***/ },
|
|
5525
4620
|
|
|
5526
4621
|
/***/ 702
|
|
@@ -5551,6 +4646,109 @@ ___CSS_LOADER_EXPORT___.push([module.id, `
|
|
|
5551
4646
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
5552
4647
|
|
|
5553
4648
|
|
|
4649
|
+
/***/ },
|
|
4650
|
+
|
|
4651
|
+
/***/ 738
|
|
4652
|
+
(module) {
|
|
4653
|
+
|
|
4654
|
+
function _typeof(o) {
|
|
4655
|
+
"@babel/helpers - typeof";
|
|
4656
|
+
|
|
4657
|
+
return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
4658
|
+
return typeof o;
|
|
4659
|
+
} : function (o) {
|
|
4660
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
4661
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
|
|
4662
|
+
}
|
|
4663
|
+
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
4664
|
+
|
|
4665
|
+
/***/ },
|
|
4666
|
+
|
|
4667
|
+
/***/ 756
|
|
4668
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
4669
|
+
|
|
4670
|
+
// TODO(Babel 8): Remove this file.
|
|
4671
|
+
|
|
4672
|
+
var runtime = __webpack_require__(633)();
|
|
4673
|
+
module.exports = runtime;
|
|
4674
|
+
|
|
4675
|
+
// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
|
|
4676
|
+
try {
|
|
4677
|
+
regeneratorRuntime = runtime;
|
|
4678
|
+
} catch (accidentalStrictMode) {
|
|
4679
|
+
if (typeof globalThis === "object") {
|
|
4680
|
+
globalThis.regeneratorRuntime = runtime;
|
|
4681
|
+
} else {
|
|
4682
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
|
4683
|
+
}
|
|
4684
|
+
}
|
|
4685
|
+
|
|
4686
|
+
|
|
4687
|
+
/***/ },
|
|
4688
|
+
|
|
4689
|
+
/***/ 791
|
|
4690
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
4691
|
+
|
|
4692
|
+
var OverloadYield = __webpack_require__(172);
|
|
4693
|
+
var regeneratorDefine = __webpack_require__(546);
|
|
4694
|
+
function AsyncIterator(t, e) {
|
|
4695
|
+
function n(r, o, i, f) {
|
|
4696
|
+
try {
|
|
4697
|
+
var c = t[r](o),
|
|
4698
|
+
u = c.value;
|
|
4699
|
+
return u instanceof OverloadYield ? e.resolve(u.v).then(function (t) {
|
|
4700
|
+
n("next", t, i, f);
|
|
4701
|
+
}, function (t) {
|
|
4702
|
+
n("throw", t, i, f);
|
|
4703
|
+
}) : e.resolve(u).then(function (t) {
|
|
4704
|
+
c.value = t, i(c);
|
|
4705
|
+
}, function (t) {
|
|
4706
|
+
return n("throw", t, i, f);
|
|
4707
|
+
});
|
|
4708
|
+
} catch (t) {
|
|
4709
|
+
f(t);
|
|
4710
|
+
}
|
|
4711
|
+
}
|
|
4712
|
+
var r;
|
|
4713
|
+
this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
|
|
4714
|
+
return this;
|
|
4715
|
+
})), regeneratorDefine(this, "_invoke", function (t, o, i) {
|
|
4716
|
+
function f() {
|
|
4717
|
+
return new e(function (e, r) {
|
|
4718
|
+
n(t, i, e, r);
|
|
4719
|
+
});
|
|
4720
|
+
}
|
|
4721
|
+
return r = r ? r.then(f, f) : f();
|
|
4722
|
+
}, !0);
|
|
4723
|
+
}
|
|
4724
|
+
module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
4725
|
+
|
|
4726
|
+
/***/ },
|
|
4727
|
+
|
|
4728
|
+
/***/ 869
|
|
4729
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
4730
|
+
|
|
4731
|
+
var regeneratorAsyncGen = __webpack_require__(887);
|
|
4732
|
+
function _regeneratorAsync(n, e, r, t, o) {
|
|
4733
|
+
var a = regeneratorAsyncGen(n, e, r, t, o);
|
|
4734
|
+
return a.next().then(function (n) {
|
|
4735
|
+
return n.done ? n.value : a.next();
|
|
4736
|
+
});
|
|
4737
|
+
}
|
|
4738
|
+
module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
4739
|
+
|
|
4740
|
+
/***/ },
|
|
4741
|
+
|
|
4742
|
+
/***/ 887
|
|
4743
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
4744
|
+
|
|
4745
|
+
var regenerator = __webpack_require__(993);
|
|
4746
|
+
var regeneratorAsyncIterator = __webpack_require__(791);
|
|
4747
|
+
function _regeneratorAsyncGen(r, e, t, o, n) {
|
|
4748
|
+
return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise);
|
|
4749
|
+
}
|
|
4750
|
+
module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
4751
|
+
|
|
5554
4752
|
/***/ },
|
|
5555
4753
|
|
|
5556
4754
|
/***/ 930
|
|
@@ -5599,6 +4797,101 @@ if(content.locals) module.exports = content.locals;
|
|
|
5599
4797
|
var add = (__webpack_require__(534)/* ["default"] */ .A)
|
|
5600
4798
|
var update = add("7918d0f5", content, true, {});
|
|
5601
4799
|
|
|
4800
|
+
/***/ },
|
|
4801
|
+
|
|
4802
|
+
/***/ 993
|
|
4803
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
4804
|
+
|
|
4805
|
+
var regeneratorDefine = __webpack_require__(546);
|
|
4806
|
+
function _regenerator() {
|
|
4807
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
4808
|
+
var e,
|
|
4809
|
+
t,
|
|
4810
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
4811
|
+
n = r.iterator || "@@iterator",
|
|
4812
|
+
o = r.toStringTag || "@@toStringTag";
|
|
4813
|
+
function i(r, n, o, i) {
|
|
4814
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
4815
|
+
u = Object.create(c.prototype);
|
|
4816
|
+
return regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
4817
|
+
var i,
|
|
4818
|
+
c,
|
|
4819
|
+
u,
|
|
4820
|
+
f = 0,
|
|
4821
|
+
p = o || [],
|
|
4822
|
+
y = !1,
|
|
4823
|
+
G = {
|
|
4824
|
+
p: 0,
|
|
4825
|
+
n: 0,
|
|
4826
|
+
v: e,
|
|
4827
|
+
a: d,
|
|
4828
|
+
f: d.bind(e, 4),
|
|
4829
|
+
d: function d(t, r) {
|
|
4830
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
4831
|
+
}
|
|
4832
|
+
};
|
|
4833
|
+
function d(r, n) {
|
|
4834
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
4835
|
+
var o,
|
|
4836
|
+
i = p[t],
|
|
4837
|
+
d = G.p,
|
|
4838
|
+
l = i[2];
|
|
4839
|
+
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
|
|
4840
|
+
}
|
|
4841
|
+
if (o || r > 1) return a;
|
|
4842
|
+
throw y = !0, n;
|
|
4843
|
+
}
|
|
4844
|
+
return function (o, p, l) {
|
|
4845
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
4846
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
4847
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
4848
|
+
try {
|
|
4849
|
+
if (f = 2, i) {
|
|
4850
|
+
if (c || (o = "next"), t = i[o]) {
|
|
4851
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
4852
|
+
if (!t.done) return t;
|
|
4853
|
+
u = t.value, c < 2 && (c = 0);
|
|
4854
|
+
} else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
4855
|
+
i = e;
|
|
4856
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
4857
|
+
} catch (t) {
|
|
4858
|
+
i = e, c = 1, u = t;
|
|
4859
|
+
} finally {
|
|
4860
|
+
f = 1;
|
|
4861
|
+
}
|
|
4862
|
+
}
|
|
4863
|
+
return {
|
|
4864
|
+
value: t,
|
|
4865
|
+
done: y
|
|
4866
|
+
};
|
|
4867
|
+
};
|
|
4868
|
+
}(r, o, i), !0), u;
|
|
4869
|
+
}
|
|
4870
|
+
var a = {};
|
|
4871
|
+
function Generator() {}
|
|
4872
|
+
function GeneratorFunction() {}
|
|
4873
|
+
function GeneratorFunctionPrototype() {}
|
|
4874
|
+
t = Object.getPrototypeOf;
|
|
4875
|
+
var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function () {
|
|
4876
|
+
return this;
|
|
4877
|
+
}), t),
|
|
4878
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
4879
|
+
function f(e) {
|
|
4880
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
4881
|
+
}
|
|
4882
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), regeneratorDefine(u), regeneratorDefine(u, o, "Generator"), regeneratorDefine(u, n, function () {
|
|
4883
|
+
return this;
|
|
4884
|
+
}), regeneratorDefine(u, "toString", function () {
|
|
4885
|
+
return "[object Generator]";
|
|
4886
|
+
}), (module.exports = _regenerator = function _regenerator() {
|
|
4887
|
+
return {
|
|
4888
|
+
w: i,
|
|
4889
|
+
m: f
|
|
4890
|
+
};
|
|
4891
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports)();
|
|
4892
|
+
}
|
|
4893
|
+
module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
4894
|
+
|
|
5602
4895
|
/***/ }
|
|
5603
4896
|
|
|
5604
4897
|
/******/ });
|
|
@@ -5621,7 +4914,7 @@ var update = add("7918d0f5", content, true, {});
|
|
|
5621
4914
|
/******/ };
|
|
5622
4915
|
/******/
|
|
5623
4916
|
/******/ // Execute the module function
|
|
5624
|
-
/******/ __webpack_modules__[moduleId]
|
|
4917
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
5625
4918
|
/******/
|
|
5626
4919
|
/******/ // Return the exports of the module
|
|
5627
4920
|
/******/ return module.exports;
|
|
@@ -5652,6 +4945,18 @@ var update = add("7918d0f5", content, true, {});
|
|
|
5652
4945
|
/******/ };
|
|
5653
4946
|
/******/ })();
|
|
5654
4947
|
/******/
|
|
4948
|
+
/******/ /* webpack/runtime/global */
|
|
4949
|
+
/******/ (() => {
|
|
4950
|
+
/******/ __webpack_require__.g = (function() {
|
|
4951
|
+
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
4952
|
+
/******/ try {
|
|
4953
|
+
/******/ return this || new Function('return this')();
|
|
4954
|
+
/******/ } catch (e) {
|
|
4955
|
+
/******/ if (typeof window === 'object') return window;
|
|
4956
|
+
/******/ }
|
|
4957
|
+
/******/ })();
|
|
4958
|
+
/******/ })();
|
|
4959
|
+
/******/
|
|
5655
4960
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
5656
4961
|
/******/ (() => {
|
|
5657
4962
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
@@ -11181,8 +10486,8 @@ var Number_component = normalizeComponent(
|
|
|
11181
10486
|
|
|
11182
10487
|
textBar.Number = Text_Number;
|
|
11183
10488
|
/* harmony default export */ const Text = (textBar);
|
|
11184
|
-
;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/upload/upload.vue?vue&type=template&id=
|
|
11185
|
-
var
|
|
10489
|
+
;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/upload/upload.vue?vue&type=template&id=78cd64fe
|
|
10490
|
+
var uploadvue_type_template_id_78cd64fe_render = function render() {
|
|
11186
10491
|
var _vm = this,
|
|
11187
10492
|
_c = _vm._self._c;
|
|
11188
10493
|
return _c('div', {
|
|
@@ -11204,11 +10509,42 @@ var uploadvue_type_template_id_23492f0b_render = function render() {
|
|
|
11204
10509
|
}
|
|
11205
10510
|
})], 2);
|
|
11206
10511
|
};
|
|
11207
|
-
var
|
|
10512
|
+
var uploadvue_type_template_id_78cd64fe_staticRenderFns = [];
|
|
10513
|
+
|
|
10514
|
+
;// ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
|
|
10515
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
10516
|
+
try {
|
|
10517
|
+
var i = n[a](c),
|
|
10518
|
+
u = i.value;
|
|
10519
|
+
} catch (n) {
|
|
10520
|
+
return void e(n);
|
|
10521
|
+
}
|
|
10522
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
10523
|
+
}
|
|
10524
|
+
function _asyncToGenerator(n) {
|
|
10525
|
+
return function () {
|
|
10526
|
+
var t = this,
|
|
10527
|
+
e = arguments;
|
|
10528
|
+
return new Promise(function (r, o) {
|
|
10529
|
+
var a = n.apply(t, e);
|
|
10530
|
+
function _next(n) {
|
|
10531
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
10532
|
+
}
|
|
10533
|
+
function _throw(n) {
|
|
10534
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
10535
|
+
}
|
|
10536
|
+
_next(void 0);
|
|
10537
|
+
});
|
|
10538
|
+
};
|
|
10539
|
+
}
|
|
10540
|
+
|
|
10541
|
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js
|
|
10542
|
+
var regenerator = __webpack_require__(756);
|
|
10543
|
+
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
|
|
10544
|
+
;// ./node_modules/exifr/dist/full.esm.mjs
|
|
10545
|
+
var e="undefined"!=typeof self?self:__webpack_require__.g;const t="undefined"!=typeof navigator,i=t&&"undefined"==typeof HTMLImageElement,n=!("undefined"==typeof __webpack_require__.g||"undefined"==typeof process||!process.versions||!process.versions.node),s=e.Buffer,r=e.BigInt,a=!!s,o=e=>e;function l(e,t=o){if(n)try{return"function"==typeof require?Promise.resolve(t(require(e))):import(/* webpackIgnore: true */ e).then(t)}catch(t){console.warn(`Couldn't load ${e}`)}}let h=e.fetch;const u=e=>h=e;if(!e.fetch){const e=l("http",(e=>e)),t=l("https",(e=>e)),i=(n,{headers:s}={})=>new Promise((async(r,a)=>{let{port:o,hostname:l,pathname:h,protocol:u,search:c}=new URL(n);const f={method:"GET",hostname:l,path:encodeURI(h)+c,headers:s};""!==o&&(f.port=Number(o));const d=("https:"===u?await t:await e).request(f,(e=>{if(301===e.statusCode||302===e.statusCode){let t=new URL(e.headers.location,n).toString();return i(t,{headers:s}).then(r).catch(a)}r({status:e.statusCode,arrayBuffer:()=>new Promise((t=>{let i=[];e.on("data",(e=>i.push(e))),e.on("end",(()=>t(Buffer.concat(i))))}))})}));d.on("error",a),d.end()}));u(i)}function c(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const f=e=>p(e)?void 0:e,d=e=>void 0!==e;function p(e){return void 0===e||(e instanceof Map?0===e.size:0===Object.values(e).filter(d).length)}function g(e){let t=new Error(e);throw delete t.stack,t}function m(e){return""===(e=function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e}(e).trim())?void 0:e}function S(e){let t=function(e){let t=0;return e.ifd0.enabled&&(t+=1024),e.exif.enabled&&(t+=2048),e.makerNote&&(t+=2048),e.userComment&&(t+=1024),e.gps.enabled&&(t+=512),e.interop.enabled&&(t+=100),e.ifd1.enabled&&(t+=1024),t+2048}(e);return e.jfif.enabled&&(t+=50),e.xmp.enabled&&(t+=2e4),e.iptc.enabled&&(t+=14e3),e.icc.enabled&&(t+=6e3),t}const C=e=>String.fromCharCode.apply(null,e),y="undefined"!=typeof TextDecoder?new TextDecoder("utf-8"):void 0;function b(e){return y?y.decode(e):a?Buffer.from(e).toString("utf8"):decodeURIComponent(escape(C(e)))}class I{static from(e,t){return e instanceof this&&e.le===t?e:new I(e,void 0,void 0,t)}constructor(e,t=0,i,n){if("boolean"==typeof n&&(this.le=n),Array.isArray(e)&&(e=new Uint8Array(e)),0===e)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){void 0===i&&(i=e.byteLength-t);let n=new DataView(e,t,i);this._swapDataView(n)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof I){void 0===i&&(i=e.byteLength-t),(t+=e.byteOffset)+i>e.byteOffset+e.byteLength&&g("Creating view outside of available memory in ArrayBuffer");let n=new DataView(e.buffer,t,i);this._swapDataView(n)}else if("number"==typeof e){let t=new DataView(new ArrayBuffer(e));this._swapDataView(t)}else g("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,t,i=I){return e instanceof DataView||e instanceof I?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||g("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new i(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new I(this,e,t)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}getString(e=0,t=this.byteLength){return b(this.getUint8Array(e,t))}getLatin1String(e=0,t=this.byteLength){let i=this.getUint8Array(e,t);return C(i)}getUnicodeString(e=0,t=this.byteLength){const i=[];for(let n=0;n<t&&e+n<this.byteLength;n+=2)i.push(this.getUint16(e+n));return C(i)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,t=this.le){return this.dataView.getInt16(e,t)}getInt32(e,t=this.le){return this.dataView.getInt32(e,t)}getUint16(e,t=this.le){return this.dataView.getUint16(e,t)}getUint32(e,t=this.le){return this.dataView.getUint32(e,t)}getFloat32(e,t=this.le){return this.dataView.getFloat32(e,t)}getFloat64(e,t=this.le){return this.dataView.getFloat64(e,t)}getFloat(e,t=this.le){return this.dataView.getFloat32(e,t)}getDouble(e,t=this.le){return this.dataView.getFloat64(e,t)}getUintBytes(e,t,i){switch(t){case 1:return this.getUint8(e,i);case 2:return this.getUint16(e,i);case 4:return this.getUint32(e,i);case 8:return this.getUint64&&this.getUint64(e,i)}}getUint(e,t,i){switch(t){case 8:return this.getUint8(e,i);case 16:return this.getUint16(e,i);case 32:return this.getUint32(e,i);case 64:return this.getUint64&&this.getUint64(e,i)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}}function P(e,t){g(`${e} '${t}' was not loaded, try using full build of exifr.`)}class k extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||P(this.kind,e),t&&(e in t||function(e,t){g(`Unknown ${e} '${t}'.`)}(this.kind,e),t[e].enabled||P(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}}var w=new k("file parser"),T=new k("segment parser"),A=new k("file reader");function D(e,n){return"string"==typeof e?O(e,n):t&&!i&&e instanceof HTMLImageElement?O(e.src,n):e instanceof Uint8Array||e instanceof ArrayBuffer||e instanceof DataView?new I(e):t&&e instanceof Blob?x(e,n,"blob",R):void g("Invalid input argument")}function O(e,i){return(s=e).startsWith("data:")||s.length>1e4?v(e,i,"base64"):n&&e.includes("://")?x(e,i,"url",M):n?v(e,i,"fs"):t?x(e,i,"url",M):void g("Invalid input argument");// removed by dead control flow
|
|
10546
|
+
var s; }async function x(e,t,i,n){return A.has(i)?v(e,t,i):n?async function(e,t){let i=await t(e);return new I(i)}(e,n):void g(`Parser ${i} is not loaded`)}async function v(e,t,i){let n=new(A.get(i))(e,t);return await n.read(),n}const M=e=>h(e).then((e=>e.arrayBuffer())),R=e=>new Promise(((t,i)=>{let n=new FileReader;n.onloadend=()=>t(n.result||new ArrayBuffer),n.onerror=i,n.readAsArrayBuffer(e)}));class L extends Map{get tagKeys(){return this.allKeys||(this.allKeys=Array.from(this.keys())),this.allKeys}get tagValues(){return this.allValues||(this.allValues=Array.from(this.values())),this.allValues}}function U(e,t,i){let n=new L;for(let[e,t]of i)n.set(e,t);if(Array.isArray(t))for(let i of t)e.set(i,n);else e.set(t,n);return n}function F(e,t,i){let n,s=e.get(t);for(n of i)s.set(n[0],n[1])}const E=new Map,B=new Map,N=new Map,G=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],V=["jfif","xmp","icc","iptc","ihdr"],z=["tiff",...V],H=["ifd0","ifd1","exif","gps","interop"],j=[...z,...H],W=["makerNote","userComment"],K=["translateKeys","translateValues","reviveValues","multiSegment"],X=[...K,"sanitize","mergeOutput","silentErrors"];class _{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}class Y extends _{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,i,n){if(super(),c(this,"enabled",!1),c(this,"skip",new Set),c(this,"pick",new Set),c(this,"deps",new Set),c(this,"translateKeys",!1),c(this,"translateValues",!1),c(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(n),this.canBeFiltered=H.includes(e),this.canBeFiltered&&(this.dict=E.get(e)),void 0!==i)if(Array.isArray(i))this.parse=this.enabled=!0,this.canBeFiltered&&i.length>0&&this.translateTagSet(i,this.pick);else if("object"==typeof i){if(this.enabled=!0,this.parse=!1!==i.parse,this.canBeFiltered){let{pick:e,skip:t}=i;e&&e.length>0&&this.translateTagSet(e,this.pick),t&&t.length>0&&this.translateTagSet(t,this.skip)}this.applyInheritables(i)}else!0===i||!1===i?this.parse=this.enabled=i:g(`Invalid options argument: ${i}`)}applyInheritables(e){let t,i;for(t of K)i=e[t],void 0!==i&&(this[t]=i)}translateTagSet(e,t){if(this.dict){let i,n,{tagKeys:s,tagValues:r}=this.dict;for(i of e)"string"==typeof i?(n=r.indexOf(i),-1===n&&(n=s.indexOf(Number(i))),-1!==n&&t.add(Number(s[n]))):t.add(i)}else for(let i of e)t.add(i)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,ee(this.pick,this.deps)):this.enabled&&this.pick.size>0&&ee(this.pick,this.deps)}}var $={jfif:!1,tiff:!0,xmp:!1,icc:!1,iptc:!1,ifd0:!0,ifd1:!1,exif:!0,gps:!0,interop:!1,ihdr:void 0,makerNote:!1,userComment:!1,multiSegment:!1,skip:[],pick:[],translateKeys:!0,translateValues:!0,reviveValues:!0,sanitize:!0,mergeOutput:!0,silentErrors:!0,chunked:!0,firstChunkSize:void 0,firstChunkSizeNode:512,firstChunkSizeBrowser:65536,chunkSize:65536,chunkLimit:5},J=new Map;class q extends _{static useCached(e){let t=J.get(e);return void 0!==t||(t=new this(e),J.set(e,t)),t}constructor(e){super(),!0===e?this.setupFromTrue():void 0===e?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):"object"==typeof e?this.setupFromObject(e):g(`Invalid options argument ${e}`),void 0===this.firstChunkSize&&(this.firstChunkSize=t?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of G)this[e]=$[e];for(e of X)this[e]=$[e];for(e of W)this[e]=$[e];for(e of j)this[e]=new Y(e,$[e],void 0,this)}setupFromTrue(){let e;for(e of G)this[e]=$[e];for(e of X)this[e]=$[e];for(e of W)this[e]=!0;for(e of j)this[e]=new Y(e,!0,void 0,this)}setupFromArray(e){let t;for(t of G)this[t]=$[t];for(t of X)this[t]=$[t];for(t of W)this[t]=$[t];for(t of j)this[t]=new Y(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,H)}setupFromObject(e){let t;for(t of(H.ifd0=H.ifd0||H.image,H.ifd1=H.ifd1||H.thumbnail,Object.assign(this,e),G))this[t]=Z(e[t],$[t]);for(t of X)this[t]=Z(e[t],$[t]);for(t of W)this[t]=Z(e[t],$[t]);for(t of z)this[t]=new Y(t,$[t],e[t],this);for(t of H)this[t]=new Y(t,$[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,H,j),!0===e.tiff?this.batchEnableWithBool(H,!0):!1===e.tiff?this.batchEnableWithUserValue(H,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,H):"object"==typeof e.tiff&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,H)}batchEnableWithBool(e,t){for(let i of e)this[i].enabled=t}batchEnableWithUserValue(e,t){for(let i of e){let e=t[i];this[i].enabled=!1!==e&&void 0!==e}}setupGlobalFilters(e,t,i,n=i){if(e&&e.length){for(let e of n)this[e].enabled=!1;let t=Q(e,i);for(let[e,i]of t)ee(this[e].pick,i),this[e].enabled=!0}else if(t&&t.length){let e=Q(t,i);for(let[t,i]of e)ee(this[t].skip,i)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:i,iptc:n,icc:s}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),i.enabled||e.skip.add(700),n.enabled||e.skip.add(33723),s.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:i,interop:n}=this;n.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),i.needed&&e.deps.add(34853),this.tiff.enabled=H.some((e=>!0===this[e].enabled))||this.makerNote||this.userComment;for(let e of H)this[e].finalizeFilters()}get onlyTiff(){return!V.map((e=>this[e].enabled)).some((e=>!0===e))&&this.tiff.enabled}checkLoadedPlugins(){for(let e of z)this[e].enabled&&!T.has(e)&&P("segment parser",e)}}function Q(e,t){let i,n,s,r,a=[];for(s of t){for(r of(i=E.get(s),n=[],i))(e.includes(r[0])||e.includes(r[1]))&&n.push(r[0]);n.length&&a.push([s,n])}return a}function Z(e,t){return void 0!==e?e:void 0!==t?t:void 0}function ee(e,t){for(let i of t)e.add(i)}c(q,"default",$);class te{constructor(e){c(this,"parsers",{}),c(this,"output",{}),c(this,"errors",[]),c(this,"pushToErrors",(e=>this.errors.push(e))),this.options=q.useCached(e)}async read(e){this.file=await D(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[i,n]of w)if(n.canHandle(e,t))return this.fileParser=new n(this.options,this.file,this.parsers),e[i]=!0;this.file.close&&this.file.close(),g("Unknown file format")}async parse(){let{output:e,errors:t}=this;return this.setup(),this.options.silentErrors?(await this.executeParsers().catch(this.pushToErrors),t.push(...this.fileParser.errors)):await this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&t.length>0&&(e.errors=t),f(e)}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map((async t=>{let i=await t.parse();t.assignToOutput(e,i)}));this.options.silentErrors&&(t=t.map((e=>e.catch(this.pushToErrors)))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,i=T.get("tiff",e);var n;if(t.tiff?n={start:0,type:"tiff"}:t.jpeg&&(n=await this.fileParser.getOrFindSegment("tiff")),void 0===n)return;let s=await this.fileParser.ensureSegmentChunk(n),r=this.parsers.tiff=new i(s,e,t),a=await r.extractThumbnail();return t.close&&t.close(),a}}async function ie(e,t){let i=new te(t);return await i.read(e),i.parse()}var ne=Object.freeze({__proto__:null,parse:ie,Exifr:te,fileParsers:w,segmentParsers:T,fileReaders:A,tagKeys:E,tagValues:B,tagRevivers:N,createDictionary:U,extendDictionary:F,fetchUrlAsArrayBuffer:M,readBlobAsArrayBuffer:R,chunkedProps:G,otherSegments:V,segments:z,tiffBlocks:H,segmentsAndBlocks:j,tiffExtractables:W,inheritables:K,allFormatters:X,Options:q});class se{constructor(e,t,i){c(this,"errors",[]),c(this,"ensureSegmentChunk",(async e=>{let t=e.start,i=e.size||65536;if(this.file.chunked)if(this.file.available(t,i))e.chunk=this.file.subarray(t,i);else try{e.chunk=await this.file.readChunk(t,i)}catch(t){g(`Couldn't read segment: ${JSON.stringify(e)}. ${t.message}`)}else this.file.byteLength>t+i?e.chunk=this.file.subarray(t,i):void 0===e.size?e.chunk=this.file.subarray(t):g("Segment unreachable: "+JSON.stringify(e));return e.chunk})),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=i}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let i=new(T.get(e))(t,this.options,this.file);return this.parsers[e]=i}createParsers(e){for(let t of e){let{type:e,chunk:i}=t,n=this.options[e];if(n&&n.enabled){let t=this.parsers[e];t&&t.append||t||this.createParser(e,i)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}class re{static findPosition(e,t){let i=e.getUint16(t+2)+2,n="function"==typeof this.headerLength?this.headerLength(e,t,i):this.headerLength,s=t+n,r=i-n;return{offset:t,length:i,headerLength:n,start:s,size:r,end:s+r}}static parse(e,t={}){return new this(e,new q({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof I?e:new I(e)}constructor(e,t={},i){c(this,"errors",[]),c(this,"raw",new Map),c(this,"handleError",(e=>{if(!this.options.silentErrors)throw e;this.errors.push(e.message)})),this.chunk=this.normalizeInput(e),this.file=i,this.type=this.constructor.type,this.globalOptions=this.options=t,this.localOptions=t[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(e,t){let i=N.get(t),n=B.get(t),s=E.get(t),r=this.options[t],a=r.reviveValues&&!!i,o=r.translateValues&&!!n,l=r.translateKeys&&!!s,h={};for(let[t,r]of e)a&&i.has(t)?r=i.get(t)(r):o&&n.has(t)&&(r=this.translateValue(r,n.get(t))),l&&s.has(t)&&(t=s.get(t)||t),h[t]=r;return h}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,i){if(this.globalOptions.mergeOutput)return Object.assign(e,i);e[t]?Object.assign(e[t],i):e[t]=i}}c(re,"headerLength",4),c(re,"type",void 0),c(re,"multiSegment",!1),c(re,"canHandle",(()=>!1));function ae(e){return 192===e||194===e||196===e||219===e||221===e||218===e||254===e}function oe(e){return e>=224&&e<=239}function le(e,t,i){for(let[n,s]of T)if(s.canHandle(e,t,i))return n}class he extends se{constructor(...e){super(...e),c(this,"appSegments",[]),c(this,"jpegSegments",[]),c(this,"unknownSegments",[])}static canHandle(e,t){return 65496===t}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){!0===e?(this.findAll=!0,this.wanted=new Set(T.keyList())):(e=void 0===e?T.keyList().filter((e=>this.options[e].enabled)):e.filter((e=>this.options[e].enabled&&T.has(e))),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}async findAppSegments(e=0,t){this.setupSegmentFinderArgs(t);let{file:i,findAll:n,wanted:s,remaining:r}=this;if(!n&&this.file.chunked&&(n=Array.from(s).some((e=>{let t=T.get(e),i=this.options[e];return t.multiSegment&&i.multiSegment})),n&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,i.byteLength),!this.options.onlyTiff&&i.chunked){let t=!1;for(;r.size>0&&!t&&(i.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:n}=i,s=this.appSegments.some((e=>!this.file.available(e.offset||e.start,e.length||e.size)));if(t=e>n&&!s?!await i.readNextChunk(e):!await i.readNextChunk(n),void 0===(e=this.findAppSegmentsInRange(e,i.byteLength)))return}}}findAppSegmentsInRange(e,t){t-=2;let i,n,s,r,a,o,{file:l,findAll:h,wanted:u,remaining:c,options:f}=this;for(;e<t;e++)if(255===l.getUint8(e))if(i=l.getUint8(e+1),oe(i)){if(n=l.getUint16(e+2),s=le(l,e,n),s&&u.has(s)&&(r=T.get(s),a=r.findPosition(l,e),o=f[s],a.type=s,this.appSegments.push(a),!h&&(r.multiSegment&&o.multiSegment?(this.unfinishedMultiSegment=a.chunkNumber<a.chunkCount,this.unfinishedMultiSegment||c.delete(s)):c.delete(s),0===c.size)))break;f.recordUnknownSegments&&(a=re.findPosition(l,e),a.marker=i,this.unknownSegments.push(a)),e+=n+1}else if(ae(i)){if(n=l.getUint16(e+2),218===i&&!1!==f.stopAfterSos)return;f.recordJpegSegments&&this.jpegSegments.push({offset:e,length:n,marker:i}),e+=n+1}return e}mergeMultiSegments(){if(!this.appSegments.some((e=>e.multiSegment)))return;let e=function(e,t){let i,n,s,r=new Map;for(let a=0;a<e.length;a++)i=e[a],n=i[t],r.has(n)?s=r.get(n):r.set(n,s=[]),s.push(i);return Array.from(r)}(this.appSegments,"type");this.mergedAppSegments=e.map((([e,t])=>{let i=T.get(e,this.options);if(i.handleMultiSegments){return{type:e,chunk:i.handleMultiSegments(t)}}return t[0]}))}getSegment(e){return this.appSegments.find((t=>t.type===e))}async getOrFindSegment(e){let t=this.getSegment(e);return void 0===t&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}}c(he,"type","jpeg"),w.set("jpeg",he);const ue=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class ce extends re{parseHeader(){var e=this.chunk.getUint16();18761===e?this.le=!0:19789===e&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,i=new Map){let{pick:n,skip:s}=this.options[t];n=new Set(n);let r=n.size>0,a=0===s.size,o=this.chunk.getUint16(e);e+=2;for(let l=0;l<o;l++){let o=this.chunk.getUint16(e);if(r){if(n.has(o)&&(i.set(o,this.parseTag(e,o,t)),n.delete(o),0===n.size))break}else!a&&s.has(o)||i.set(o,this.parseTag(e,o,t));e+=12}return i}parseTag(e,t,i){let{chunk:n}=this,s=n.getUint16(e+2),r=n.getUint32(e+4),a=ue[s];if(a*r<=4?e+=8:e=n.getUint32(e+8),(s<1||s>13)&&g(`Invalid TIFF value type. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${s}, offset ${e}`),e>n.byteLength&&g(`Invalid TIFF value offset. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${s}, offset ${e} is outside of chunk size ${n.byteLength}`),1===s)return n.getUint8Array(e,r);if(2===s)return m(n.getString(e,r));if(7===s)return n.getUint8Array(e,r);if(1===r)return this.parseTagValue(s,e);{let t=new(function(e){switch(e){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 10:return Array;case 11:return Float32Array;case 12:return Float64Array;default:return Array}}(s))(r),i=a;for(let n=0;n<r;n++)t[n]=this.parseTagValue(s,e),e+=i;return t}}parseTagValue(e,t){let{chunk:i}=this;switch(e){case 1:return i.getUint8(t);case 3:return i.getUint16(t);case 4:return i.getUint32(t);case 5:return i.getUint32(t)/i.getUint32(t+4);case 6:return i.getInt8(t);case 8:return i.getInt16(t);case 9:return i.getInt32(t);case 10:return i.getInt32(t)/i.getInt32(t+4);case 11:return i.getFloat(t);case 12:return i.getDouble(t);case 13:return i.getUint32(t);default:g(`Invalid tiff type ${e}`)}}}class fe extends ce{static canHandle(e,t){return 225===e.getUint8(t+1)&&1165519206===e.getUint32(t+4)&&0===e.getUint16(t+8)}async parse(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&await this.parseIfd0Block(),e.exif.enabled&&await this.safeParse("parseExifBlock"),e.gps.enabled&&await this.safeParse("parseGpsBlock"),e.interop.enabled&&await this.safeParse("parseInteropBlock"),e.ifd1.enabled&&await this.safeParse("parseThumbnailBlock"),this.createOutput()}safeParse(e){let t=this[e]();return void 0!==t.catch&&(t=t.catch(this.handleError)),t}findIfd0Offset(){void 0===this.ifd0Offset&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(void 0===this.ifd1Offset){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}parseBlock(e,t){let i=new Map;return this[t]=i,this.parseTags(e,t,i),i}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&g("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&g(`IFD0 offset points to outside of file.\nthis.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,S(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return 0!==t.size?(this.exifOffset=t.get(34665),this.interopOffset=t.get(40965),this.gpsOffset=t.get(34853),this.xmp=t.get(700),this.iptc=t.get(33723),this.icc=t.get(34675),this.options.sanitize&&(t.delete(34665),t.delete(40965),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t):void 0}async parseExifBlock(){if(this.exif)return;if(this.ifd0||await this.parseIfd0Block(),void 0===this.exifOffset)return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,S(this.options));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(40965)),this.makerNote=e.get(37500),this.userComment=e.get(37510),this.options.sanitize&&(e.delete(40965),e.delete(37500),e.delete(37510)),this.unpack(e,41728),this.unpack(e,41729),e}unpack(e,t){let i=e.get(t);i&&1===i.length&&e.set(t,i[0])}async parseGpsBlock(){if(this.gps)return;if(this.ifd0||await this.parseIfd0Block(),void 0===this.gpsOffset)return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",de(...e.get(2),e.get(1))),e.set("longitude",de(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),void 0!==this.interopOffset||this.exif||await this.parseExifBlock(),void 0!==this.interopOffset))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(e=!1){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),void 0===this.ifd1)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,i,n={};for(t of H)if(e=this[t],!p(e))if(i=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if("ifd1"===t)continue;Object.assign(n,i)}else n[t]=i;return this.makerNote&&(n.makerNote=this.makerNote),this.userComment&&(n.userComment=this.userComment),n}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[i,n]of Object.entries(t))this.assignObjectToOutput(e,i,n)}}function de(e,t,i,n){var s=e+t/60+i/3600;return"S"!==n&&"W"!==n||(s*=-1),s}c(fe,"type","tiff"),c(fe,"headerLength",10),T.set("tiff",fe);var pe=Object.freeze({__proto__:null,default:ne,Exifr:te,fileParsers:w,segmentParsers:T,fileReaders:A,tagKeys:E,tagValues:B,tagRevivers:N,createDictionary:U,extendDictionary:F,fetchUrlAsArrayBuffer:M,readBlobAsArrayBuffer:R,chunkedProps:G,otherSegments:V,segments:z,tiffBlocks:H,segmentsAndBlocks:j,tiffExtractables:W,inheritables:K,allFormatters:X,Options:q,parse:ie});const ge={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},me=Object.assign({},ge,{firstChunkSize:4e4,gps:[1,2,3,4]});async function Se(e){let t=new te(me);await t.read(e);let i=await t.parse();if(i&&i.gps){let{latitude:e,longitude:t}=i.gps;return{latitude:e,longitude:t}}}const Ce=Object.assign({},ge,{tiff:!1,ifd1:!0,mergeOutput:!1});async function ye(e){let t=new te(Ce);await t.read(e);let i=await t.extractThumbnail();return i&&a?s.from(i):i}async function be(e){let t=await this.thumbnail(e);if(void 0!==t){let e=new Blob([t]);return URL.createObjectURL(e)}}const Ie=Object.assign({},ge,{firstChunkSize:4e4,ifd0:[274]});async function Pe(e){let t=new te(Ie);await t.read(e);let i=await t.parse();if(i&&i.ifd0)return i.ifd0[274]}const ke=Object.freeze({1:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:0,rad:0},2:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:0,rad:0},3:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:180,rad:180*Math.PI/180},4:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:180,rad:180*Math.PI/180},5:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:90,rad:90*Math.PI/180},6:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:90,rad:90*Math.PI/180},7:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:270,rad:270*Math.PI/180},8:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:270,rad:270*Math.PI/180}});let we=!0,Te=!0;if("object"==typeof navigator){let e=navigator.userAgent;if(e.includes("iPad")||e.includes("iPhone")){let t=e.match(/OS (\d+)_(\d+)/);if(t){let[,e,i]=t,n=Number(e)+.1*Number(i);we=n<13.4,Te=!1}}else if(e.includes("OS X 10")){let[,t]=e.match(/OS X 10[_.](\d+)/);we=Te=Number(t)<15}if(e.includes("Chrome/")){let[,t]=e.match(/Chrome\/(\d+)/);we=Te=Number(t)<81}else if(e.includes("Firefox/")){let[,t]=e.match(/Firefox\/(\d+)/);we=Te=Number(t)<77}}async function Ae(e){let t=await Pe(e);return Object.assign({canvas:we,css:Te},ke[t])}class De extends I{constructor(...e){super(...e),c(this,"ranges",new Oe),0!==this.byteLength&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,i){if(0===e&&0===this.byteLength&&i){let e=new DataView(i.buffer||i,i.byteOffset,i.byteLength);this._swapDataView(e)}else{let i=e+t;if(i>this.byteLength){let{dataView:e}=this._extend(i);this._swapDataView(e)}}}_extend(e){let t;t=a?s.allocUnsafe(e):new Uint8Array(e);let i=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:i}}subarray(e,t,i=!1){return t=t||this._lengthToEnd(e),i&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,i=!1){i&&this._tryExtend(t,e.byteLength,e);let n=super.set(e,t);return this.ranges.add(t,n.byteLength),n}async ensureChunk(e,t){this.chunked&&(this.ranges.available(e,t)||await this.readChunk(e,t))}available(e,t){return this.ranges.available(e,t)}}class Oe{constructor(){c(this,"list",[])}get length(){return this.list.length}add(e,t,i=0){let n=e+t,s=this.list.filter((t=>xe(e,t.offset,n)||xe(e,t.end,n)));if(s.length>0){e=Math.min(e,...s.map((e=>e.offset))),n=Math.max(n,...s.map((e=>e.end))),t=n-e;let i=s.shift();i.offset=e,i.length=t,i.end=n,this.list=this.list.filter((e=>!s.includes(e)))}else this.list.push({offset:e,length:t,end:n})}available(e,t){let i=e+t;return this.list.some((t=>t.offset<=e&&i<=t.end))}}function xe(e,t,i){return e<=t&&t<=i}class ve extends De{constructor(e,t){super(0),c(this,"chunksRead",0),this.input=e,this.options=t}async readWhole(){this.chunked=!1,await this.readChunk(this.nextChunkOffset)}async readChunked(){this.chunked=!0,await this.readChunk(0,this.options.firstChunkSize)}async readNextChunk(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,i=await this.readChunk(e,t);return!!i&&i.byteLength===t}async readChunk(e,t){if(this.chunksRead++,0!==(t=this.safeWrapAddress(e,t)))return this._readChunk(e,t)}safeWrapAddress(e,t){return void 0!==this.size&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(0!==this.ranges.list.length)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return void 0!==this.size&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}}A.set("blob",class extends ve{async readWhole(){this.chunked=!1;let e=await R(this.input);this._swapArrayBuffer(e)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(e,t){let i=t?e+t:void 0,n=this.input.slice(e,i),s=await R(n);return this.set(s,e,!0)}});var Me=Object.freeze({__proto__:null,default:pe,Exifr:te,fileParsers:w,segmentParsers:T,fileReaders:A,tagKeys:E,tagValues:B,tagRevivers:N,createDictionary:U,extendDictionary:F,fetchUrlAsArrayBuffer:M,readBlobAsArrayBuffer:R,chunkedProps:G,otherSegments:V,segments:z,tiffBlocks:H,segmentsAndBlocks:j,tiffExtractables:W,inheritables:K,allFormatters:X,Options:q,parse:ie,gpsOnlyOptions:me,gps:Se,thumbnailOnlyOptions:Ce,thumbnail:ye,thumbnailUrl:be,orientationOnlyOptions:Ie,orientation:Pe,rotations:ke,get rotateCanvas(){return we},get rotateCss(){return Te},rotation:Ae});A.set("url",class extends ve{async readWhole(){this.chunked=!1;let e=await M(this.input);e instanceof ArrayBuffer?this._swapArrayBuffer(e):e instanceof Uint8Array&&this._swapBuffer(e)}async _readChunk(e,t){let i=t?e+t-1:void 0,n=this.options.httpHeaders||{};(e||i)&&(n.range=`bytes=${[e,i].join("-")}`);let s=await h(this.input,{headers:n}),r=await s.arrayBuffer(),a=r.byteLength;if(416!==s.status)return a!==t&&(this.size=e+a),this.set(r,e,!0)}});I.prototype.getUint64=function(e){let t=this.getUint32(e),i=this.getUint32(e+4);return t<1048575?t<<32|i:void 0!==typeof r?(console.warn("Using BigInt because of type 64uint but JS can only handle 53b numbers."),r(t)<<r(32)|r(i)):void g("Trying to read 64b value but JS can only handle 53b numbers.")};class Re extends se{parseBoxes(e=0){let t=[];for(;e<this.file.byteLength-4;){let i=this.parseBoxHead(e);if(t.push(i),0===i.length)break;e+=i.length}return t}parseSubBoxes(e){e.boxes=this.parseBoxes(e.start)}findBox(e,t){return void 0===e.boxes&&this.parseSubBoxes(e),e.boxes.find((e=>e.kind===t))}parseBoxHead(e){let t=this.file.getUint32(e),i=this.file.getString(e+4,4),n=e+8;return 1===t&&(t=this.file.getUint64(e+8),n+=8),{offset:e,length:t,kind:i,start:n}}parseBoxFullHead(e){if(void 0!==e.version)return;let t=this.file.getUint32(e.start);e.version=t>>24,e.start+=4}}class Le extends Re{static canHandle(e,t){if(0!==t)return!1;let i=e.getUint16(2);if(i>50)return!1;let n=16,s=[];for(;n<i;)s.push(e.getString(n,4)),n+=4;return s.includes(this.type)}async parse(){let e=this.file.getUint32(0),t=this.parseBoxHead(e);for(;"meta"!==t.kind;)e+=t.length,await this.file.ensureChunk(e,16),t=this.parseBoxHead(e);await this.file.ensureChunk(t.offset,t.length),this.parseBoxFullHead(t),this.parseSubBoxes(t),this.options.icc.enabled&&await this.findIcc(t),this.options.tiff.enabled&&await this.findExif(t)}async registerSegment(e,t,i){await this.file.ensureChunk(t,i);let n=this.file.subarray(t,i);this.createParser(e,n)}async findIcc(e){let t=this.findBox(e,"iprp");if(void 0===t)return;let i=this.findBox(t,"ipco");if(void 0===i)return;let n=this.findBox(i,"colr");void 0!==n&&await this.registerSegment("icc",n.offset+12,n.length)}async findExif(e){let t=this.findBox(e,"iinf");if(void 0===t)return;let i=this.findBox(e,"iloc");if(void 0===i)return;let n=this.findExifLocIdInIinf(t),s=this.findExtentInIloc(i,n);if(void 0===s)return;let[r,a]=s;await this.file.ensureChunk(r,a);let o=4+this.file.getUint32(r);r+=o,a-=o,await this.registerSegment("tiff",r,a)}findExifLocIdInIinf(e){this.parseBoxFullHead(e);let t,i,n,s,r=e.start,a=this.file.getUint16(r);for(r+=2;a--;){if(t=this.parseBoxHead(r),this.parseBoxFullHead(t),i=t.start,t.version>=2&&(n=3===t.version?4:2,s=this.file.getString(i+n+2,4),"Exif"===s))return this.file.getUintBytes(i,n);r+=t.length}}get8bits(e){let t=this.file.getUint8(e);return[t>>4,15&t]}findExtentInIloc(e,t){this.parseBoxFullHead(e);let i=e.start,[n,s]=this.get8bits(i++),[r,a]=this.get8bits(i++),o=2===e.version?4:2,l=1===e.version||2===e.version?2:0,h=a+n+s,u=2===e.version?4:2,c=this.file.getUintBytes(i,u);for(i+=u;c--;){let e=this.file.getUintBytes(i,o);i+=o+l+2+r;let u=this.file.getUint16(i);if(i+=2,e===t)return u>1&&console.warn("ILOC box has more than one extent but we're only processing one\nPlease create an issue at https://github.com/MikeKovarik/exifr with this file"),[this.file.getUintBytes(i+a,n),this.file.getUintBytes(i+a+n,s)];i+=u*h}}}class Ue extends Le{}c(Ue,"type","heic");class Fe extends Le{}c(Fe,"type","avif"),w.set("heic",Ue),w.set("avif",Fe),U(E,["ifd0","ifd1"],[[256,"ImageWidth"],[257,"ImageHeight"],[258,"BitsPerSample"],[259,"Compression"],[262,"PhotometricInterpretation"],[270,"ImageDescription"],[271,"Make"],[272,"Model"],[273,"StripOffsets"],[274,"Orientation"],[277,"SamplesPerPixel"],[278,"RowsPerStrip"],[279,"StripByteCounts"],[282,"XResolution"],[283,"YResolution"],[284,"PlanarConfiguration"],[296,"ResolutionUnit"],[301,"TransferFunction"],[305,"Software"],[306,"ModifyDate"],[315,"Artist"],[316,"HostComputer"],[317,"Predictor"],[318,"WhitePoint"],[319,"PrimaryChromaticities"],[513,"ThumbnailOffset"],[514,"ThumbnailLength"],[529,"YCbCrCoefficients"],[530,"YCbCrSubSampling"],[531,"YCbCrPositioning"],[532,"ReferenceBlackWhite"],[700,"ApplicationNotes"],[33432,"Copyright"],[33723,"IPTC"],[34665,"ExifIFD"],[34675,"ICC"],[34853,"GpsIFD"],[330,"SubIFD"],[40965,"InteropIFD"],[40091,"XPTitle"],[40092,"XPComment"],[40093,"XPAuthor"],[40094,"XPKeywords"],[40095,"XPSubject"]]),U(E,"exif",[[33434,"ExposureTime"],[33437,"FNumber"],[34850,"ExposureProgram"],[34852,"SpectralSensitivity"],[34855,"ISO"],[34858,"TimeZoneOffset"],[34859,"SelfTimerMode"],[34864,"SensitivityType"],[34865,"StandardOutputSensitivity"],[34866,"RecommendedExposureIndex"],[34867,"ISOSpeed"],[34868,"ISOSpeedLatitudeyyy"],[34869,"ISOSpeedLatitudezzz"],[36864,"ExifVersion"],[36867,"DateTimeOriginal"],[36868,"CreateDate"],[36873,"GooglePlusUploadCode"],[36880,"OffsetTime"],[36881,"OffsetTimeOriginal"],[36882,"OffsetTimeDigitized"],[37121,"ComponentsConfiguration"],[37122,"CompressedBitsPerPixel"],[37377,"ShutterSpeedValue"],[37378,"ApertureValue"],[37379,"BrightnessValue"],[37380,"ExposureCompensation"],[37381,"MaxApertureValue"],[37382,"SubjectDistance"],[37383,"MeteringMode"],[37384,"LightSource"],[37385,"Flash"],[37386,"FocalLength"],[37393,"ImageNumber"],[37394,"SecurityClassification"],[37395,"ImageHistory"],[37396,"SubjectArea"],[37500,"MakerNote"],[37510,"UserComment"],[37520,"SubSecTime"],[37521,"SubSecTimeOriginal"],[37522,"SubSecTimeDigitized"],[37888,"AmbientTemperature"],[37889,"Humidity"],[37890,"Pressure"],[37891,"WaterDepth"],[37892,"Acceleration"],[37893,"CameraElevationAngle"],[40960,"FlashpixVersion"],[40961,"ColorSpace"],[40962,"ExifImageWidth"],[40963,"ExifImageHeight"],[40964,"RelatedSoundFile"],[41483,"FlashEnergy"],[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,"FocalLengthIn35mmFormat"],[41990,"SceneCaptureType"],[41991,"GainControl"],[41992,"Contrast"],[41993,"Saturation"],[41994,"Sharpness"],[41996,"SubjectDistanceRange"],[42016,"ImageUniqueID"],[42032,"OwnerName"],[42033,"SerialNumber"],[42034,"LensInfo"],[42035,"LensMake"],[42036,"LensModel"],[42037,"LensSerialNumber"],[42080,"CompositeImage"],[42081,"CompositeImageCount"],[42082,"CompositeImageExposureTimes"],[42240,"Gamma"],[59932,"Padding"],[59933,"OffsetSchema"],[65e3,"OwnerName"],[65001,"SerialNumber"],[65002,"Lens"],[65100,"RawFile"],[65101,"Converter"],[65102,"WhiteBalance"],[65105,"Exposure"],[65106,"Shadows"],[65107,"Brightness"],[65108,"Contrast"],[65109,"Saturation"],[65110,"Sharpness"],[65111,"Smoothness"],[65112,"MoireFilter"],[40965,"InteropIFD"]]),U(E,"gps",[[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"]]),U(B,["ifd0","ifd1"],[[274,{1:"Horizontal (normal)",2:"Mirror horizontal",3:"Rotate 180",4:"Mirror vertical",5:"Mirror horizontal and rotate 270 CW",6:"Rotate 90 CW",7:"Mirror horizontal and rotate 90 CW",8:"Rotate 270 CW"}],[296,{1:"None",2:"inches",3:"cm"}]]);let Ee=U(B,"exif",[[34850,{0:"Not defined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"}],[37121,{0:"-",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"}],[37383,{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"}],[37384,{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"}],[37385,{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"}],[41495,{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"}],[41728,{1:"Film Scanner",2:"Reflection Print Scanner",3:"Digital Camera"}],[41729,{1:"Directly photographed"}],[41985,{0:"Normal",1:"Custom",2:"HDR (no original saved)",3:"HDR (original saved)",4:"Original (for HDR)",6:"Panorama",7:"Portrait HDR",8:"Portrait"}],[41986,{0:"Auto",1:"Manual",2:"Auto bracket"}],[41987,{0:"Auto",1:"Manual"}],[41990,{0:"Standard",1:"Landscape",2:"Portrait",3:"Night",4:"Other"}],[41991,{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"}],[41996,{0:"Unknown",1:"Macro",2:"Close",3:"Distant"}],[42080,{0:"Unknown",1:"Not a Composite Image",2:"General Composite Image",3:"Composite Image Captured While Shooting"}]]);const Be={1:"No absolute unit of measurement",2:"Inch",3:"Centimeter"};Ee.set(37392,Be),Ee.set(41488,Be);const Ne={0:"Normal",1:"Low",2:"High"};function Ge(e){return"object"==typeof e&&void 0!==e.length?e[0]:e}function Ve(e){let t=Array.from(e).slice(1);return t[1]>15&&(t=t.map((e=>String.fromCharCode(e)))),"0"!==t[2]&&0!==t[2]||t.pop(),t.join(".")}function ze(e){if("string"==typeof e){var[t,i,n,s,r,a]=e.trim().split(/[-: ]/g).map(Number),o=new Date(t,i-1,n);return Number.isNaN(s)||Number.isNaN(r)||Number.isNaN(a)||(o.setHours(s),o.setMinutes(r),o.setSeconds(a)),Number.isNaN(+o)?e:o}}function He(e){if("string"==typeof e)return e;let t=[];if(0===e[1]&&0===e[e.length-1])for(let i=0;i<e.length;i+=2)t.push(je(e[i+1],e[i]));else for(let i=0;i<e.length;i+=2)t.push(je(e[i],e[i+1]));return m(String.fromCodePoint(...t))}function je(e,t){return e<<8|t}Ee.set(41992,Ne),Ee.set(41993,Ne),Ee.set(41994,Ne),U(N,["ifd0","ifd1"],[[50827,function(e){return"string"!=typeof e?b(e):e}],[306,ze],[40091,He],[40092,He],[40093,He],[40094,He],[40095,He]]),U(N,"exif",[[40960,Ve],[36864,Ve],[36867,ze],[36868,ze],[40962,Ge],[40963,Ge]]),U(N,"gps",[[0,e=>Array.from(e).join(".")],[7,e=>Array.from(e).join(":")]]);class We extends re{static canHandle(e,t){return 225===e.getUint8(t+1)&&1752462448===e.getUint32(t+4)&&"http://ns.adobe.com/"===e.getString(t+4,"http://ns.adobe.com/".length)}static headerLength(e,t){return"http://ns.adobe.com/xmp/extension/"===e.getString(t+4,"http://ns.adobe.com/xmp/extension/".length)?79:4+"http://ns.adobe.com/xap/1.0/".length+1}static findPosition(e,t){let i=super.findPosition(e,t);return i.multiSegment=i.extended=79===i.headerLength,i.multiSegment?(i.chunkCount=e.getUint8(t+72),i.chunkNumber=e.getUint8(t+76),0!==e.getUint8(t+77)&&i.chunkNumber++):(i.chunkCount=1/0,i.chunkNumber=-1),i}static handleMultiSegments(e){return e.map((e=>e.chunk.getString())).join("")}normalizeInput(e){return"string"==typeof e?e:I.from(e).getString()}parse(e=this.chunk){if(!this.localOptions.parse)return e;e=function(e){let t={},i={};for(let e of Ze)t[e]=[],i[e]=0;return e.replace(et,((e,n,s)=>{if("<"===n){let n=++i[s];return t[s].push(n),`${e}#${n}`}return`${e}#${t[s].pop()}`}))}(e);let t=Xe.findAll(e,"rdf","Description");0===t.length&&t.push(new Xe("rdf","Description",void 0,e));let i,n={};for(let e of t)for(let t of e.properties)i=Je(t.ns,n),_e(t,i);return function(e){let t;for(let i in e)t=e[i]=f(e[i]),void 0===t&&delete e[i];return f(e)}(n)}assignToOutput(e,t){if(this.localOptions.parse)for(let[i,n]of Object.entries(t))switch(i){case"tiff":this.assignObjectToOutput(e,"ifd0",n);break;case"exif":this.assignObjectToOutput(e,"exif",n);break;case"xmlns":break;default:this.assignObjectToOutput(e,i,n)}else e.xmp=t}}c(We,"type","xmp"),c(We,"multiSegment",!0),T.set("xmp",We);class Ke{static findAll(e){return qe(e,/([a-zA-Z0-9-]+):([a-zA-Z0-9-]+)=("[^"]*"|'[^']*')/gm).map(Ke.unpackMatch)}static unpackMatch(e){let t=e[1],i=e[2],n=e[3].slice(1,-1);return n=Qe(n),new Ke(t,i,n)}constructor(e,t,i){this.ns=e,this.name=t,this.value=i}serialize(){return this.value}}class Xe{static findAll(e,t,i){if(void 0!==t||void 0!==i){t=t||"[\\w\\d-]+",i=i||"[\\w\\d-]+";var n=new RegExp(`<(${t}):(${i})(#\\d+)?((\\s+?[\\w\\d-:]+=("[^"]*"|'[^']*'))*\\s*)(\\/>|>([\\s\\S]*?)<\\/\\1:\\2\\3>)`,"gm")}else n=/<([\w\d-]+):([\w\d-]+)(#\d+)?((\s+?[\w\d-:]+=("[^"]*"|'[^']*'))*\s*)(\/>|>([\s\S]*?)<\/\1:\2\3>)/gm;return qe(e,n).map(Xe.unpackMatch)}static unpackMatch(e){let t=e[1],i=e[2],n=e[4],s=e[8];return new Xe(t,i,n,s)}constructor(e,t,i,n){this.ns=e,this.name=t,this.attrString=i,this.innerXml=n,this.attrs=Ke.findAll(i),this.children=Xe.findAll(n),this.value=0===this.children.length?Qe(n):void 0,this.properties=[...this.attrs,...this.children]}get isPrimitive(){return void 0!==this.value&&0===this.attrs.length&&0===this.children.length}get isListContainer(){return 1===this.children.length&&this.children[0].isList}get isList(){let{ns:e,name:t}=this;return"rdf"===e&&("Seq"===t||"Bag"===t||"Alt"===t)}get isListItem(){return"rdf"===this.ns&&"li"===this.name}serialize(){if(0===this.properties.length&&void 0===this.value)return;if(this.isPrimitive)return this.value;if(this.isListContainer)return this.children[0].serialize();if(this.isList)return $e(this.children.map(Ye));if(this.isListItem&&1===this.children.length&&0===this.attrs.length)return this.children[0].serialize();let e={};for(let t of this.properties)_e(t,e);return void 0!==this.value&&(e.value=this.value),f(e)}}function _e(e,t){let i=e.serialize();void 0!==i&&(t[e.name]=i)}var Ye=e=>e.serialize(),$e=e=>1===e.length?e[0]:e,Je=(e,t)=>t[e]?t[e]:t[e]={};function qe(e,t){let i,n=[];if(!e)return n;for(;null!==(i=t.exec(e));)n.push(i);return n}function Qe(e){if(function(e){return null==e||"null"===e||"undefined"===e||""===e||""===e.trim()}(e))return;let t=Number(e);if(!Number.isNaN(t))return t;let i=e.toLowerCase();return"true"===i||"false"!==i&&e.trim()}const Ze=["rdf:li","rdf:Seq","rdf:Bag","rdf:Alt","rdf:Description"],et=new RegExp(`(<|\\/)(${Ze.join("|")})`,"g");var tt=Object.freeze({__proto__:null,default:Me,Exifr:te,fileParsers:w,segmentParsers:T,fileReaders:A,tagKeys:E,tagValues:B,tagRevivers:N,createDictionary:U,extendDictionary:F,fetchUrlAsArrayBuffer:M,readBlobAsArrayBuffer:R,chunkedProps:G,otherSegments:V,segments:z,tiffBlocks:H,segmentsAndBlocks:j,tiffExtractables:W,inheritables:K,allFormatters:X,Options:q,parse:ie,gpsOnlyOptions:me,gps:Se,thumbnailOnlyOptions:Ce,thumbnail:ye,thumbnailUrl:be,orientationOnlyOptions:Ie,orientation:Pe,rotations:ke,get rotateCanvas(){return we},get rotateCss(){return Te},rotation:Ae});const it=(/* unused pure expression or super */ null && (["xmp","icc","iptc","tiff"])),nt=()=>{};async function st(e,t,i){let n=new q(t);n.chunked=!1,void 0===i&&"string"==typeof e&&(i=function(e){let t=e.toLowerCase().split(".").pop();if(function(e){return"exif"===e||"tiff"===e||"tif"===e}(t))return"tiff";if(it.includes(t))return t}(e));let s=await D(e,n);if(i){if(it.includes(i))return rt(i,s,n);g("Invalid segment type")}else{if(function(e){let t=e.getString(0,50).trim();return t.includes("<?xpacket")||t.includes("<x:")}(s))return rt("xmp",s,n);for(let[e]of T){if(!it.includes(e))continue;let t=await rt(e,s,n).catch(nt);if(t)return t}g("Unknown file format")}}async function rt(e,t,i){let n=i[e];return n.enabled=!0,n.parse=!0,T.get(e).parse(t,n)}let at=l("fs",(e=>e.promises));A.set("fs",class extends ve{async readWhole(){this.chunked=!1,this.fs=await at;let e=await this.fs.readFile(this.input);this._swapBuffer(e)}async readChunked(){this.chunked=!0,this.fs=await at,await this.open(),await this.readChunk(0,this.options.firstChunkSize)}async open(){void 0===this.fh&&(this.fh=await this.fs.open(this.input,"r"),this.size=(await this.fh.stat(this.input)).size)}async _readChunk(e,t){void 0===this.fh&&await this.open(),e+t>this.size&&(t=this.size-e);var i=this.subarray(e,t,!0);return await this.fh.read(i.dataView,0,t,e),i}async close(){if(this.fh){let e=this.fh;this.fh=void 0,await e.close()}}});A.set("base64",class extends ve{constructor(...e){super(...e),this.input=this.input.replace(/^data:([^;]+);base64,/gim,""),this.size=this.input.length/4*3,this.input.endsWith("==")?this.size-=2:this.input.endsWith("=")&&(this.size-=1)}async _readChunk(e,t){let i,n,r=this.input;void 0===e?(e=0,i=0,n=0):(i=4*Math.floor(e/3),n=e-i/4*3),void 0===t&&(t=this.size);let o=e+t,l=i+4*Math.ceil(o/3);r=r.slice(i,l);let h=Math.min(t,this.size-e);if(a){let t=s.from(r,"base64").slice(n,n+h);return this.set(t,e,!0)}{let t=this.subarray(e,h,!0),i=atob(r),s=t.toUint8();for(let e=0;e<h;e++)s[e]=i.charCodeAt(n+e);return t}}});class ot extends se{static canHandle(e,t){return 18761===t||19789===t}extendOptions(e){let{ifd0:t,xmp:i,iptc:n,icc:s}=e;i.enabled&&t.deps.add(700),n.enabled&&t.deps.add(33723),s.enabled&&t.deps.add(34675),t.finalizeFilters()}async parse(){let{tiff:e,xmp:t,iptc:i,icc:n}=this.options;if(e.enabled||t.enabled||i.enabled||n.enabled){let e=Math.max(S(this.options),this.options.chunkSize);await this.file.ensureChunk(0,e),this.createParser("tiff",this.file),this.parsers.tiff.parseHeader(),await this.parsers.tiff.parseIfd0Block(),this.adaptTiffPropAsSegment("xmp"),this.adaptTiffPropAsSegment("iptc"),this.adaptTiffPropAsSegment("icc")}}adaptTiffPropAsSegment(e){if(this.parsers.tiff[e]){let t=this.parsers.tiff[e];this.injectSegment(e,t)}}}c(ot,"type","tiff"),w.set("tiff",ot);let lt=l("zlib");const ht=["ihdr","iccp","text","itxt","exif"];class ut extends se{constructor(...e){super(...e),c(this,"catchError",(e=>this.errors.push(e))),c(this,"metaChunks",[]),c(this,"unknownChunks",[])}static canHandle(e,t){return 35152===t&&2303741511===e.getUint32(0)&&218765834===e.getUint32(4)}async parse(){let{file:e}=this;await this.findPngChunksInRange("PNG\r\n\n".length,e.byteLength),await this.readSegments(this.metaChunks),this.findIhdr(),this.parseTextChunks(),await this.findExif().catch(this.catchError),await this.findXmp().catch(this.catchError),await this.findIcc().catch(this.catchError)}async findPngChunksInRange(e,t){let{file:i}=this;for(;e<t;){let t=i.getUint32(e),n=i.getUint32(e+4),s=i.getString(e+4,4).toLowerCase(),r=t+4+4+4,a={type:s,offset:e,length:r,start:e+4+4,size:t,marker:n};ht.includes(s)?this.metaChunks.push(a):this.unknownChunks.push(a),e+=r}}parseTextChunks(){let e=this.metaChunks.filter((e=>"text"===e.type));for(let t of e){let[e,i]=this.file.getString(t.start,t.size).split("\0");this.injectKeyValToIhdr(e,i)}}injectKeyValToIhdr(e,t){let i=this.parsers.ihdr;i&&i.raw.set(e,t)}findIhdr(){let e=this.metaChunks.find((e=>"ihdr"===e.type));e&&!1!==this.options.ihdr.enabled&&this.createParser("ihdr",e.chunk)}async findExif(){let e=this.metaChunks.find((e=>"exif"===e.type));e&&this.injectSegment("tiff",e.chunk)}async findXmp(){let e=this.metaChunks.filter((e=>"itxt"===e.type));for(let t of e){"XML:com.adobe.xmp"===t.chunk.getString(0,"XML:com.adobe.xmp".length)&&this.injectSegment("xmp",t.chunk)}}async findIcc(){let e=this.metaChunks.find((e=>"iccp"===e.type));if(!e)return;let{chunk:t}=e,i=t.getUint8Array(0,81),s=0;for(;s<80&&0!==i[s];)s++;let r=s+2,a=t.getString(0,s);if(this.injectKeyValToIhdr("ProfileName",a),n){let e=await lt,i=t.getUint8Array(r);i=e.inflateSync(i),this.injectSegment("icc",i)}}}c(ut,"type","png"),w.set("png",ut),U(E,"interop",[[1,"InteropIndex"],[2,"InteropVersion"],[4096,"RelatedImageFileFormat"],[4097,"RelatedImageWidth"],[4098,"RelatedImageHeight"]]),F(E,"ifd0",[[11,"ProcessingSoftware"],[254,"SubfileType"],[255,"OldSubfileType"],[263,"Thresholding"],[264,"CellWidth"],[265,"CellLength"],[266,"FillOrder"],[269,"DocumentName"],[280,"MinSampleValue"],[281,"MaxSampleValue"],[285,"PageName"],[286,"XPosition"],[287,"YPosition"],[290,"GrayResponseUnit"],[297,"PageNumber"],[321,"HalftoneHints"],[322,"TileWidth"],[323,"TileLength"],[332,"InkSet"],[337,"TargetPrinter"],[18246,"Rating"],[18249,"RatingPercent"],[33550,"PixelScale"],[34264,"ModelTransform"],[34377,"PhotoshopSettings"],[50706,"DNGVersion"],[50707,"DNGBackwardVersion"],[50708,"UniqueCameraModel"],[50709,"LocalizedCameraModel"],[50736,"DNGLensInfo"],[50739,"ShadowScale"],[50740,"DNGPrivateData"],[33920,"IntergraphMatrix"],[33922,"ModelTiePoint"],[34118,"SEMInfo"],[34735,"GeoTiffDirectory"],[34736,"GeoTiffDoubleParams"],[34737,"GeoTiffAsciiParams"],[50341,"PrintIM"],[50721,"ColorMatrix1"],[50722,"ColorMatrix2"],[50723,"CameraCalibration1"],[50724,"CameraCalibration2"],[50725,"ReductionMatrix1"],[50726,"ReductionMatrix2"],[50727,"AnalogBalance"],[50728,"AsShotNeutral"],[50729,"AsShotWhiteXY"],[50730,"BaselineExposure"],[50731,"BaselineNoise"],[50732,"BaselineSharpness"],[50734,"LinearResponseLimit"],[50735,"CameraSerialNumber"],[50741,"MakerNoteSafety"],[50778,"CalibrationIlluminant1"],[50779,"CalibrationIlluminant2"],[50781,"RawDataUniqueID"],[50827,"OriginalRawFileName"],[50828,"OriginalRawFileData"],[50831,"AsShotICCProfile"],[50832,"AsShotPreProfileMatrix"],[50833,"CurrentICCProfile"],[50834,"CurrentPreProfileMatrix"],[50879,"ColorimetricReference"],[50885,"SRawType"],[50898,"PanasonicTitle"],[50899,"PanasonicTitle2"],[50931,"CameraCalibrationSig"],[50932,"ProfileCalibrationSig"],[50933,"ProfileIFD"],[50934,"AsShotProfileName"],[50936,"ProfileName"],[50937,"ProfileHueSatMapDims"],[50938,"ProfileHueSatMapData1"],[50939,"ProfileHueSatMapData2"],[50940,"ProfileToneCurve"],[50941,"ProfileEmbedPolicy"],[50942,"ProfileCopyright"],[50964,"ForwardMatrix1"],[50965,"ForwardMatrix2"],[50966,"PreviewApplicationName"],[50967,"PreviewApplicationVersion"],[50968,"PreviewSettingsName"],[50969,"PreviewSettingsDigest"],[50970,"PreviewColorSpace"],[50971,"PreviewDateTime"],[50972,"RawImageDigest"],[50973,"OriginalRawFileDigest"],[50981,"ProfileLookTableDims"],[50982,"ProfileLookTableData"],[51043,"TimeCodes"],[51044,"FrameRate"],[51058,"TStop"],[51081,"ReelName"],[51089,"OriginalDefaultFinalSize"],[51090,"OriginalBestQualitySize"],[51091,"OriginalDefaultCropSize"],[51105,"CameraLabel"],[51107,"ProfileHueSatMapEncoding"],[51108,"ProfileLookTableEncoding"],[51109,"BaselineExposureOffset"],[51110,"DefaultBlackRender"],[51111,"NewRawImageDigest"],[51112,"RawToPreviewGain"]]);let ct=[[273,"StripOffsets"],[279,"StripByteCounts"],[288,"FreeOffsets"],[289,"FreeByteCounts"],[291,"GrayResponseCurve"],[292,"T4Options"],[293,"T6Options"],[300,"ColorResponseUnit"],[320,"ColorMap"],[324,"TileOffsets"],[325,"TileByteCounts"],[326,"BadFaxLines"],[327,"CleanFaxData"],[328,"ConsecutiveBadFaxLines"],[330,"SubIFD"],[333,"InkNames"],[334,"NumberofInks"],[336,"DotRange"],[338,"ExtraSamples"],[339,"SampleFormat"],[340,"SMinSampleValue"],[341,"SMaxSampleValue"],[342,"TransferRange"],[343,"ClipPath"],[344,"XClipPathUnits"],[345,"YClipPathUnits"],[346,"Indexed"],[347,"JPEGTables"],[351,"OPIProxy"],[400,"GlobalParametersIFD"],[401,"ProfileType"],[402,"FaxProfile"],[403,"CodingMethods"],[404,"VersionYear"],[405,"ModeNumber"],[433,"Decode"],[434,"DefaultImageColor"],[435,"T82Options"],[437,"JPEGTables"],[512,"JPEGProc"],[515,"JPEGRestartInterval"],[517,"JPEGLosslessPredictors"],[518,"JPEGPointTransforms"],[519,"JPEGQTables"],[520,"JPEGDCTables"],[521,"JPEGACTables"],[559,"StripRowCounts"],[999,"USPTOMiscellaneous"],[18247,"XP_DIP_XML"],[18248,"StitchInfo"],[28672,"SonyRawFileType"],[28688,"SonyToneCurve"],[28721,"VignettingCorrection"],[28722,"VignettingCorrParams"],[28724,"ChromaticAberrationCorrection"],[28725,"ChromaticAberrationCorrParams"],[28726,"DistortionCorrection"],[28727,"DistortionCorrParams"],[29895,"SonyCropTopLeft"],[29896,"SonyCropSize"],[32781,"ImageID"],[32931,"WangTag1"],[32932,"WangAnnotation"],[32933,"WangTag3"],[32934,"WangTag4"],[32953,"ImageReferencePoints"],[32954,"RegionXformTackPoint"],[32955,"WarpQuadrilateral"],[32956,"AffineTransformMat"],[32995,"Matteing"],[32996,"DataType"],[32997,"ImageDepth"],[32998,"TileDepth"],[33300,"ImageFullWidth"],[33301,"ImageFullHeight"],[33302,"TextureFormat"],[33303,"WrapModes"],[33304,"FovCot"],[33305,"MatrixWorldToScreen"],[33306,"MatrixWorldToCamera"],[33405,"Model2"],[33421,"CFARepeatPatternDim"],[33422,"CFAPattern2"],[33423,"BatteryLevel"],[33424,"KodakIFD"],[33445,"MDFileTag"],[33446,"MDScalePixel"],[33447,"MDColorTable"],[33448,"MDLabName"],[33449,"MDSampleInfo"],[33450,"MDPrepDate"],[33451,"MDPrepTime"],[33452,"MDFileUnits"],[33589,"AdventScale"],[33590,"AdventRevision"],[33628,"UIC1Tag"],[33629,"UIC2Tag"],[33630,"UIC3Tag"],[33631,"UIC4Tag"],[33918,"IntergraphPacketData"],[33919,"IntergraphFlagRegisters"],[33921,"INGRReserved"],[34016,"Site"],[34017,"ColorSequence"],[34018,"IT8Header"],[34019,"RasterPadding"],[34020,"BitsPerRunLength"],[34021,"BitsPerExtendedRunLength"],[34022,"ColorTable"],[34023,"ImageColorIndicator"],[34024,"BackgroundColorIndicator"],[34025,"ImageColorValue"],[34026,"BackgroundColorValue"],[34027,"PixelIntensityRange"],[34028,"TransparencyIndicator"],[34029,"ColorCharacterization"],[34030,"HCUsage"],[34031,"TrapIndicator"],[34032,"CMYKEquivalent"],[34152,"AFCP_IPTC"],[34232,"PixelMagicJBIGOptions"],[34263,"JPLCartoIFD"],[34306,"WB_GRGBLevels"],[34310,"LeafData"],[34687,"TIFF_FXExtensions"],[34688,"MultiProfiles"],[34689,"SharedData"],[34690,"T88Options"],[34732,"ImageLayer"],[34750,"JBIGOptions"],[34856,"Opto-ElectricConvFactor"],[34857,"Interlace"],[34908,"FaxRecvParams"],[34909,"FaxSubAddress"],[34910,"FaxRecvTime"],[34929,"FedexEDR"],[34954,"LeafSubIFD"],[37387,"FlashEnergy"],[37388,"SpatialFrequencyResponse"],[37389,"Noise"],[37390,"FocalPlaneXResolution"],[37391,"FocalPlaneYResolution"],[37392,"FocalPlaneResolutionUnit"],[37397,"ExposureIndex"],[37398,"TIFF-EPStandardID"],[37399,"SensingMethod"],[37434,"CIP3DataFile"],[37435,"CIP3Sheet"],[37436,"CIP3Side"],[37439,"StoNits"],[37679,"MSDocumentText"],[37680,"MSPropertySetStorage"],[37681,"MSDocumentTextPosition"],[37724,"ImageSourceData"],[40965,"InteropIFD"],[40976,"SamsungRawPointersOffset"],[40977,"SamsungRawPointersLength"],[41217,"SamsungRawByteOrder"],[41218,"SamsungRawUnknown"],[41484,"SpatialFrequencyResponse"],[41485,"Noise"],[41489,"ImageNumber"],[41490,"SecurityClassification"],[41491,"ImageHistory"],[41494,"TIFF-EPStandardID"],[41995,"DeviceSettingDescription"],[42112,"GDALMetadata"],[42113,"GDALNoData"],[44992,"ExpandSoftware"],[44993,"ExpandLens"],[44994,"ExpandFilm"],[44995,"ExpandFilterLens"],[44996,"ExpandScanner"],[44997,"ExpandFlashLamp"],[46275,"HasselbladRawImage"],[48129,"PixelFormat"],[48130,"Transformation"],[48131,"Uncompressed"],[48132,"ImageType"],[48256,"ImageWidth"],[48257,"ImageHeight"],[48258,"WidthResolution"],[48259,"HeightResolution"],[48320,"ImageOffset"],[48321,"ImageByteCount"],[48322,"AlphaOffset"],[48323,"AlphaByteCount"],[48324,"ImageDataDiscard"],[48325,"AlphaDataDiscard"],[50215,"OceScanjobDesc"],[50216,"OceApplicationSelector"],[50217,"OceIDNumber"],[50218,"OceImageLogic"],[50255,"Annotations"],[50459,"HasselbladExif"],[50547,"OriginalFileName"],[50560,"USPTOOriginalContentType"],[50656,"CR2CFAPattern"],[50710,"CFAPlaneColor"],[50711,"CFALayout"],[50712,"LinearizationTable"],[50713,"BlackLevelRepeatDim"],[50714,"BlackLevel"],[50715,"BlackLevelDeltaH"],[50716,"BlackLevelDeltaV"],[50717,"WhiteLevel"],[50718,"DefaultScale"],[50719,"DefaultCropOrigin"],[50720,"DefaultCropSize"],[50733,"BayerGreenSplit"],[50737,"ChromaBlurRadius"],[50738,"AntiAliasStrength"],[50752,"RawImageSegmentation"],[50780,"BestQualityScale"],[50784,"AliasLayerMetadata"],[50829,"ActiveArea"],[50830,"MaskedAreas"],[50935,"NoiseReductionApplied"],[50974,"SubTileBlockSize"],[50975,"RowInterleaveFactor"],[51008,"OpcodeList1"],[51009,"OpcodeList2"],[51022,"OpcodeList3"],[51041,"NoiseProfile"],[51114,"CacheVersion"],[51125,"DefaultUserCrop"],[51157,"NikonNEFInfo"],[65024,"KdcIFD"]];F(E,"ifd0",ct),F(E,"exif",ct),U(B,"gps",[[23,{M:"Magnetic North",T:"True North"}],[25,{K:"Kilometers",M:"Miles",N:"Nautical Miles"}]]);class ft extends re{static canHandle(e,t){return 224===e.getUint8(t+1)&&1246120262===e.getUint32(t+4)&&0===e.getUint8(t+8)}parse(){return this.parseTags(),this.translate(),this.output}parseTags(){this.raw=new Map([[0,this.chunk.getUint16(0)],[2,this.chunk.getUint8(2)],[3,this.chunk.getUint16(3)],[5,this.chunk.getUint16(5)],[7,this.chunk.getUint8(7)],[8,this.chunk.getUint8(8)]])}}c(ft,"type","jfif"),c(ft,"headerLength",9),T.set("jfif",ft),U(E,"jfif",[[0,"JFIFVersion"],[2,"ResolutionUnit"],[3,"XResolution"],[5,"YResolution"],[7,"ThumbnailWidth"],[8,"ThumbnailHeight"]]);class dt extends re{parse(){return this.parseTags(),this.translate(),this.output}parseTags(){this.raw=new Map([[0,this.chunk.getUint32(0)],[4,this.chunk.getUint32(4)],[8,this.chunk.getUint8(8)],[9,this.chunk.getUint8(9)],[10,this.chunk.getUint8(10)],[11,this.chunk.getUint8(11)],[12,this.chunk.getUint8(12)],...Array.from(this.raw)])}}c(dt,"type","ihdr"),T.set("ihdr",dt),U(E,"ihdr",[[0,"ImageWidth"],[4,"ImageHeight"],[8,"BitDepth"],[9,"ColorType"],[10,"Compression"],[11,"Filter"],[12,"Interlace"]]),U(B,"ihdr",[[9,{0:"Grayscale",2:"RGB",3:"Palette",4:"Grayscale with Alpha",6:"RGB with Alpha",DEFAULT:"Unknown"}],[10,{0:"Deflate/Inflate",DEFAULT:"Unknown"}],[11,{0:"Adaptive",DEFAULT:"Unknown"}],[12,{0:"Noninterlaced",1:"Adam7 Interlace",DEFAULT:"Unknown"}]]);class pt extends re{static canHandle(e,t){return 226===e.getUint8(t+1)&&1229144927===e.getUint32(t+4)}static findPosition(e,t){let i=super.findPosition(e,t);return i.chunkNumber=e.getUint8(t+16),i.chunkCount=e.getUint8(t+17),i.multiSegment=i.chunkCount>1,i}static handleMultiSegments(e){return function(e){let t=function(e){let t=e[0].constructor,i=0;for(let t of e)i+=t.length;let n=new t(i),s=0;for(let t of e)n.set(t,s),s+=t.length;return n}(e.map((e=>e.chunk.toUint8())));return new I(t)}(e)}parse(){return this.raw=new Map,this.parseHeader(),this.parseTags(),this.translate(),this.output}parseHeader(){let{raw:e}=this;this.chunk.byteLength<84&&g("ICC header is too short");for(let[t,i]of Object.entries(gt)){t=parseInt(t,10);let n=i(this.chunk,t);"\0\0\0\0"!==n&&e.set(t,n)}}parseTags(){let e,t,i,n,s,{raw:r}=this,a=this.chunk.getUint32(128),o=132,l=this.chunk.byteLength;for(;a--;){if(e=this.chunk.getString(o,4),t=this.chunk.getUint32(o+4),i=this.chunk.getUint32(o+8),n=this.chunk.getString(t,4),t+i>l)return void console.warn("reached the end of the first ICC chunk. Enable options.tiff.multiSegment to read all ICC segments.");s=this.parseTag(n,t,i),void 0!==s&&"\0\0\0\0"!==s&&r.set(e,s),o+=12}}parseTag(e,t,i){switch(e){case"desc":return this.parseDesc(t);case"mluc":return this.parseMluc(t);case"text":return this.parseText(t,i);case"sig ":return this.parseSig(t)}if(!(t+i>this.chunk.byteLength))return this.chunk.getUint8Array(t,i)}parseDesc(e){let t=this.chunk.getUint32(e+8)-1;return m(this.chunk.getString(e+12,t))}parseText(e,t){return m(this.chunk.getString(e+8,t-8))}parseSig(e){return m(this.chunk.getString(e+8,4))}parseMluc(e){let{chunk:t}=this,i=t.getUint32(e+8),n=t.getUint32(e+12),s=e+16,r=[];for(let a=0;a<i;a++){let i=t.getString(s+0,2),a=t.getString(s+2,2),o=t.getUint32(s+4),l=t.getUint32(s+8)+e,h=m(t.getUnicodeString(l,o));r.push({lang:i,country:a,text:h}),s+=n}return 1===i?r[0].text:r}translateValue(e,t){return"string"==typeof e?t[e]||t[e.toLowerCase()]||e:t[e]||e}}c(pt,"type","icc"),c(pt,"multiSegment",!0),c(pt,"headerLength",18);const gt={4:mt,8:function(e,t){return[e.getUint8(t),e.getUint8(t+1)>>4,e.getUint8(t+1)%16].map((e=>e.toString(10))).join(".")},12:mt,16:mt,20:mt,24:function(e,t){const i=e.getUint16(t),n=e.getUint16(t+2)-1,s=e.getUint16(t+4),r=e.getUint16(t+6),a=e.getUint16(t+8),o=e.getUint16(t+10);return new Date(Date.UTC(i,n,s,r,a,o))},36:mt,40:mt,48:mt,52:mt,64:(e,t)=>e.getUint32(t),80:mt};function mt(e,t){return m(e.getString(t,4))}T.set("icc",pt),U(E,"icc",[[4,"ProfileCMMType"],[8,"ProfileVersion"],[12,"ProfileClass"],[16,"ColorSpaceData"],[20,"ProfileConnectionSpace"],[24,"ProfileDateTime"],[36,"ProfileFileSignature"],[40,"PrimaryPlatform"],[44,"CMMFlags"],[48,"DeviceManufacturer"],[52,"DeviceModel"],[56,"DeviceAttributes"],[64,"RenderingIntent"],[68,"ConnectionSpaceIlluminant"],[80,"ProfileCreator"],[84,"ProfileID"],["Header","ProfileHeader"],["MS00","WCSProfiles"],["bTRC","BlueTRC"],["bXYZ","BlueMatrixColumn"],["bfd","UCRBG"],["bkpt","MediaBlackPoint"],["calt","CalibrationDateTime"],["chad","ChromaticAdaptation"],["chrm","Chromaticity"],["ciis","ColorimetricIntentImageState"],["clot","ColorantTableOut"],["clro","ColorantOrder"],["clrt","ColorantTable"],["cprt","ProfileCopyright"],["crdi","CRDInfo"],["desc","ProfileDescription"],["devs","DeviceSettings"],["dmdd","DeviceModelDesc"],["dmnd","DeviceMfgDesc"],["dscm","ProfileDescriptionML"],["fpce","FocalPlaneColorimetryEstimates"],["gTRC","GreenTRC"],["gXYZ","GreenMatrixColumn"],["gamt","Gamut"],["kTRC","GrayTRC"],["lumi","Luminance"],["meas","Measurement"],["meta","Metadata"],["mmod","MakeAndModel"],["ncl2","NamedColor2"],["ncol","NamedColor"],["ndin","NativeDisplayInfo"],["pre0","Preview0"],["pre1","Preview1"],["pre2","Preview2"],["ps2i","PS2RenderingIntent"],["ps2s","PostScript2CSA"],["psd0","PostScript2CRD0"],["psd1","PostScript2CRD1"],["psd2","PostScript2CRD2"],["psd3","PostScript2CRD3"],["pseq","ProfileSequenceDesc"],["psid","ProfileSequenceIdentifier"],["psvm","PS2CRDVMSize"],["rTRC","RedTRC"],["rXYZ","RedMatrixColumn"],["resp","OutputResponse"],["rhoc","ReflectionHardcopyOrigColorimetry"],["rig0","PerceptualRenderingIntentGamut"],["rig2","SaturationRenderingIntentGamut"],["rpoc","ReflectionPrintOutputColorimetry"],["sape","SceneAppearanceEstimates"],["scoe","SceneColorimetryEstimates"],["scrd","ScreeningDesc"],["scrn","Screening"],["targ","CharTarget"],["tech","Technology"],["vcgt","VideoCardGamma"],["view","ViewingConditions"],["vued","ViewingCondDesc"],["wtpt","MediaWhitePoint"]]);const St={"4d2p":"Erdt Systems",AAMA:"Aamazing Technologies",ACER:"Acer",ACLT:"Acolyte Color Research",ACTI:"Actix Sytems",ADAR:"Adara Technology",ADBE:"Adobe",ADI:"ADI Systems",AGFA:"Agfa Graphics",ALMD:"Alps Electric",ALPS:"Alps Electric",ALWN:"Alwan Color Expertise",AMTI:"Amiable Technologies",AOC:"AOC International",APAG:"Apago",APPL:"Apple Computer",AST:"AST","AT&T":"AT&T",BAEL:"BARBIERI electronic",BRCO:"Barco NV",BRKP:"Breakpoint",BROT:"Brother",BULL:"Bull",BUS:"Bus Computer Systems","C-IT":"C-Itoh",CAMR:"Intel",CANO:"Canon",CARR:"Carroll Touch",CASI:"Casio",CBUS:"Colorbus PL",CEL:"Crossfield",CELx:"Crossfield",CGS:"CGS Publishing Technologies International",CHM:"Rochester Robotics",CIGL:"Colour Imaging Group, London",CITI:"Citizen",CL00:"Candela",CLIQ:"Color IQ",CMCO:"Chromaco",CMiX:"CHROMiX",COLO:"Colorgraphic Communications",COMP:"Compaq",COMp:"Compeq/Focus Technology",CONR:"Conrac Display Products",CORD:"Cordata Technologies",CPQ:"Compaq",CPRO:"ColorPro",CRN:"Cornerstone",CTX:"CTX International",CVIS:"ColorVision",CWC:"Fujitsu Laboratories",DARI:"Darius Technology",DATA:"Dataproducts",DCP:"Dry Creek Photo",DCRC:"Digital Contents Resource Center, Chung-Ang University",DELL:"Dell Computer",DIC:"Dainippon Ink and Chemicals",DICO:"Diconix",DIGI:"Digital","DL&C":"Digital Light & Color",DPLG:"Doppelganger",DS:"Dainippon Screen",DSOL:"DOOSOL",DUPN:"DuPont",EPSO:"Epson",ESKO:"Esko-Graphics",ETRI:"Electronics and Telecommunications Research Institute",EVER:"Everex Systems",EXAC:"ExactCODE",Eizo:"Eizo",FALC:"Falco Data Products",FF:"Fuji Photo Film",FFEI:"FujiFilm Electronic Imaging",FNRD:"Fnord Software",FORA:"Fora",FORE:"Forefront Technology",FP:"Fujitsu",FPA:"WayTech Development",FUJI:"Fujitsu",FX:"Fuji Xerox",GCC:"GCC Technologies",GGSL:"Global Graphics Software",GMB:"Gretagmacbeth",GMG:"GMG",GOLD:"GoldStar Technology",GOOG:"Google",GPRT:"Giantprint",GTMB:"Gretagmacbeth",GVC:"WayTech Development",GW2K:"Sony",HCI:"HCI",HDM:"Heidelberger Druckmaschinen",HERM:"Hermes",HITA:"Hitachi America",HP:"Hewlett-Packard",HTC:"Hitachi",HiTi:"HiTi Digital",IBM:"IBM",IDNT:"Scitex",IEC:"Hewlett-Packard",IIYA:"Iiyama North America",IKEG:"Ikegami Electronics",IMAG:"Image Systems",IMI:"Ingram Micro",INTC:"Intel",INTL:"N/A (INTL)",INTR:"Intra Electronics",IOCO:"Iocomm International Technology",IPS:"InfoPrint Solutions Company",IRIS:"Scitex",ISL:"Ichikawa Soft Laboratory",ITNL:"N/A (ITNL)",IVM:"IVM",IWAT:"Iwatsu Electric",Idnt:"Scitex",Inca:"Inca Digital Printers",Iris:"Scitex",JPEG:"Joint Photographic Experts Group",JSFT:"Jetsoft Development",JVC:"JVC Information Products",KART:"Scitex",KFC:"KFC Computek Components",KLH:"KLH Computers",KMHD:"Konica Minolta",KNCA:"Konica",KODA:"Kodak",KYOC:"Kyocera",Kart:"Scitex",LCAG:"Leica",LCCD:"Leeds Colour",LDAK:"Left Dakota",LEAD:"Leading Technology",LEXM:"Lexmark International",LINK:"Link Computer",LINO:"Linotronic",LITE:"Lite-On",Leaf:"Leaf",Lino:"Linotronic",MAGC:"Mag Computronic",MAGI:"MAG Innovision",MANN:"Mannesmann",MICN:"Micron Technology",MICR:"Microtek",MICV:"Microvitec",MINO:"Minolta",MITS:"Mitsubishi Electronics America",MITs:"Mitsuba",MNLT:"Minolta",MODG:"Modgraph",MONI:"Monitronix",MONS:"Monaco Systems",MORS:"Morse Technology",MOTI:"Motive Systems",MSFT:"Microsoft",MUTO:"MUTOH INDUSTRIES",Mits:"Mitsubishi Electric",NANA:"NANAO",NEC:"NEC",NEXP:"NexPress Solutions",NISS:"Nissei Sangyo America",NKON:"Nikon",NONE:"none",OCE:"Oce Technologies",OCEC:"OceColor",OKI:"Oki",OKID:"Okidata",OKIP:"Okidata",OLIV:"Olivetti",OLYM:"Olympus",ONYX:"Onyx Graphics",OPTI:"Optiquest",PACK:"Packard Bell",PANA:"Matsushita Electric Industrial",PANT:"Pantone",PBN:"Packard Bell",PFU:"PFU",PHIL:"Philips Consumer Electronics",PNTX:"HOYA",POne:"Phase One A/S",PREM:"Premier Computer Innovations",PRIN:"Princeton Graphic Systems",PRIP:"Princeton Publishing Labs",QLUX:"Hong Kong",QMS:"QMS",QPCD:"QPcard AB",QUAD:"QuadLaser",QUME:"Qume",RADI:"Radius",RDDx:"Integrated Color Solutions",RDG:"Roland DG",REDM:"REDMS Group",RELI:"Relisys",RGMS:"Rolf Gierling Multitools",RICO:"Ricoh",RNLD:"Edmund Ronald",ROYA:"Royal",RPC:"Ricoh Printing Systems",RTL:"Royal Information Electronics",SAMP:"Sampo",SAMS:"Samsung",SANT:"Jaime Santana Pomares",SCIT:"Scitex",SCRN:"Dainippon Screen",SDP:"Scitex",SEC:"Samsung",SEIK:"Seiko Instruments",SEIk:"Seikosha",SGUY:"ScanGuy.com",SHAR:"Sharp Laboratories",SICC:"International Color Consortium",SONY:"Sony",SPCL:"SpectraCal",STAR:"Star",STC:"Sampo Technology",Scit:"Scitex",Sdp:"Scitex",Sony:"Sony",TALO:"Talon Technology",TAND:"Tandy",TATU:"Tatung",TAXA:"TAXAN America",TDS:"Tokyo Denshi Sekei",TECO:"TECO Information Systems",TEGR:"Tegra",TEKT:"Tektronix",TI:"Texas Instruments",TMKR:"TypeMaker",TOSB:"Toshiba",TOSH:"Toshiba",TOTK:"TOTOKU ELECTRIC",TRIU:"Triumph",TSBT:"Toshiba",TTX:"TTX Computer Products",TVM:"TVM Professional Monitor",TW:"TW Casper",ULSX:"Ulead Systems",UNIS:"Unisys",UTZF:"Utz Fehlau & Sohn",VARI:"Varityper",VIEW:"Viewsonic",VISL:"Visual communication",VIVO:"Vivo Mobile Communication",WANG:"Wang",WLBR:"Wilbur Imaging",WTG2:"Ware To Go",WYSE:"WYSE Technology",XERX:"Xerox",XRIT:"X-Rite",ZRAN:"Zoran",Zebr:"Zebra Technologies",appl:"Apple Computer",bICC:"basICColor",berg:"bergdesign",ceyd:"Integrated Color Solutions",clsp:"MacDermid ColorSpan",ds:"Dainippon Screen",dupn:"DuPont",ffei:"FujiFilm Electronic Imaging",flux:"FluxData",iris:"Scitex",kart:"Scitex",lcms:"Little CMS",lino:"Linotronic",none:"none",ob4d:"Erdt Systems",obic:"Medigraph",quby:"Qubyx Sarl",scit:"Scitex",scrn:"Dainippon Screen",sdp:"Scitex",siwi:"SIWI GRAFIKA",yxym:"YxyMaster"},Ct={scnr:"Scanner",mntr:"Monitor",prtr:"Printer",link:"Device Link",abst:"Abstract",spac:"Color Space Conversion Profile",nmcl:"Named Color",cenc:"ColorEncodingSpace profile",mid:"MultiplexIdentification profile",mlnk:"MultiplexLink profile",mvis:"MultiplexVisualization profile",nkpf:"Nikon Input Device Profile (NON-STANDARD!)"};U(B,"icc",[[4,St],[12,Ct],[40,Object.assign({},St,Ct)],[48,St],[80,St],[64,{0:"Perceptual",1:"Relative Colorimetric",2:"Saturation",3:"Absolute Colorimetric"}],["tech",{amd:"Active Matrix Display",crt:"Cathode Ray Tube Display",kpcd:"Photo CD",pmd:"Passive Matrix Display",dcam:"Digital Camera",dcpj:"Digital Cinema Projector",dmpc:"Digital Motion Picture Camera",dsub:"Dye Sublimation Printer",epho:"Electrophotographic Printer",esta:"Electrostatic Printer",flex:"Flexography",fprn:"Film Writer",fscn:"Film Scanner",grav:"Gravure",ijet:"Ink Jet Printer",imgs:"Photo Image Setter",mpfr:"Motion Picture Film Recorder",mpfs:"Motion Picture Film Scanner",offs:"Offset Lithography",pjtv:"Projection Television",rpho:"Photographic Paper Printer",rscn:"Reflective Scanner",silk:"Silkscreen",twax:"Thermal Wax Printer",vidc:"Video Camera",vidm:"Video Monitor"}]]);class yt extends re{static canHandle(e,t,i){return 237===e.getUint8(t+1)&&"Photoshop"===e.getString(t+4,9)&&void 0!==this.containsIptc8bim(e,t,i)}static headerLength(e,t,i){let n,s=this.containsIptc8bim(e,t,i);if(void 0!==s)return n=e.getUint8(t+s+7),n%2!=0&&(n+=1),0===n&&(n=4),s+8+n}static containsIptc8bim(e,t,i){for(let n=0;n<i;n++)if(this.isIptcSegmentHead(e,t+n))return n}static isIptcSegmentHead(e,t){return 56===e.getUint8(t)&&943868237===e.getUint32(t)&&1028===e.getUint16(t+4)}parse(){let{raw:e}=this,t=this.chunk.byteLength-1,i=!1;for(let n=0;n<t;n++)if(28===this.chunk.getUint8(n)&&2===this.chunk.getUint8(n+1)){i=!0;let t=this.chunk.getUint16(n+3),s=this.chunk.getUint8(n+2),r=this.chunk.getLatin1String(n+5,t);e.set(s,this.pluralizeValue(e.get(s),r)),n+=4+t}else if(i)break;return this.translate(),this.output}pluralizeValue(e,t){return void 0!==e?e instanceof Array?(e.push(t),e):[e,t]:t}}c(yt,"type","iptc"),c(yt,"translateValues",!1),c(yt,"reviveValues",!1),T.set("iptc",yt),U(E,"iptc",[[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"]]),U(B,"iptc",[[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"}]]);/* harmony default export */ const full_esm = (tt);
|
|
11208
10547
|
|
|
11209
|
-
// EXTERNAL MODULE: ./node_modules/exif-js/exif.js
|
|
11210
|
-
var exif = __webpack_require__(335);
|
|
11211
|
-
var exif_default = /*#__PURE__*/__webpack_require__.n(exif);
|
|
11212
10548
|
;// ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
|
11213
10549
|
function _classCallCheck(a, n) {
|
|
11214
10550
|
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
@@ -11358,7 +10694,7 @@ function transformCoordinate(canvas, ctx, width, height, orientation) {
|
|
|
11358
10694
|
break;
|
|
11359
10695
|
}
|
|
11360
10696
|
}
|
|
11361
|
-
var
|
|
10697
|
+
var MegaPixImage_URL = window.URL && window.URL.createObjectURL ? window.URL : window.webkitURL && window.webkitURL.createObjectURL ? window.webkitURL : null;
|
|
11362
10698
|
|
|
11363
10699
|
// -------------------------
|
|
11364
10700
|
// MegaPixImage class
|
|
@@ -11367,9 +10703,9 @@ var MegaPixImage = /*#__PURE__*/function () {
|
|
|
11367
10703
|
function MegaPixImage(srcImage) {
|
|
11368
10704
|
_classCallCheck(this, MegaPixImage);
|
|
11369
10705
|
if (window.Blob && srcImage instanceof Blob) {
|
|
11370
|
-
if (!
|
|
10706
|
+
if (!MegaPixImage_URL) throw Error("No createObjectURL function found");
|
|
11371
10707
|
var img = new Image();
|
|
11372
|
-
img.src =
|
|
10708
|
+
img.src = MegaPixImage_URL.createObjectURL(srcImage);
|
|
11373
10709
|
this.blob = srcImage;
|
|
11374
10710
|
srcImage = img;
|
|
11375
10711
|
}
|
|
@@ -11428,7 +10764,7 @@ var MegaPixImage = /*#__PURE__*/function () {
|
|
|
11428
10764
|
if (callback) callback();
|
|
11429
10765
|
if (this.blob) {
|
|
11430
10766
|
this.blob = null;
|
|
11431
|
-
|
|
10767
|
+
MegaPixImage_URL.revokeObjectURL(this.srcImage.src);
|
|
11432
10768
|
}
|
|
11433
10769
|
}
|
|
11434
10770
|
}]);
|
|
@@ -11438,9 +10774,12 @@ var MegaPixImage = /*#__PURE__*/function () {
|
|
|
11438
10774
|
/* harmony default export */ const lib_MegaPixImage = (MegaPixImage);
|
|
11439
10775
|
;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/upload/upload.vue?vue&type=script&lang=js
|
|
11440
10776
|
|
|
10777
|
+
|
|
10778
|
+
// import EXIF from '../../lib/exif-js'
|
|
11441
10779
|
// import MegaPixImage from '../../lib/MegaPixImage'
|
|
11442
10780
|
|
|
11443
10781
|
|
|
10782
|
+
|
|
11444
10783
|
var uploadvue_type_script_lang_js_prefixCls = 'dpzvc-upload';
|
|
11445
10784
|
/* harmony default export */ const uploadvue_type_script_lang_js = ({
|
|
11446
10785
|
props: {
|
|
@@ -11479,31 +10818,109 @@ var uploadvue_type_script_lang_js_prefixCls = 'dpzvc-upload';
|
|
|
11479
10818
|
},
|
|
11480
10819
|
methods: {
|
|
11481
10820
|
showPhoto: function showPhoto(e) {
|
|
11482
|
-
this
|
|
11483
|
-
|
|
11484
|
-
|
|
11485
|
-
|
|
11486
|
-
|
|
11487
|
-
|
|
11488
|
-
|
|
11489
|
-
|
|
11490
|
-
|
|
11491
|
-
|
|
11492
|
-
|
|
11493
|
-
|
|
11494
|
-
|
|
11495
|
-
|
|
11496
|
-
|
|
11497
|
-
|
|
11498
|
-
|
|
11499
|
-
|
|
11500
|
-
|
|
11501
|
-
|
|
11502
|
-
|
|
11503
|
-
|
|
11504
|
-
|
|
11505
|
-
|
|
11506
|
-
|
|
10821
|
+
var _this2 = this;
|
|
10822
|
+
return _asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee() {
|
|
10823
|
+
var fileList, _loop, i;
|
|
10824
|
+
return regenerator_default().wrap(function (_context2) {
|
|
10825
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
10826
|
+
case 0:
|
|
10827
|
+
_this2.$Indicator.snake({
|
|
10828
|
+
text: '上传中'
|
|
10829
|
+
});
|
|
10830
|
+
_this2.files = [];
|
|
10831
|
+
fileList = e.target.files;
|
|
10832
|
+
_this2.fileLength = fileList.length;
|
|
10833
|
+
_loop = /*#__PURE__*/regenerator_default().mark(function _loop() {
|
|
10834
|
+
var file, Orientation, dataURL, img, _t;
|
|
10835
|
+
return regenerator_default().wrap(function (_context) {
|
|
10836
|
+
while (1) switch (_context.prev = _context.next) {
|
|
10837
|
+
case 0:
|
|
10838
|
+
file = fileList[i];
|
|
10839
|
+
_context.prev = 1;
|
|
10840
|
+
_context.next = 2;
|
|
10841
|
+
return full_esm.orientation(file);
|
|
10842
|
+
case 2:
|
|
10843
|
+
Orientation = _context.sent;
|
|
10844
|
+
_context.next = 3;
|
|
10845
|
+
return new Promise(function (resolve, reject) {
|
|
10846
|
+
var reader = new FileReader();
|
|
10847
|
+
reader.readAsDataURL(file);
|
|
10848
|
+
reader.onload = function () {
|
|
10849
|
+
return resolve(reader.result);
|
|
10850
|
+
};
|
|
10851
|
+
reader.onerror = function (err) {
|
|
10852
|
+
return reject(err);
|
|
10853
|
+
};
|
|
10854
|
+
});
|
|
10855
|
+
case 3:
|
|
10856
|
+
dataURL = _context.sent;
|
|
10857
|
+
img = new Image();
|
|
10858
|
+
img.src = dataURL;
|
|
10859
|
+
_context.next = 4;
|
|
10860
|
+
return new Promise(function (resolve) {
|
|
10861
|
+
img.onload = function () {
|
|
10862
|
+
// 调用你原来的 create 方法
|
|
10863
|
+
_this2.create(img, Orientation);
|
|
10864
|
+
resolve();
|
|
10865
|
+
};
|
|
10866
|
+
});
|
|
10867
|
+
case 4:
|
|
10868
|
+
_context.next = 6;
|
|
10869
|
+
break;
|
|
10870
|
+
case 5:
|
|
10871
|
+
_context.prev = 5;
|
|
10872
|
+
_t = _context["catch"](1);
|
|
10873
|
+
console.error('读取图片或 EXIF 失败', _t);
|
|
10874
|
+
case 6:
|
|
10875
|
+
case "end":
|
|
10876
|
+
return _context.stop();
|
|
10877
|
+
}
|
|
10878
|
+
}, _loop, null, [[1, 5]]);
|
|
10879
|
+
});
|
|
10880
|
+
i = 0;
|
|
10881
|
+
case 1:
|
|
10882
|
+
if (!(i < fileList.length)) {
|
|
10883
|
+
_context2.next = 3;
|
|
10884
|
+
break;
|
|
10885
|
+
}
|
|
10886
|
+
return _context2.delegateYield(_loop(), "t0", 2);
|
|
10887
|
+
case 2:
|
|
10888
|
+
i++;
|
|
10889
|
+
_context2.next = 1;
|
|
10890
|
+
break;
|
|
10891
|
+
case 3:
|
|
10892
|
+
e.target.value = ''; // 清空选择框
|
|
10893
|
+
case 4:
|
|
10894
|
+
case "end":
|
|
10895
|
+
return _context2.stop();
|
|
10896
|
+
}
|
|
10897
|
+
}, _callee);
|
|
10898
|
+
}))();
|
|
10899
|
+
},
|
|
10900
|
+
// showPhoto1(e){
|
|
10901
|
+
// this.$Indicator.snake({text:'上传中'});
|
|
10902
|
+
// this.files = [];
|
|
10903
|
+
// let file = e.target.files;
|
|
10904
|
+
// this.fileLength = file.length;
|
|
10905
|
+
// let that = this;
|
|
10906
|
+
// let Orientation = null;
|
|
10907
|
+
// for (let i = 0; i < file.length; i++) {
|
|
10908
|
+
// EXIF.getData(file[i], function () {
|
|
10909
|
+
// EXIF.getAllTags(this);
|
|
10910
|
+
// Orientation = EXIF.getTag(this, 'Orientation');
|
|
10911
|
+
// });
|
|
10912
|
+
// let reader = new FileReader();
|
|
10913
|
+
// reader.readAsDataURL(file[i]);
|
|
10914
|
+
// reader.onload = function (e) {
|
|
10915
|
+
// let img = new Image();
|
|
10916
|
+
// img.src = e.target.result;
|
|
10917
|
+
// img.onload = function (e) {
|
|
10918
|
+
// that.create(img, Orientation);
|
|
10919
|
+
// }
|
|
10920
|
+
// };
|
|
10921
|
+
// }
|
|
10922
|
+
// e.target.value = '';
|
|
10923
|
+
// },
|
|
11507
10924
|
create: function create(file, Orientation) {
|
|
11508
10925
|
var _this = this;
|
|
11509
10926
|
var data = null;
|
|
@@ -11615,8 +11032,8 @@ var uploadvue_type_script_lang_js_prefixCls = 'dpzvc-upload';
|
|
|
11615
11032
|
;
|
|
11616
11033
|
var upload_component = normalizeComponent(
|
|
11617
11034
|
upload_uploadvue_type_script_lang_js,
|
|
11618
|
-
|
|
11619
|
-
|
|
11035
|
+
uploadvue_type_template_id_78cd64fe_render,
|
|
11036
|
+
uploadvue_type_template_id_78cd64fe_staticRenderFns,
|
|
11620
11037
|
false,
|
|
11621
11038
|
null,
|
|
11622
11039
|
null,
|