PK wNB', , README.mdnu W+A # JavaScript Load Image
> A JavaScript library to load and transform image files.
## Table of contents
- [Demo](#demo)
- [Description](#description)
- [Setup](#setup)
- [Usage](#usage)
- [Image loading](#image-loading)
- [Image scaling](#image-scaling)
- [Requirements](#requirements)
- [API](#api)
- [Options](#options)
- [Meta data parsing](#meta-data-parsing)
- [Exif parser](#exif-parser)
- [License](#license)
- [Credits](#credits)
## Demo
[JavaScript Load Image Demo](https://blueimp.github.io/JavaScript-Load-Image/)
## Description
JavaScript Load Image is a library to load images provided as File or Blob
objects or via URL.
It returns an optionally scaled and/or cropped HTML img or canvas element via an
asynchronous callback.
It also provides a method to parse image meta data to extract Exif tags and
thumbnails and to restore the complete image header after resizing.
## Setup
Include the (combined and minified) JavaScript Load Image script in your HTML
markup:
```html
```
Or alternatively, choose which components you want to include:
```html
```
## Usage
### Image loading
In your application code, use the **loadImage()** function like this:
```js
document.getElementById('file-input').onchange = function (e) {
loadImage(
e.target.files[0],
function (img) {
document.body.appendChild(img);
},
{maxWidth: 600} // Options
);
};
```
### Image scaling
It is also possible to use the image scaling functionality with an existing
image:
```js
var scaledImage = loadImage.scale(
img, // img or canvas element
{maxWidth: 600}
);
```
## Requirements
The JavaScript Load Image library has zero dependencies.
However, JavaScript Load Image is a very suitable complement to the
[Canvas to Blob](https://github.com/blueimp/JavaScript-Canvas-to-Blob) library.
## API
The **loadImage()** function accepts a
[File](https://developer.mozilla.org/en/DOM/File) or
[Blob](https://developer.mozilla.org/en/DOM/Blob) object or a simple image URL
(e.g. `'https://example.org/image.png'`) as first argument.
If a [File](https://developer.mozilla.org/en/DOM/File) or
[Blob](https://developer.mozilla.org/en/DOM/Blob) is passed as parameter, it
returns a HTML **img** element if the browser supports the
[URL](https://developer.mozilla.org/en/DOM/window.URL) API or a
[FileReader](https://developer.mozilla.org/en/DOM/FileReader) object if
supported, or **false**.
It always returns a HTML
[img](https://developer.mozilla.org/en/docs/HTML/Element/Img) element when
passing an image URL:
```js
document.getElementById('file-input').onchange = function (e) {
var loadingImage = loadImage(
e.target.files[0],
function (img) {
document.body.appendChild(img);
},
{maxWidth: 600}
);
if (!loadingImage) {
// Alternative code ...
}
};
```
The **img** element or
[FileReader](https://developer.mozilla.org/en/DOM/FileReader) object returned by
the **loadImage()** function allows to abort the loading process by setting the
**onload** and **onerror** event handlers to null:
```js
document.getElementById('file-input').onchange = function (e) {
var loadingImage = loadImage(
e.target.files[0],
function (img) {
document.body.appendChild(img);
},
{maxWidth: 600}
);
loadingImage.onload = loadingImage.onerror = null;
};
```
The second argument must be a **callback** function, which is called when the
image has been loaded or an error occurred while loading the image. The callback
function is passed one argument, which is either a HTML **img** element, a
[canvas](https://developer.mozilla.org/en/HTML/Canvas) element, or an
[Event](https://developer.mozilla.org/en/DOM/event) object of type **error**:
```js
var imageUrl = "https://example.org/image.png";
loadImage(
imageUrl,
function (img) {
if(img.type === "error") {
console.log("Error loading image " + imageUrl);
} else {
document.body.appendChild(img);
}
},
{maxWidth: 600}
);
```
## Options
The optional third argument to **loadImage()** is a map of options:
* **maxWidth**: Defines the maximum width of the img/canvas element.
* **maxHeight**: Defines the maximum height of the img/canvas element.
* **minWidth**: Defines the minimum width of the img/canvas element.
* **minHeight**: Defines the minimum height of the img/canvas element.
* **sourceWidth**: The width of the sub-rectangle of the source image to draw
into the destination canvas.
Defaults to the source image width and requires `canvas: true`.
* **sourceHeight**: The height of the sub-rectangle of the source image to draw
into the destination canvas.
Defaults to the source image height and requires `canvas: true`.
* **top**: The top margin of the sub-rectangle of the source image.
Defaults to `0` and requires `canvas: true`.
* **right**: The right margin of the sub-rectangle of the source image.
Defaults to `0` and requires `canvas: true`.
* **bottom**: The bottom margin of the sub-rectangle of the source image.
Defaults to `0` and requires `canvas: true`.
* **left**: The left margin of the sub-rectangle of the source image.
Defaults to `0` and requires `canvas: true`.
* **contain**: Scales the image up/down to contain it in the max dimensions if
set to `true`.
This emulates the CSS feature
[background-image: contain](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Scaling_background_images#contain).
* **cover**: Scales the image up/down to cover the max dimensions with the image
dimensions if set to `true`.
This emulates the CSS feature
[background-image: cover](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Scaling_background_images#cover).
* **aspectRatio**: Crops the image to the given aspect ratio (e.g. `16/9`).
Setting the `aspectRatio` also enables the `crop` option.
* **pixelRatio**: Defines the ratio of the canvas pixels to the physical image
pixels on the screen.
Should be set to `window.devicePixelRatio` unless the scaled image is not
rendered on screen.
Defaults to `1` and requires `canvas: true`.
* **downsamplingRatio**: Defines the ratio in which the image is downsampled.
By default, images are downsampled in one step. With a ratio of `0.5`, each step
scales the image to half the size, before reaching the target dimensions.
Requires `canvas: true`.
* **crop**: Crops the image to the maxWidth/maxHeight constraints if set to
`true`.
Enabling the `crop` option also enables the `canvas` option.
* **orientation**: Transform the canvas according to the specified Exif
orientation, which can be an `integer` in the range of `1` to `8` or the boolean
value `true`.
When set to `true`, it will set the orientation value based on the EXIF data of
the image, which will be parsed automatically if the exif library is available.
Setting the `orientation` also enables the `canvas` option.
Setting `orientation` to `true` also enables the `meta` option.
* **meta**: Automatically parses the image meta data if set to `true`.
The meta data is passed to the callback as second argument.
If the file is given as URL and the browser supports the
[fetch API](https://developer.mozilla.org/en/docs/Web/API/Fetch_API), fetches
the file as Blob to be able to parse the meta data.
* **canvas**: Returns the image as
[canvas](https://developer.mozilla.org/en/HTML/Canvas) element if set to `true`.
* **crossOrigin**: Sets the crossOrigin property on the img element for loading
[CORS enabled images](https://developer.mozilla.org/en-US/docs/HTML/CORS_Enabled_Image).
* **noRevoke**: By default, the
[created object URL](https://developer.mozilla.org/en/DOM/window.URL.createObjectURL)
is revoked after the image has been loaded, except when this option is set to
`true`.
They can be used the following way:
```js
loadImage(
fileOrBlobOrUrl,
function (img) {
document.body.appendChild(img);
},
{
maxWidth: 600,
maxHeight: 300,
minWidth: 100,
minHeight: 50,
canvas: true
}
);
```
All settings are optional. By default, the image is returned as HTML **img**
element without any image size restrictions.
## Meta data parsing
If the Load Image Meta extension is included, it is also possible to parse image
meta data.
The extension provides the method **loadImage.parseMetaData**, which can be used
the following way:
```js
loadImage.parseMetaData(
fileOrBlob,
function (data) {
if (!data.imageHead) {
return;
}
// Combine data.imageHead with the image body of a resized file
// to create scaled images with the original image meta data, e.g.:
var blob = new Blob([
data.imageHead,
// Resized images always have a head size of 20 bytes,
// including the JPEG marker and a minimal JFIF header:
loadImage.blobSlice.call(resizedImage, 20)
], {type: resizedImage.type});
},
{
maxMetaDataSize: 262144,
disableImageHead: false
}
);
```
The third argument is an options object which defines the maximum number of
bytes to parse for the image meta data, allows to disable the imageHead creation
and is also passed along to segment parsers registered via loadImage extensions,
e.g. the Exif parser.
**Note:**
Blob objects of resized images can be created via
[canvas.toBlob()](https://github.com/blueimp/JavaScript-Canvas-to-Blob).
### Exif parser
If you include the Load Image Exif Parser extension, the argument passed to the
callback for **parseMetaData** will contain the additional property **exif** if
Exif data could be found in the given image.
The **exif** object stores the parsed Exif tags:
```js
var orientation = data.exif[0x0112];
```
It also provides an **exif.get()** method to retrieve the tag value via the
tag's mapped name:
```js
var orientation = data.exif.get('Orientation');
```
By default, the only available mapped names are **Orientation** and
**Thumbnail**.
If you also include the Load Image Exif Map library, additional tag mappings
become available, as well as two additional methods, **exif.getText()** and
**exif.getAll()**:
```js
var flashText = data.exif.getText('Flash'); // e.g.: 'Flash fired, auto mode',
// A map of all parsed tags with their mapped names as keys and their text values:
var allTags = data.exif.getAll();
```
The Exif parser also adds additional options for the parseMetaData method, to
disable certain aspects of the parser:
* **disableExif**: Disables Exif parsing.
* **disableExifThumbnail**: Disables parsing of the Exif Thumbnail.
* **disableExifSub**: Disables parsing of the Exif Sub IFD.
* **disableExifGps**: Disables parsing of the Exif GPS Info IFD.
## License
The JavaScript Load Image script is released under the
[MIT license](https://opensource.org/licenses/MIT).
## Credits
* Image meta data handling implementation based on the help and contribution of
Achim Stöhr.
* Exif tags mapping based on Jacob Seidelin's
[exif-js](https://github.com/jseidelin/exif-js).
PK wNwr js/load-image-scale.jsnu W+A /*
* JavaScript Load Image Scaling
* https://github.com/blueimp/JavaScript-Load-Image
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*/
/* global define */
;(function (factory) {
'use strict'
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['./load-image'], factory)
} else if (typeof module === 'object' && module.exports) {
factory(require('./load-image'))
} else {
// Browser globals:
factory(window.loadImage)
}
}(function (loadImage) {
'use strict'
var originalTransform = loadImage.transform
loadImage.transform = function (img, options, callback, file, data) {
originalTransform.call(
loadImage,
loadImage.scale(img, options, data),
options,
callback,
file,
data
)
}
// Transform image coordinates, allows to override e.g.
// the canvas orientation based on the orientation option,
// gets canvas, options passed as arguments:
loadImage.transformCoordinates = function () {
return
}
// Returns transformed options, allows to override e.g.
// maxWidth, maxHeight and crop options based on the aspectRatio.
// gets img, options passed as arguments:
loadImage.getTransformedOptions = function (img, options) {
var aspectRatio = options.aspectRatio
var newOptions
var i
var width
var height
if (!aspectRatio) {
return options
}
newOptions = {}
for (i in options) {
if (options.hasOwnProperty(i)) {
newOptions[i] = options[i]
}
}
newOptions.crop = true
width = img.naturalWidth || img.width
height = img.naturalHeight || img.height
if (width / height > aspectRatio) {
newOptions.maxWidth = height * aspectRatio
newOptions.maxHeight = height
} else {
newOptions.maxWidth = width
newOptions.maxHeight = width / aspectRatio
}
return newOptions
}
// Canvas render method, allows to implement a different rendering algorithm:
loadImage.renderImageToCanvas = function (
canvas,
img,
sourceX,
sourceY,
sourceWidth,
sourceHeight,
destX,
destY,
destWidth,
destHeight
) {
canvas.getContext('2d').drawImage(
img,
sourceX,
sourceY,
sourceWidth,
sourceHeight,
destX,
destY,
destWidth,
destHeight
)
return canvas
}
// Determines if the target image should be a canvas element:
loadImage.hasCanvasOption = function (options) {
return options.canvas || options.crop || !!options.aspectRatio
}
// Scales and/or crops the given image (img or canvas HTML element)
// using the given options.
// Returns a canvas object if the browser supports canvas
// and the hasCanvasOption method returns true or a canvas
// object is passed as image, else the scaled image:
loadImage.scale = function (img, options, data) {
options = options || {}
var canvas = document.createElement('canvas')
var useCanvas = img.getContext ||
(loadImage.hasCanvasOption(options) && canvas.getContext)
var width = img.naturalWidth || img.width
var height = img.naturalHeight || img.height
var destWidth = width
var destHeight = height
var maxWidth
var maxHeight
var minWidth
var minHeight
var sourceWidth
var sourceHeight
var sourceX
var sourceY
var pixelRatio
var downsamplingRatio
var tmp
function scaleUp () {
var scale = Math.max(
(minWidth || destWidth) / destWidth,
(minHeight || destHeight) / destHeight
)
if (scale > 1) {
destWidth *= scale
destHeight *= scale
}
}
function scaleDown () {
var scale = Math.min(
(maxWidth || destWidth) / destWidth,
(maxHeight || destHeight) / destHeight
)
if (scale < 1) {
destWidth *= scale
destHeight *= scale
}
}
if (useCanvas) {
options = loadImage.getTransformedOptions(img, options, data)
sourceX = options.left || 0
sourceY = options.top || 0
if (options.sourceWidth) {
sourceWidth = options.sourceWidth
if (options.right !== undefined && options.left === undefined) {
sourceX = width - sourceWidth - options.right
}
} else {
sourceWidth = width - sourceX - (options.right || 0)
}
if (options.sourceHeight) {
sourceHeight = options.sourceHeight
if (options.bottom !== undefined && options.top === undefined) {
sourceY = height - sourceHeight - options.bottom
}
} else {
sourceHeight = height - sourceY - (options.bottom || 0)
}
destWidth = sourceWidth
destHeight = sourceHeight
}
maxWidth = options.maxWidth
maxHeight = options.maxHeight
minWidth = options.minWidth
minHeight = options.minHeight
if (useCanvas && maxWidth && maxHeight && options.crop) {
destWidth = maxWidth
destHeight = maxHeight
tmp = sourceWidth / sourceHeight - maxWidth / maxHeight
if (tmp < 0) {
sourceHeight = maxHeight * sourceWidth / maxWidth
if (options.top === undefined && options.bottom === undefined) {
sourceY = (height - sourceHeight) / 2
}
} else if (tmp > 0) {
sourceWidth = maxWidth * sourceHeight / maxHeight
if (options.left === undefined && options.right === undefined) {
sourceX = (width - sourceWidth) / 2
}
}
} else {
if (options.contain || options.cover) {
minWidth = maxWidth = maxWidth || minWidth
minHeight = maxHeight = maxHeight || minHeight
}
if (options.cover) {
scaleDown()
scaleUp()
} else {
scaleUp()
scaleDown()
}
}
if (useCanvas) {
pixelRatio = options.pixelRatio
if (pixelRatio > 1) {
canvas.style.width = destWidth + 'px'
canvas.style.height = destHeight + 'px'
destWidth *= pixelRatio
destHeight *= pixelRatio
canvas.getContext('2d').scale(pixelRatio, pixelRatio)
}
downsamplingRatio = options.downsamplingRatio
if (downsamplingRatio > 0 && downsamplingRatio < 1 &&
destWidth < sourceWidth && destHeight < sourceHeight) {
while (sourceWidth * downsamplingRatio > destWidth) {
canvas.width = sourceWidth * downsamplingRatio
canvas.height = sourceHeight * downsamplingRatio
loadImage.renderImageToCanvas(
canvas,
img,
sourceX,
sourceY,
sourceWidth,
sourceHeight,
0,
0,
canvas.width,
canvas.height
)
sourceX = 0
sourceY = 0
sourceWidth = canvas.width
sourceHeight = canvas.height
img = document.createElement('canvas')
img.width = sourceWidth
img.height = sourceHeight
loadImage.renderImageToCanvas(
img,
canvas,
0,
0,
sourceWidth,
sourceHeight,
0,
0,
sourceWidth,
sourceHeight
)
}
}
canvas.width = destWidth
canvas.height = destHeight
loadImage.transformCoordinates(
canvas,
options
)
return loadImage.renderImageToCanvas(
canvas,
img,
sourceX,
sourceY,
sourceWidth,
sourceHeight,
0,
0,
destWidth,
destHeight
)
}
img.width = destWidth
img.height = destHeight
return img
}
}))
PK wNj!2M M js/load-image.jsnu W+A /*
* JavaScript Load Image
* https://github.com/blueimp/JavaScript-Load-Image
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*/
/* global define, URL, webkitURL, FileReader */
;(function ($) {
'use strict'
// Loads an image for a given File object.
// Invokes the callback with an img or optional canvas
// element (if supported by the browser) as parameter:
function loadImage (file, callback, options) {
var img = document.createElement('img')
var url
img.onerror = function (event) {
return loadImage.onerror(img, event, file, callback, options)
}
img.onload = function (event) {
return loadImage.onload(img, event, file, callback, options)
}
if (typeof file === 'string') {
loadImage.fetchBlob(file, function (blob) {
if (blob) {
file = blob
url = loadImage.createObjectURL(file)
} else {
url = file
if (options && options.crossOrigin) {
img.crossOrigin = options.crossOrigin
}
}
img.src = url
}, options)
return img
} else if (loadImage.isInstanceOf('Blob', file) ||
// Files are also Blob instances, but some browsers
// (Firefox 3.6) support the File API but not Blobs:
loadImage.isInstanceOf('File', file)) {
url = img._objectURL = loadImage.createObjectURL(file)
if (url) {
img.src = url
return img
}
return loadImage.readFile(file, function (e) {
var target = e.target
if (target && target.result) {
img.src = target.result
} else if (callback) {
callback(e)
}
})
}
}
// The check for URL.revokeObjectURL fixes an issue with Opera 12,
// which provides URL.createObjectURL but doesn't properly implement it:
var urlAPI = (window.createObjectURL && window) ||
(window.URL && URL.revokeObjectURL && URL) ||
(window.webkitURL && webkitURL)
function revokeHelper (img, options) {
if (img._objectURL && !(options && options.noRevoke)) {
loadImage.revokeObjectURL(img._objectURL)
delete img._objectURL
}
}
// If the callback given to this function returns a blob, it is used as image
// source instead of the original url and overrides the file argument used in
// the onload and onerror event callbacks:
loadImage.fetchBlob = function (url, callback, options) {
callback()
}
loadImage.isInstanceOf = function (type, obj) {
// Cross-frame instanceof check
return Object.prototype.toString.call(obj) === '[object ' + type + ']'
}
loadImage.transform = function (img, options, callback, file, data) {
callback(img, data)
}
loadImage.onerror = function (img, event, file, callback, options) {
revokeHelper(img, options)
if (callback) {
callback.call(img, event)
}
}
loadImage.onload = function (img, event, file, callback, options) {
revokeHelper(img, options)
if (callback) {
loadImage.transform(img, options, callback, file, {})
}
}
loadImage.createObjectURL = function (file) {
return urlAPI ? urlAPI.createObjectURL(file) : false
}
loadImage.revokeObjectURL = function (url) {
return urlAPI ? urlAPI.revokeObjectURL(url) : false
}
// Loads a given File object via FileReader interface,
// invokes the callback with the event object (load or error).
// The result can be read via event.target.result:
loadImage.readFile = function (file, callback, method) {
if (window.FileReader) {
var fileReader = new FileReader()
fileReader.onload = fileReader.onerror = callback
method = method || 'readAsDataURL'
if (fileReader[method]) {
fileReader[method](file)
return fileReader
}
}
return false
}
if (typeof define === 'function' && define.amd) {
define(function () {
return loadImage
})
} else if (typeof module === 'object' && module.exports) {
module.exports = loadImage
} else {
$.loadImage = loadImage
}
}(window))
PK wNK" js/index.jsnu W+A module.exports = require('./load-image')
require('./load-image-scale')
require('./load-image-meta')
require('./load-image-fetch')
require('./load-image-exif')
require('./load-image-exif-map')
require('./load-image-orientation')
PK wN]FJN1 N1 js/load-image-exif-map.jsnu W+A /*
* JavaScript Load Image Exif Map
* https://github.com/blueimp/JavaScript-Load-Image
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Exif tags mapping based on
* https://github.com/jseidelin/exif-js
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*/
/* global define */
;(function (factory) {
'use strict'
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['./load-image', './load-image-exif'], factory)
} else if (typeof module === 'object' && module.exports) {
factory(require('./load-image'), require('./load-image-exif'))
} else {
// Browser globals:
factory(window.loadImage)
}
}(function (loadImage) {
'use strict'
loadImage.ExifMap.prototype.tags = {
// =================
// TIFF tags (IFD0):
// =================
0x0100: 'ImageWidth',
0x0101: 'ImageHeight',
0x8769: 'ExifIFDPointer',
0x8825: 'GPSInfoIFDPointer',
0xA005: 'InteroperabilityIFDPointer',
0x0102: 'BitsPerSample',
0x0103: 'Compression',
0x0106: 'PhotometricInterpretation',
0x0112: 'Orientation',
0x0115: 'SamplesPerPixel',
0x011C: 'PlanarConfiguration',
0x0212: 'YCbCrSubSampling',
0x0213: 'YCbCrPositioning',
0x011A: 'XResolution',
0x011B: 'YResolution',
0x0128: 'ResolutionUnit',
0x0111: 'StripOffsets',
0x0116: 'RowsPerStrip',
0x0117: 'StripByteCounts',
0x0201: 'JPEGInterchangeFormat',
0x0202: 'JPEGInterchangeFormatLength',
0x012D: 'TransferFunction',
0x013E: 'WhitePoint',
0x013F: 'PrimaryChromaticities',
0x0211: 'YCbCrCoefficients',
0x0214: 'ReferenceBlackWhite',
0x0132: 'DateTime',
0x010E: 'ImageDescription',
0x010F: 'Make',
0x0110: 'Model',
0x0131: 'Software',
0x013B: 'Artist',
0x8298: 'Copyright',
// ==================
// Exif Sub IFD tags:
// ==================
0x9000: 'ExifVersion', // EXIF version
0xA000: 'FlashpixVersion', // Flashpix format version
0xA001: 'ColorSpace', // Color space information tag
0xA002: 'PixelXDimension', // Valid width of meaningful image
0xA003: 'PixelYDimension', // Valid height of meaningful image
0xA500: 'Gamma',
0x9101: 'ComponentsConfiguration', // Information about channels
0x9102: 'CompressedBitsPerPixel', // Compressed bits per pixel
0x927C: 'MakerNote', // Any desired information written by the manufacturer
0x9286: 'UserComment', // Comments by user
0xA004: 'RelatedSoundFile', // Name of related sound file
0x9003: 'DateTimeOriginal', // Date and time when the original image was generated
0x9004: 'DateTimeDigitized', // Date and time when the image was stored digitally
0x9290: 'SubSecTime', // Fractions of seconds for DateTime
0x9291: 'SubSecTimeOriginal', // Fractions of seconds for DateTimeOriginal
0x9292: 'SubSecTimeDigitized', // Fractions of seconds for DateTimeDigitized
0x829A: 'ExposureTime', // Exposure time (in seconds)
0x829D: 'FNumber',
0x8822: 'ExposureProgram', // Exposure program
0x8824: 'SpectralSensitivity', // Spectral sensitivity
0x8827: 'PhotographicSensitivity', // EXIF 2.3, ISOSpeedRatings in EXIF 2.2
0x8828: 'OECF', // Optoelectric conversion factor
0x8830: 'SensitivityType',
0x8831: 'StandardOutputSensitivity',
0x8832: 'RecommendedExposureIndex',
0x8833: 'ISOSpeed',
0x8834: 'ISOSpeedLatitudeyyy',
0x8835: 'ISOSpeedLatitudezzz',
0x9201: 'ShutterSpeedValue', // Shutter speed
0x9202: 'ApertureValue', // Lens aperture
0x9203: 'BrightnessValue', // Value of brightness
0x9204: 'ExposureBias', // Exposure bias
0x9205: 'MaxApertureValue', // Smallest F number of lens
0x9206: 'SubjectDistance', // Distance to subject in meters
0x9207: 'MeteringMode', // Metering mode
0x9208: 'LightSource', // Kind of light source
0x9209: 'Flash', // Flash status
0x9214: 'SubjectArea', // Location and area of main subject
0x920A: 'FocalLength', // Focal length of the lens in mm
0xA20B: 'FlashEnergy', // Strobe energy in BCPS
0xA20C: 'SpatialFrequencyResponse',
0xA20E: 'FocalPlaneXResolution', // Number of pixels in width direction per FPRUnit
0xA20F: 'FocalPlaneYResolution', // Number of pixels in height direction per FPRUnit
0xA210: 'FocalPlaneResolutionUnit', // Unit for measuring the focal plane resolution
0xA214: 'SubjectLocation', // Location of subject in image
0xA215: 'ExposureIndex', // Exposure index selected on camera
0xA217: 'SensingMethod', // Image sensor type
0xA300: 'FileSource', // Image source (3 == DSC)
0xA301: 'SceneType', // Scene type (1 == directly photographed)
0xA302: 'CFAPattern', // Color filter array geometric pattern
0xA401: 'CustomRendered', // Special processing
0xA402: 'ExposureMode', // Exposure mode
0xA403: 'WhiteBalance', // 1 = auto white balance, 2 = manual
0xA404: 'DigitalZoomRatio', // Digital zoom ratio
0xA405: 'FocalLengthIn35mmFilm',
0xA406: 'SceneCaptureType', // Type of scene
0xA407: 'GainControl', // Degree of overall image gain adjustment
0xA408: 'Contrast', // Direction of contrast processing applied by camera
0xA409: 'Saturation', // Direction of saturation processing applied by camera
0xA40A: 'Sharpness', // Direction of sharpness processing applied by camera
0xA40B: 'DeviceSettingDescription',
0xA40C: 'SubjectDistanceRange', // Distance to subject
0xA420: 'ImageUniqueID', // Identifier assigned uniquely to each image
0xA430: 'CameraOwnerName',
0xA431: 'BodySerialNumber',
0xA432: 'LensSpecification',
0xA433: 'LensMake',
0xA434: 'LensModel',
0xA435: 'LensSerialNumber',
// ==============
// GPS Info tags:
// ==============
0x0000: 'GPSVersionID',
0x0001: 'GPSLatitudeRef',
0x0002: 'GPSLatitude',
0x0003: 'GPSLongitudeRef',
0x0004: 'GPSLongitude',
0x0005: 'GPSAltitudeRef',
0x0006: 'GPSAltitude',
0x0007: 'GPSTimeStamp',
0x0008: 'GPSSatellites',
0x0009: 'GPSStatus',
0x000A: 'GPSMeasureMode',
0x000B: 'GPSDOP',
0x000C: 'GPSSpeedRef',
0x000D: 'GPSSpeed',
0x000E: 'GPSTrackRef',
0x000F: 'GPSTrack',
0x0010: 'GPSImgDirectionRef',
0x0011: 'GPSImgDirection',
0x0012: 'GPSMapDatum',
0x0013: 'GPSDestLatitudeRef',
0x0014: 'GPSDestLatitude',
0x0015: 'GPSDestLongitudeRef',
0x0016: 'GPSDestLongitude',
0x0017: 'GPSDestBearingRef',
0x0018: 'GPSDestBearing',
0x0019: 'GPSDestDistanceRef',
0x001A: 'GPSDestDistance',
0x001B: 'GPSProcessingMethod',
0x001C: 'GPSAreaInformation',
0x001D: 'GPSDateStamp',
0x001E: 'GPSDifferential',
0x001F: 'GPSHPositioningError'
}
loadImage.ExifMap.prototype.stringValues = {
ExposureProgram: {
0: 'Undefined',
1: 'Manual',
2: 'Normal program',
3: 'Aperture priority',
4: 'Shutter priority',
5: 'Creative program',
6: 'Action program',
7: 'Portrait mode',
8: 'Landscape mode'
},
MeteringMode: {
0: 'Unknown',
1: 'Average',
2: 'CenterWeightedAverage',
3: 'Spot',
4: 'MultiSpot',
5: 'Pattern',
6: 'Partial',
255: 'Other'
},
LightSource: {
0: 'Unknown',
1: 'Daylight',
2: 'Fluorescent',
3: 'Tungsten (incandescent light)',
4: 'Flash',
9: 'Fine weather',
10: 'Cloudy weather',
11: 'Shade',
12: 'Daylight fluorescent (D 5700 - 7100K)',
13: 'Day white fluorescent (N 4600 - 5400K)',
14: 'Cool white fluorescent (W 3900 - 4500K)',
15: 'White fluorescent (WW 3200 - 3700K)',
17: 'Standard light A',
18: 'Standard light B',
19: 'Standard light C',
20: 'D55',
21: 'D65',
22: 'D75',
23: 'D50',
24: 'ISO studio tungsten',
255: 'Other'
},
Flash: {
0x0000: 'Flash did not fire',
0x0001: 'Flash fired',
0x0005: 'Strobe return light not detected',
0x0007: 'Strobe return light detected',
0x0009: 'Flash fired, compulsory flash mode',
0x000D: 'Flash fired, compulsory flash mode, return light not detected',
0x000F: 'Flash fired, compulsory flash mode, return light detected',
0x0010: 'Flash did not fire, compulsory flash mode',
0x0018: 'Flash did not fire, auto mode',
0x0019: 'Flash fired, auto mode',
0x001D: 'Flash fired, auto mode, return light not detected',
0x001F: 'Flash fired, auto mode, return light detected',
0x0020: 'No flash function',
0x0041: 'Flash fired, red-eye reduction mode',
0x0045: 'Flash fired, red-eye reduction mode, return light not detected',
0x0047: 'Flash fired, red-eye reduction mode, return light detected',
0x0049: 'Flash fired, compulsory flash mode, red-eye reduction mode',
0x004D: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected',
0x004F: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light detected',
0x0059: 'Flash fired, auto mode, red-eye reduction mode',
0x005D: 'Flash fired, auto mode, return light not detected, red-eye reduction mode',
0x005F: 'Flash fired, auto mode, return light detected, red-eye reduction mode'
},
SensingMethod: {
1: 'Undefined',
2: 'One-chip color area sensor',
3: 'Two-chip color area sensor',
4: 'Three-chip color area sensor',
5: 'Color sequential area sensor',
7: 'Trilinear sensor',
8: 'Color sequential linear sensor'
},
SceneCaptureType: {
0: 'Standard',
1: 'Landscape',
2: 'Portrait',
3: 'Night scene'
},
SceneType: {
1: 'Directly photographed'
},
CustomRendered: {
0: 'Normal process',
1: 'Custom process'
},
WhiteBalance: {
0: 'Auto white balance',
1: 'Manual white balance'
},
GainControl: {
0: 'None',
1: 'Low gain up',
2: 'High gain up',
3: 'Low gain down',
4: 'High gain down'
},
Contrast: {
0: 'Normal',
1: 'Soft',
2: 'Hard'
},
Saturation: {
0: 'Normal',
1: 'Low saturation',
2: 'High saturation'
},
Sharpness: {
0: 'Normal',
1: 'Soft',
2: 'Hard'
},
SubjectDistanceRange: {
0: 'Unknown',
1: 'Macro',
2: 'Close view',
3: 'Distant view'
},
FileSource: {
3: 'DSC'
},
ComponentsConfiguration: {
0: '',
1: 'Y',
2: 'Cb',
3: 'Cr',
4: 'R',
5: 'G',
6: 'B'
},
Orientation: {
1: 'top-left',
2: 'top-right',
3: 'bottom-right',
4: 'bottom-left',
5: 'left-top',
6: 'right-top',
7: 'right-bottom',
8: 'left-bottom'
}
}
loadImage.ExifMap.prototype.getText = function (id) {
var value = this.get(id)
switch (id) {
case 'LightSource':
case 'Flash':
case 'MeteringMode':
case 'ExposureProgram':
case 'SensingMethod':
case 'SceneCaptureType':
case 'SceneType':
case 'CustomRendered':
case 'WhiteBalance':
case 'GainControl':
case 'Contrast':
case 'Saturation':
case 'Sharpness':
case 'SubjectDistanceRange':
case 'FileSource':
case 'Orientation':
return this.stringValues[id][value]
case 'ExifVersion':
case 'FlashpixVersion':
if (!value) return
return String.fromCharCode(value[0], value[1], value[2], value[3])
case 'ComponentsConfiguration':
if (!value) return
return this.stringValues[id][value[0]] +
this.stringValues[id][value[1]] +
this.stringValues[id][value[2]] +
this.stringValues[id][value[3]]
case 'GPSVersionID':
if (!value) return
return value[0] + '.' + value[1] + '.' + value[2] + '.' + value[3]
}
return String(value)
}
;(function (exifMapPrototype) {
var tags = exifMapPrototype.tags
var map = exifMapPrototype.map
var prop
// Map the tag names to tags:
for (prop in tags) {
if (tags.hasOwnProperty(prop)) {
map[tags[prop]] = prop
}
}
}(loadImage.ExifMap.prototype))
loadImage.ExifMap.prototype.getAll = function () {
var map = {}
var prop
var id
for (prop in this) {
if (this.hasOwnProperty(prop)) {
id = this.tags[prop]
if (id) {
map[id] = this.getText(id)
}
}
}
return map
}
}))
PK wN(|O js/load-image-meta.jsnu W+A /*
* JavaScript Load Image Meta
* https://github.com/blueimp/JavaScript-Load-Image
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Image meta data handling implementation
* based on the help and contribution of
* Achim Stöhr.
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*/
/* global define, Blob */
;(function (factory) {
'use strict'
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['./load-image'], factory)
} else if (typeof module === 'object' && module.exports) {
factory(require('./load-image'))
} else {
// Browser globals:
factory(window.loadImage)
}
}(function (loadImage) {
'use strict'
var hasblobSlice = window.Blob && (Blob.prototype.slice ||
Blob.prototype.webkitSlice || Blob.prototype.mozSlice)
loadImage.blobSlice = hasblobSlice && function () {
var slice = this.slice || this.webkitSlice || this.mozSlice
return slice.apply(this, arguments)
}
loadImage.metaDataParsers = {
jpeg: {
0xffe1: [] // APP1 marker
}
}
// Parses image meta data and calls the callback with an object argument
// with the following properties:
// * imageHead: The complete image head as ArrayBuffer (Uint8Array for IE10)
// The options arguments accepts an object and supports the following properties:
// * maxMetaDataSize: Defines the maximum number of bytes to parse.
// * disableImageHead: Disables creating the imageHead property.
loadImage.parseMetaData = function (file, callback, options, data) {
options = options || {}
data = data || {}
var that = this
// 256 KiB should contain all EXIF/ICC/IPTC segments:
var maxMetaDataSize = options.maxMetaDataSize || 262144
var noMetaData = !(window.DataView && file && file.size >= 12 &&
file.type === 'image/jpeg' && loadImage.blobSlice)
if (noMetaData || !loadImage.readFile(
loadImage.blobSlice.call(file, 0, maxMetaDataSize),
function (e) {
if (e.target.error) {
// FileReader error
console.log(e.target.error)
callback(data)
return
}
// Note on endianness:
// Since the marker and length bytes in JPEG files are always
// stored in big endian order, we can leave the endian parameter
// of the DataView methods undefined, defaulting to big endian.
var buffer = e.target.result
var dataView = new DataView(buffer)
var offset = 2
var maxOffset = dataView.byteLength - 4
var headLength = offset
var markerBytes
var markerLength
var parsers
var i
// Check for the JPEG marker (0xffd8):
if (dataView.getUint16(0) === 0xffd8) {
while (offset < maxOffset) {
markerBytes = dataView.getUint16(offset)
// Search for APPn (0xffeN) and COM (0xfffe) markers,
// which contain application-specific meta-data like
// Exif, ICC and IPTC data and text comments:
if ((markerBytes >= 0xffe0 && markerBytes <= 0xffef) ||
markerBytes === 0xfffe) {
// The marker bytes (2) are always followed by
// the length bytes (2), indicating the length of the
// marker segment, which includes the length bytes,
// but not the marker bytes, so we add 2:
markerLength = dataView.getUint16(offset + 2) + 2
if (offset + markerLength > dataView.byteLength) {
console.log('Invalid meta data: Invalid segment size.')
break
}
parsers = loadImage.metaDataParsers.jpeg[markerBytes]
if (parsers) {
for (i = 0; i < parsers.length; i += 1) {
parsers[i].call(
that,
dataView,
offset,
markerLength,
data,
options
)
}
}
offset += markerLength
headLength = offset
} else {
// Not an APPn or COM marker, probably safe to
// assume that this is the end of the meta data
break
}
}
// Meta length must be longer than JPEG marker (2)
// plus APPn marker (2), followed by length bytes (2):
if (!options.disableImageHead && headLength > 6) {
if (buffer.slice) {
data.imageHead = buffer.slice(0, headLength)
} else {
// Workaround for IE10, which does not yet
// support ArrayBuffer.slice:
data.imageHead = new Uint8Array(buffer)
.subarray(0, headLength)
}
}
} else {
console.log('Invalid JPEG file: Missing JPEG marker.')
}
callback(data)
},
'readAsArrayBuffer'
)) {
callback(data)
}
}
// Determines if meta data should be loaded automatically:
loadImage.hasMetaOption = function (options) {
return options && options.meta
}
var originalTransform = loadImage.transform
loadImage.transform = function (img, options, callback, file, data) {
if (loadImage.hasMetaOption(options)) {
loadImage.parseMetaData(file, function (data) {
originalTransform.call(loadImage, img, options, callback, file, data)
}, options, data)
} else {
originalTransform.apply(loadImage, arguments)
}
}
}))
PK wNfE fE js/load-image.all.min.jsnu W+A !function(e){"use strict";function t(e,i,o){var a,n=document.createElement("img");return n.onerror=function(a){return t.onerror(n,a,e,i,o)},n.onload=function(a){return t.onload(n,a,e,i,o)},"string"==typeof e?(t.fetchBlob(e,function(i){i?(e=i,a=t.createObjectURL(e)):(a=e,o&&o.crossOrigin&&(n.crossOrigin=o.crossOrigin)),n.src=a},o),n):t.isInstanceOf("Blob",e)||t.isInstanceOf("File",e)?(a=n._objectURL=t.createObjectURL(e),a?(n.src=a,n):t.readFile(e,function(e){var t=e.target;t&&t.result?n.src=t.result:i&&i(e)})):void 0}function i(e,i){!e._objectURL||i&&i.noRevoke||(t.revokeObjectURL(e._objectURL),delete e._objectURL)}var o=window.createObjectURL&&window||window.URL&&URL.revokeObjectURL&&URL||window.webkitURL&&webkitURL;t.fetchBlob=function(e,t,i){t()},t.isInstanceOf=function(e,t){return Object.prototype.toString.call(t)==="[object "+e+"]"},t.transform=function(e,t,i,o,a){i(e,a)},t.onerror=function(e,t,o,a,n){i(e,n),a&&a.call(e,t)},t.onload=function(e,o,a,n,r){i(e,r),n&&t.transform(e,r,n,a,{})},t.createObjectURL=function(e){return!!o&&o.createObjectURL(e)},t.revokeObjectURL=function(e){return!!o&&o.revokeObjectURL(e)},t.readFile=function(e,t,i){if(window.FileReader){var o=new FileReader;if(o.onload=o.onerror=t,i=i||"readAsDataURL",o[i])return o[i](e),o}return!1},"function"==typeof define&&define.amd?define(function(){return t}):"object"==typeof module&&module.exports?module.exports=t:e.loadImage=t}(window),function(e){"use strict";"function"==typeof define&&define.amd?define(["./load-image"],e):e("object"==typeof module&&module.exports?require("./load-image"):window.loadImage)}(function(e){"use strict";var t=e.transform;e.transform=function(i,o,a,n,r){t.call(e,e.scale(i,o,r),o,a,n,r)},e.transformCoordinates=function(){},e.getTransformedOptions=function(e,t){var i,o,a,n,r=t.aspectRatio;if(!r)return t;i={};for(o in t)t.hasOwnProperty(o)&&(i[o]=t[o]);return i.crop=!0,a=e.naturalWidth||e.width,n=e.naturalHeight||e.height,a/n>r?(i.maxWidth=n*r,i.maxHeight=n):(i.maxWidth=a,i.maxHeight=a/r),i},e.renderImageToCanvas=function(e,t,i,o,a,n,r,s,l,d){return e.getContext("2d").drawImage(t,i,o,a,n,r,s,l,d),e},e.hasCanvasOption=function(e){return e.canvas||e.crop||!!e.aspectRatio},e.scale=function(t,i,o){function a(){var e=Math.max((l||v)/v,(d||w)/w);e>1&&(v*=e,w*=e)}function n(){var e=Math.min((r||v)/v,(s||w)/w);e<1&&(v*=e,w*=e)}i=i||{};var r,s,l,d,c,u,f,g,h,m,p,S=document.createElement("canvas"),b=t.getContext||e.hasCanvasOption(i)&&S.getContext,x=t.naturalWidth||t.width,y=t.naturalHeight||t.height,v=x,w=y;if(b&&(i=e.getTransformedOptions(t,i,o),f=i.left||0,g=i.top||0,i.sourceWidth?(c=i.sourceWidth,void 0!==i.right&&void 0===i.left&&(f=x-c-i.right)):c=x-f-(i.right||0),i.sourceHeight?(u=i.sourceHeight,void 0!==i.bottom&&void 0===i.top&&(g=y-u-i.bottom)):u=y-g-(i.bottom||0),v=c,w=u),r=i.maxWidth,s=i.maxHeight,l=i.minWidth,d=i.minHeight,b&&r&&s&&i.crop?(v=r,w=s,p=c/u-r/s,p<0?(u=s*c/r,void 0===i.top&&void 0===i.bottom&&(g=(y-u)/2)):p>0&&(c=r*u/s,void 0===i.left&&void 0===i.right&&(f=(x-c)/2))):((i.contain||i.cover)&&(l=r=r||l,d=s=s||d),i.cover?(n(),a()):(a(),n())),b){if(h=i.pixelRatio,h>1&&(S.style.width=v+"px",S.style.height=w+"px",v*=h,w*=h,S.getContext("2d").scale(h,h)),m=i.downsamplingRatio,m>0&&m<1&&vv;)S.width=c*m,S.height=u*m,e.renderImageToCanvas(S,t,f,g,c,u,0,0,S.width,S.height),f=0,g=0,c=S.width,u=S.height,t=document.createElement("canvas"),t.width=c,t.height=u,e.renderImageToCanvas(t,S,0,0,c,u,0,0,c,u);return S.width=v,S.height=w,e.transformCoordinates(S,i),e.renderImageToCanvas(S,t,f,g,c,u,0,0,v,w)}return t.width=v,t.height=w,t}}),function(e){"use strict";"function"==typeof define&&define.amd?define(["./load-image"],e):e("object"==typeof module&&module.exports?require("./load-image"):window.loadImage)}(function(e){"use strict";var t=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice);e.blobSlice=t&&function(){var e=this.slice||this.webkitSlice||this.mozSlice;return e.apply(this,arguments)},e.metaDataParsers={jpeg:{65505:[]}},e.parseMetaData=function(t,i,o,a){o=o||{},a=a||{};var n=this,r=o.maxMetaDataSize||262144,s=!(window.DataView&&t&&t.size>=12&&"image/jpeg"===t.type&&e.blobSlice);!s&&e.readFile(e.blobSlice.call(t,0,r),function(t){if(t.target.error)return console.log(t.target.error),void i(a);var r,s,l,d,c=t.target.result,u=new DataView(c),f=2,g=u.byteLength-4,h=f;if(65496===u.getUint16(0)){for(;f=65504&&r<=65519||65534===r);){if(s=u.getUint16(f+2)+2,f+s>u.byteLength){console.log("Invalid meta data: Invalid segment size.");break}if(l=e.metaDataParsers.jpeg[r])for(d=0;d6&&(c.slice?a.imageHead=c.slice(0,h):a.imageHead=new Uint8Array(c).subarray(0,h))}else console.log("Invalid JPEG file: Missing JPEG marker.");i(a)},"readAsArrayBuffer")||i(a)},e.hasMetaOption=function(e){return e&&e.meta};var i=e.transform;e.transform=function(t,o,a,n,r){e.hasMetaOption(o)?e.parseMetaData(n,function(r){i.call(e,t,o,a,n,r)},o,r):i.apply(e,arguments)}}),function(e){"use strict";"function"==typeof define&&define.amd?define(["./load-image","./load-image-meta"],e):"object"==typeof module&&module.exports?e(require("./load-image"),require("./load-image-meta")):e(window.loadImage)}(function(e){"use strict";"fetch"in window&&"Request"in window&&(e.fetchBlob=function(t,i,o){return e.hasMetaOption(o)?fetch(new Request(t,o)).then(function(e){return e.blob()}).then(i).catch(function(e){console.log(e),i()}):void i()})}),function(e){"use strict";"function"==typeof define&&define.amd?define(["./load-image","./load-image-meta"],e):"object"==typeof module&&module.exports?e(require("./load-image"),require("./load-image-meta")):e(window.loadImage)}(function(e){"use strict";e.ExifMap=function(){return this},e.ExifMap.prototype.map={Orientation:274},e.ExifMap.prototype.get=function(e){return this[e]||this[this.map[e]]},e.getExifThumbnail=function(e,t,i){var o,a,n;if(!i||t+i>e.byteLength)return void console.log("Invalid Exif data: Invalid thumbnail data.");for(o=[],a=0;a4?i+t.getUint32(o+8,r):o+8,l+s>t.byteLength)return void console.log("Invalid Exif data: Invalid data offset.");if(1===n)return g.getValue(t,l,r);for(d=[],c=0;ce.byteLength)return void console.log("Invalid Exif data: Invalid directory offset.");if(n=e.getUint16(i,o),r=i+2+12*n,r+4>e.byteLength)return void console.log("Invalid Exif data: Invalid directory size.");for(s=0;st.byteLength)return void console.log("Invalid Exif data: Invalid segment size.");if(0!==t.getUint16(i+8))return void console.log("Invalid Exif data: Missing byte alignment offset.");switch(t.getUint16(d)){case 18761:r=!0;break;case 19789:r=!1;break;default:return void console.log("Invalid Exif data: Invalid byte alignment marker.")}if(42!==t.getUint16(d+2,r))return void console.log("Invalid Exif data: Missing TIFF marker.");s=t.getUint32(d+4,r),a.exif=new e.ExifMap,s=e.parseExifTags(t,d,d+s,r,a),s&&!n.disableExifThumbnail&&(l={exif:{}},s=e.parseExifTags(t,d,d+s,r,l),l.exif[513]&&(a.exif.Thumbnail=e.getExifThumbnail(t,d+l.exif[513],l.exif[514]))),a.exif[34665]&&!n.disableExifSub&&e.parseExifTags(t,d,d+a.exif[34665],r,a),a.exif[34853]&&!n.disableExifGps&&e.parseExifTags(t,d,d+a.exif[34853],r,a)}}},e.metaDataParsers.jpeg[65505].push(e.parseExifData)}),function(e){"use strict";"function"==typeof define&&define.amd?define(["./load-image","./load-image-exif"],e):"object"==typeof module&&module.exports?e(require("./load-image"),require("./load-image-exif")):e(window.loadImage)}(function(e){"use strict";e.ExifMap.prototype.tags={256:"ImageWidth",257:"ImageHeight",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer",40965:"InteroperabilityIFDPointer",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright",36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",42240:"Gamma",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"PhotographicSensitivity",34856:"OECF",34864:"SensitivityType",34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRatio",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:"LensSpecification",42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber",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"},e.ExifMap.prototype.stringValues={ExposureProgram:{0:"Undefined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},SensingMethod:{1:"Undefined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},ComponentsConfiguration:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"},Orientation:{1:"top-left",2:"top-right",3:"bottom-right",4:"bottom-left",5:"left-top",6:"right-top",7:"right-bottom",8:"left-bottom"}},e.ExifMap.prototype.getText=function(e){var t=this.get(e);switch(e){case"LightSource":case"Flash":case"MeteringMode":case"ExposureProgram":case"SensingMethod":case"SceneCaptureType":case"SceneType":case"CustomRendered":case"WhiteBalance":case"GainControl":case"Contrast":case"Saturation":case"Sharpness":case"SubjectDistanceRange":case"FileSource":case"Orientation":return this.stringValues[e][t];case"ExifVersion":case"FlashpixVersion":if(!t)return;return String.fromCharCode(t[0],t[1],t[2],t[3]);case"ComponentsConfiguration":if(!t)return;return this.stringValues[e][t[0]]+this.stringValues[e][t[1]]+this.stringValues[e][t[2]]+this.stringValues[e][t[3]];case"GPSVersionID":if(!t)return;return t[0]+"."+t[1]+"."+t[2]+"."+t[3]}return String(t)},function(e){var t,i=e.tags,o=e.map;for(t in i)i.hasOwnProperty(t)&&(o[i[t]]=t)}(e.ExifMap.prototype),e.ExifMap.prototype.getAll=function(){var e,t,i={};for(e in this)this.hasOwnProperty(e)&&(t=this.tags[e],t&&(i[t]=this.getText(t)));return i}}),function(e){"use strict";"function"==typeof define&&define.amd?define(["./load-image","./load-image-scale","./load-image-meta"],e):"object"==typeof module&&module.exports?e(require("./load-image"),require("./load-image-scale"),require("./load-image-meta")):e(window.loadImage)}(function(e){"use strict";var t=e.hasCanvasOption,i=e.hasMetaOption,o=e.transformCoordinates,a=e.getTransformedOptions;e.hasCanvasOption=function(i){return!!i.orientation||t.call(e,i)},e.hasMetaOption=function(t){return t&&t.orientation===!0||i.call(e,t)},e.transformCoordinates=function(t,i){o.call(e,t,i);var a=t.getContext("2d"),n=t.width,r=t.height,s=t.style.width,l=t.style.height,d=i.orientation;if(d&&!(d>8))switch(d>4&&(t.width=r,t.height=n,t.style.width=l,t.style.height=s),d){case 2:a.translate(n,0),a.scale(-1,1);break;case 3:a.translate(n,r),a.rotate(Math.PI);break;case 4:a.translate(0,r),a.scale(1,-1);break;case 5:a.rotate(.5*Math.PI),a.scale(1,-1);break;case 6:a.rotate(.5*Math.PI),a.translate(0,-r);break;case 7:a.rotate(.5*Math.PI),a.translate(n,-r),a.scale(-1,1);break;case 8:a.rotate(-.5*Math.PI),a.translate(-n,0)}},e.getTransformedOptions=function(t,i,o){var n,r,s=a.call(e,t,i),l=s.orientation;if(l===!0&&o&&o.exif&&(l=o.exif.get("Orientation")),!l||l>8||1===l)return s;n={};for(r in s)s.hasOwnProperty(r)&&(n[r]=s[r]);switch(n.orientation=l,l){case 2:n.left=s.right,n.right=s.left;break;case 3:n.left=s.right,n.top=s.bottom,n.right=s.left,n.bottom=s.top;break;case 4:n.top=s.bottom,n.bottom=s.top;break;case 5:n.left=s.top,n.top=s.left,n.right=s.bottom,n.bottom=s.right;break;case 6:n.left=s.top,n.top=s.right,n.right=s.bottom,n.bottom=s.left;break;case 7:n.left=s.bottom,n.top=s.right,n.right=s.top,n.bottom=s.left;break;case 8:n.left=s.bottom,n.top=s.left,n.right=s.top,n.bottom=s.right}return n.orientation>4&&(n.maxWidth=s.maxHeight,n.maxHeight=s.maxWidth,n.minWidth=s.minHeight,n.minHeight=s.minWidth,n.sourceWidth=s.sourceHeight,n.sourceHeight=s.sourceWidth),n}});
//# sourceMappingURL=load-image.all.min.js.mapPK wN L*# *# js/load-image-exif.jsnu W+A /*
* JavaScript Load Image Exif Parser
* https://github.com/blueimp/JavaScript-Load-Image
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*/
/* global define */
;(function (factory) {
'use strict'
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['./load-image', './load-image-meta'], factory)
} else if (typeof module === 'object' && module.exports) {
factory(require('./load-image'), require('./load-image-meta'))
} else {
// Browser globals:
factory(window.loadImage)
}
}(function (loadImage) {
'use strict'
loadImage.ExifMap = function () {
return this
}
loadImage.ExifMap.prototype.map = {
'Orientation': 0x0112
}
loadImage.ExifMap.prototype.get = function (id) {
return this[id] || this[this.map[id]]
}
loadImage.getExifThumbnail = function (dataView, offset, length) {
var hexData,
i,
b
if (!length || offset + length > dataView.byteLength) {
console.log('Invalid Exif data: Invalid thumbnail data.')
return
}
hexData = []
for (i = 0; i < length; i += 1) {
b = dataView.getUint8(offset + i)
hexData.push((b < 16 ? '0' : '') + b.toString(16))
}
return 'data:image/jpeg,%' + hexData.join('%')
}
loadImage.exifTagTypes = {
// byte, 8-bit unsigned int:
1: {
getValue: function (dataView, dataOffset) {
return dataView.getUint8(dataOffset)
},
size: 1
},
// ascii, 8-bit byte:
2: {
getValue: function (dataView, dataOffset) {
return String.fromCharCode(dataView.getUint8(dataOffset))
},
size: 1,
ascii: true
},
// short, 16 bit int:
3: {
getValue: function (dataView, dataOffset, littleEndian) {
return dataView.getUint16(dataOffset, littleEndian)
},
size: 2
},
// long, 32 bit int:
4: {
getValue: function (dataView, dataOffset, littleEndian) {
return dataView.getUint32(dataOffset, littleEndian)
},
size: 4
},
// rational = two long values, first is numerator, second is denominator:
5: {
getValue: function (dataView, dataOffset, littleEndian) {
return dataView.getUint32(dataOffset, littleEndian) /
dataView.getUint32(dataOffset + 4, littleEndian)
},
size: 8
},
// slong, 32 bit signed int:
9: {
getValue: function (dataView, dataOffset, littleEndian) {
return dataView.getInt32(dataOffset, littleEndian)
},
size: 4
},
// srational, two slongs, first is numerator, second is denominator:
10: {
getValue: function (dataView, dataOffset, littleEndian) {
return dataView.getInt32(dataOffset, littleEndian) /
dataView.getInt32(dataOffset + 4, littleEndian)
},
size: 8
}
}
// undefined, 8-bit byte, value depending on field:
loadImage.exifTagTypes[7] = loadImage.exifTagTypes[1]
loadImage.getExifValue = function (dataView, tiffOffset, offset, type, length, littleEndian) {
var tagType = loadImage.exifTagTypes[type]
var tagSize
var dataOffset
var values
var i
var str
var c
if (!tagType) {
console.log('Invalid Exif data: Invalid tag type.')
return
}
tagSize = tagType.size * length
// Determine if the value is contained in the dataOffset bytes,
// or if the value at the dataOffset is a pointer to the actual data:
dataOffset = tagSize > 4
? tiffOffset + dataView.getUint32(offset + 8, littleEndian)
: (offset + 8)
if (dataOffset + tagSize > dataView.byteLength) {
console.log('Invalid Exif data: Invalid data offset.')
return
}
if (length === 1) {
return tagType.getValue(dataView, dataOffset, littleEndian)
}
values = []
for (i = 0; i < length; i += 1) {
values[i] = tagType.getValue(dataView, dataOffset + i * tagType.size, littleEndian)
}
if (tagType.ascii) {
str = ''
// Concatenate the chars:
for (i = 0; i < values.length; i += 1) {
c = values[i]
// Ignore the terminating NULL byte(s):
if (c === '\u0000') {
break
}
str += c
}
return str
}
return values
}
loadImage.parseExifTag = function (dataView, tiffOffset, offset, littleEndian, data) {
var tag = dataView.getUint16(offset, littleEndian)
data.exif[tag] = loadImage.getExifValue(
dataView,
tiffOffset,
offset,
dataView.getUint16(offset + 2, littleEndian), // tag type
dataView.getUint32(offset + 4, littleEndian), // tag length
littleEndian
)
}
loadImage.parseExifTags = function (dataView, tiffOffset, dirOffset, littleEndian, data) {
var tagsNumber,
dirEndOffset,
i
if (dirOffset + 6 > dataView.byteLength) {
console.log('Invalid Exif data: Invalid directory offset.')
return
}
tagsNumber = dataView.getUint16(dirOffset, littleEndian)
dirEndOffset = dirOffset + 2 + 12 * tagsNumber
if (dirEndOffset + 4 > dataView.byteLength) {
console.log('Invalid Exif data: Invalid directory size.')
return
}
for (i = 0; i < tagsNumber; i += 1) {
this.parseExifTag(
dataView,
tiffOffset,
dirOffset + 2 + 12 * i, // tag offset
littleEndian,
data
)
}
// Return the offset to the next directory:
return dataView.getUint32(dirEndOffset, littleEndian)
}
loadImage.parseExifData = function (dataView, offset, length, data, options) {
if (options.disableExif) {
return
}
var tiffOffset = offset + 10
var littleEndian
var dirOffset
var thumbnailData
// Check for the ASCII code for "Exif" (0x45786966):
if (dataView.getUint32(offset + 4) !== 0x45786966) {
// No Exif data, might be XMP data instead
return
}
if (tiffOffset + 8 > dataView.byteLength) {
console.log('Invalid Exif data: Invalid segment size.')
return
}
// Check for the two null bytes:
if (dataView.getUint16(offset + 8) !== 0x0000) {
console.log('Invalid Exif data: Missing byte alignment offset.')
return
}
// Check the byte alignment:
switch (dataView.getUint16(tiffOffset)) {
case 0x4949:
littleEndian = true
break
case 0x4D4D:
littleEndian = false
break
default:
console.log('Invalid Exif data: Invalid byte alignment marker.')
return
}
// Check for the TIFF tag marker (0x002A):
if (dataView.getUint16(tiffOffset + 2, littleEndian) !== 0x002A) {
console.log('Invalid Exif data: Missing TIFF marker.')
return
}
// Retrieve the directory offset bytes, usually 0x00000008 or 8 decimal:
dirOffset = dataView.getUint32(tiffOffset + 4, littleEndian)
// Create the exif object to store the tags:
data.exif = new loadImage.ExifMap()
// Parse the tags of the main image directory and retrieve the
// offset to the next directory, usually the thumbnail directory:
dirOffset = loadImage.parseExifTags(
dataView,
tiffOffset,
tiffOffset + dirOffset,
littleEndian,
data
)
if (dirOffset && !options.disableExifThumbnail) {
thumbnailData = {exif: {}}
dirOffset = loadImage.parseExifTags(
dataView,
tiffOffset,
tiffOffset + dirOffset,
littleEndian,
thumbnailData
)
// Check for JPEG Thumbnail offset:
if (thumbnailData.exif[0x0201]) {
data.exif.Thumbnail = loadImage.getExifThumbnail(
dataView,
tiffOffset + thumbnailData.exif[0x0201],
thumbnailData.exif[0x0202] // Thumbnail data length
)
}
}
// Check for Exif Sub IFD Pointer:
if (data.exif[0x8769] && !options.disableExifSub) {
loadImage.parseExifTags(
dataView,
tiffOffset,
tiffOffset + data.exif[0x8769], // directory offset
littleEndian,
data
)
}
// Check for GPS Info IFD Pointer:
if (data.exif[0x8825] && !options.disableExifGps) {
loadImage.parseExifTags(
dataView,
tiffOffset,
tiffOffset + data.exif[0x8825], // directory offset
littleEndian,
data
)
}
}
// Registers the Exif parser for the APP1 JPEG meta data segment:
loadImage.metaDataParsers.jpeg[0xffe1].push(loadImage.parseExifData)
// Adds the following properties to the parseMetaData callback data:
// * exif: The exif tags, parsed by the parseExifData method
// Adds the following options to the parseMetaData method:
// * disableExif: Disables Exif parsing.
// * disableExifThumbnail: Disables parsing of the Exif Thumbnail.
// * disableExifSub: Disables parsing of the Exif Sub IFD.
// * disableExifGps: Disables parsing of the Exif GPS Info IFD.
}))
PK wNb6FR R js/load-image.all.min.js.mapnu W+A {"version":3,"sources":["load-image.js","load-image-scale.js","load-image-meta.js","load-image-fetch.js","load-image-exif.js","load-image-exif-map.js","load-image-orientation.js"],"names":["$","loadImage","file","callback","options","url","img","document","createElement","onerror","event","onload","fetchBlob","blob","createObjectURL","crossOrigin","src","isInstanceOf","_objectURL","readFile","e","target","result","revokeHelper","noRevoke","revokeObjectURL","urlAPI","window","URL","webkitURL","type","obj","Object","prototype","toString","call","transform","data","method","FileReader","fileReader","define","amd","module","exports","factory","require","originalTransform","scale","transformCoordinates","getTransformedOptions","newOptions","i","width","height","aspectRatio","hasOwnProperty","crop","naturalWidth","naturalHeight","maxWidth","maxHeight","renderImageToCanvas","canvas","sourceX","sourceY","sourceWidth","sourceHeight","destX","destY","destWidth","destHeight","getContext","drawImage","hasCanvasOption","scaleUp","Math","max","minWidth","minHeight","scaleDown","min","pixelRatio","downsamplingRatio","tmp","useCanvas","left","top","undefined","right","bottom","contain","cover","style","hasblobSlice","Blob","slice","webkitSlice","mozSlice","blobSlice","this","apply","arguments","metaDataParsers","jpeg","65505","parseMetaData","that","maxMetaDataSize","noMetaData","DataView","size","error","console","log","markerBytes","markerLength","parsers","buffer","dataView","offset","maxOffset","byteLength","headLength","getUint16","length","disableImageHead","imageHead","Uint8Array","subarray","hasMetaOption","meta","fetch","Request","then","response","catch","err","ExifMap","map","Orientation","get","id","getExifThumbnail","hexData","b","getUint8","push","join","exifTagTypes","1","getValue","dataOffset","2","String","fromCharCode","ascii","3","littleEndian","4","getUint32","5","9","getInt32","10","getExifValue","tiffOffset","tagSize","values","str","c","tagType","parseExifTag","tag","exif","parseExifTags","dirOffset","tagsNumber","dirEndOffset","parseExifData","disableExif","thumbnailData","disableExifThumbnail","Thumbnail","disableExifSub","disableExifGps","tags","256","257","34665","34853","40965","258","259","262","274","277","284","530","531","282","283","296","273","278","279","513","514","301","318","319","529","532","306","270","271","272","305","315","33432","36864","40960","40961","40962","40963","42240","37121","37122","37500","37510","40964","36867","36868","37520","37521","37522","33434","33437","34850","34852","34855","34856","34864","34865","34866","34867","34868","34869","37377","37378","37379","37380","37381","37382","37383","37384","37385","37396","37386","41483","41484","41486","41487","41488","41492","41493","41495","41728","41729","41730","41985","41986","41987","41988","41989","41990","41991","41992","41993","41994","41995","41996","42016","42032","42033","42034","42035","42036","42037","0","6","7","8","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","stringValues","ExposureProgram","MeteringMode","255","LightSource","Flash","32","65","69","71","73","77","79","89","93","95","SensingMethod","SceneCaptureType","SceneType","CustomRendered","WhiteBalance","GainControl","Contrast","Saturation","Sharpness","SubjectDistanceRange","FileSource","ComponentsConfiguration","getText","value","exifMapPrototype","prop","getAll","originalHasCanvasOption","originalHasMetaOption","originalTransformCoordinates","originalGetTransformedOptions","orientation","ctx","styleWidth","styleHeight","translate","rotate","PI","opts"],"mappings":"CAaE,SAAUA,GACV,YAKA,SAASC,GAAWC,EAAMC,EAAUC,GAClC,GACIC,GADAC,EAAMC,SAASC,cAAc,MAQjC,OANAF,GAAIG,QAAU,SAAUC,GACtB,MAAOT,GAAUQ,QAAQH,EAAKI,EAAOR,EAAMC,EAAUC,IAEvDE,EAAIK,OAAS,SAAUD,GACrB,MAAOT,GAAUU,OAAOL,EAAKI,EAAOR,EAAMC,EAAUC,IAElC,gBAATF,IACTD,EAAUW,UAAUV,EAAM,SAAUW,GAC9BA,GACFX,EAAOW,EACPR,EAAMJ,EAAUa,gBAAgBZ,KAEhCG,EAAMH,EACFE,GAAWA,EAAQW,cACrBT,EAAIS,YAAcX,EAAQW,cAG9BT,EAAIU,IAAMX,GACTD,GACIE,GACEL,EAAUgB,aAAa,OAAQf,IAGtCD,EAAUgB,aAAa,OAAQf,IACjCG,EAAMC,EAAIY,WAAajB,EAAUa,gBAAgBZ,GAC7CG,GACFC,EAAIU,IAAMX,EACHC,GAEFL,EAAUkB,SAASjB,EAAM,SAAUkB,GACxC,GAAIC,GAASD,EAAEC,MACXA,IAAUA,EAAOC,OACnBhB,EAAIU,IAAMK,EAAOC,OACRnB,GACTA,EAASiB,MAdR,OAyBT,QAASG,GAAcjB,EAAKF,IACtBE,EAAIY,YAAgBd,GAAWA,EAAQoB,WACzCvB,EAAUwB,gBAAgBnB,EAAIY,kBACvBZ,GAAIY,YAPf,GAAIQ,GAAUC,OAAOb,iBAAmBa,QACzBA,OAAOC,KAAOA,IAAIH,iBAAmBG,KACrCD,OAAOE,WAAaA,SAYnC5B,GAAUW,UAAY,SAAUP,EAAKF,EAAUC,GAC7CD,KAGFF,EAAUgB,aAAe,SAAUa,EAAMC,GAEvC,MAAOC,QAAOC,UAAUC,SAASC,KAAKJ,KAAS,WAAaD,EAAO,KAGrE7B,EAAUmC,UAAY,S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sC,MAAQrF,EAAQsF,OAC3BvC,EAAWuC,OAAStF,EAAQqF,KAC5B,MACF,KAAK,GAEHtC,EAAWmC,KAAOlF,EAAQmF,IAC1BpC,EAAWoC,IAAMnF,EAAQqF,MACzBtC,EAAWsC,MAAQrF,EAAQsF,OAC3BvC,EAAWuC,OAAStF,EAAQkF,IAC5B,MACF,KAAK,GAEHnC,EAAWmC,KAAOlF,EAAQsF,OAC1BvC,EAAWoC,IAAMnF,EAAQqF,MACzBtC,EAAWsC,MAAQrF,EAAQmF,IAC3BpC,EAAWuC,OAAStF,EAAQkF,IAC5B,MACF,KAAK,GAEHnC,EAAWmC,KAAOlF,EAAQsF,OAC1BvC,EAAWoC,IAAMnF,EAAQkF,KACzBnC,EAAWsC,MAAQrF,EAAQmF,IAC3BpC,EAAWuC,OAAStF,EAAQqF,MAWhC,MARItC,GAAW4S,YAAc,IAC3B5S,EAAWS,SAAWxD,EAAQyD,UAC9BV,EAAWU,UAAYzD,EAAQwD,SAC/BT,EAAW2B,SAAW1E,EAAQ2E,UAC9B5B,EAAW4B,UAAY3E,EAAQ0E,SAC/B3B,EAAWe,YAAc9D,EAAQ+D,aACjChB,EAAWgB,aAAe/D,EAAQ8D,aAE7Bf","file":"load-image.all.min.js"}PK wN5!uz z js/load-image-orientation.jsnu W+A /*
* JavaScript Load Image Orientation
* https://github.com/blueimp/JavaScript-Load-Image
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*/
/* global define */
;(function (factory) {
'use strict'
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['./load-image', './load-image-scale', './load-image-meta'], factory)
} else if (typeof module === 'object' && module.exports) {
factory(
require('./load-image'),
require('./load-image-scale'),
require('./load-image-meta')
)
} else {
// Browser globals:
factory(window.loadImage)
}
}(function (loadImage) {
'use strict'
var originalHasCanvasOption = loadImage.hasCanvasOption
var originalHasMetaOption = loadImage.hasMetaOption
var originalTransformCoordinates = loadImage.transformCoordinates
var originalGetTransformedOptions = loadImage.getTransformedOptions
// Determines if the target image should be a canvas element:
loadImage.hasCanvasOption = function (options) {
return !!options.orientation ||
originalHasCanvasOption.call(loadImage, options)
}
// Determines if meta data should be loaded automatically:
loadImage.hasMetaOption = function (options) {
return options && options.orientation === true ||
originalHasMetaOption.call(loadImage, options)
}
// Transform image orientation based on
// the given EXIF orientation option:
loadImage.transformCoordinates = function (canvas, options) {
originalTransformCoordinates.call(loadImage, canvas, options)
var ctx = canvas.getContext('2d')
var width = canvas.width
var height = canvas.height
var styleWidth = canvas.style.width
var styleHeight = canvas.style.height
var orientation = options.orientation
if (!orientation || orientation > 8) {
return
}
if (orientation > 4) {
canvas.width = height
canvas.height = width
canvas.style.width = styleHeight
canvas.style.height = styleWidth
}
switch (orientation) {
case 2:
// horizontal flip
ctx.translate(width, 0)
ctx.scale(-1, 1)
break
case 3:
// 180° rotate left
ctx.translate(width, height)
ctx.rotate(Math.PI)
break
case 4:
// vertical flip
ctx.translate(0, height)
ctx.scale(1, -1)
break
case 5:
// vertical flip + 90 rotate right
ctx.rotate(0.5 * Math.PI)
ctx.scale(1, -1)
break
case 6:
// 90° rotate right
ctx.rotate(0.5 * Math.PI)
ctx.translate(0, -height)
break
case 7:
// horizontal flip + 90 rotate right
ctx.rotate(0.5 * Math.PI)
ctx.translate(width, -height)
ctx.scale(-1, 1)
break
case 8:
// 90° rotate left
ctx.rotate(-0.5 * Math.PI)
ctx.translate(-width, 0)
break
}
}
// Transforms coordinate and dimension options
// based on the given orientation option:
loadImage.getTransformedOptions = function (img, opts, data) {
var options = originalGetTransformedOptions.call(loadImage, img, opts)
var orientation = options.orientation
var newOptions
var i
if (orientation === true && data && data.exif) {
orientation = data.exif.get('Orientation')
}
if (!orientation || orientation > 8 || orientation === 1) {
return options
}
newOptions = {}
for (i in options) {
if (options.hasOwnProperty(i)) {
newOptions[i] = options[i]
}
}
newOptions.orientation = orientation
switch (orientation) {
case 2:
// horizontal flip
newOptions.left = options.right
newOptions.right = options.left
break
case 3:
// 180° rotate left
newOptions.left = options.right
newOptions.top = options.bottom
newOptions.right = options.left
newOptions.bottom = options.top
break
case 4:
// vertical flip
newOptions.top = options.bottom
newOptions.bottom = options.top
break
case 5:
// vertical flip + 90 rotate right
newOptions.left = options.top
newOptions.top = options.left
newOptions.right = options.bottom
newOptions.bottom = options.right
break
case 6:
// 90° rotate right
newOptions.left = options.top
newOptions.top = options.right
newOptions.right = options.bottom
newOptions.bottom = options.left
break
case 7:
// horizontal flip + 90 rotate right
newOptions.left = options.bottom
newOptions.top = options.right
newOptions.right = options.top
newOptions.bottom = options.left
break
case 8:
// 90° rotate left
newOptions.left = options.bottom
newOptions.top = options.left
newOptions.right = options.top
newOptions.bottom = options.right
break
}
if (newOptions.orientation > 4) {
newOptions.maxWidth = options.maxHeight
newOptions.maxHeight = options.maxWidth
newOptions.minWidth = options.minHeight
newOptions.minHeight = options.minWidth
newOptions.sourceWidth = options.sourceHeight
newOptions.sourceHeight = options.sourceWidth
}
return newOptions
}
}))
PK wN8h h js/load-image-fetch.jsnu W+A /*
* JavaScript Load Image Fetch
* https://github.com/blueimp/JavaScript-Load-Image
*
* Copyright 2017, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*/
/* global define, fetch, Request */
;(function (factory) {
'use strict'
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['./load-image', './load-image-meta'], factory)
} else if (typeof module === 'object' && module.exports) {
factory(require('./load-image'), require('./load-image-meta'))
} else {
// Browser globals:
factory(window.loadImage)
}
}(function (loadImage) {
'use strict'
if ('fetch' in window && 'Request' in window) {
loadImage.fetchBlob = function (url, callback, options) {
if (loadImage.hasMetaOption(options)) {
return fetch(new Request(url, options)).then(function (response) {
return response.blob()
}).then(callback).catch(function (err) {
console.log(err)
callback()
})
} else {
callback()
}
}
}
}))
PK wND]BǴ package.jsonnu W+A {
"name": "blueimp-load-image",
"version": "2.12.2",
"title": "JavaScript Load Image",
"description": "JavaScript Load Image is a library to load images provided as File or Blob objects or via URL. It returns an optionally scaled and/or cropped HTML img or canvas element. It also provides a method to parse image meta data to extract Exif tags and thumbnails and to restore the complete image header after resizing.",
"keywords": [
"javascript",
"load",
"loading",
"image",
"file",
"blob",
"url",
"scale",
"crop",
"img",
"canvas",
"meta",
"exif",
"thumbnail",
"resizing"
],
"homepage": "https://github.com/blueimp/JavaScript-Load-Image",
"author": {
"name": "Sebastian Tschan",
"url": "https://blueimp.net"
},
"repository": {
"type": "git",
"url": "git://github.com/blueimp/JavaScript-Load-Image.git"
},
"license": "MIT",
"devDependencies": {
"phantomjs-prebuilt": "2.1.13",
"mocha-phantomjs-core": "1.3.1",
"standard": "8.3.0",
"uglify-js": "2.7.3"
},
"scripts": {
"lint": "standard *.js js/*.js test/*.js",
"unit": "phantomjs node_modules/mocha-phantomjs-core/mocha-phantomjs-core.js test/index.html",
"test": "npm run lint && npm run unit",
"build": "cd js && uglifyjs load-image.js load-image-scale.js load-image-meta.js load-image-fetch.js load-image-exif.js load-image-exif-map.js load-image-orientation.js -c -m -o load-image.all.min.js --source-map load-image.all.min.js.map",
"preversion": "npm test",
"version": "npm run build && git add -A js",
"postversion": "git push --tags origin master master:gh-pages && npm publish"
},
"main": "js/index.js"
}
PK wNB', , README.mdnu W+A PK wNwr /- js/load-image-scale.jsnu W+A PK wNj!2M M K js/load-image.jsnu W+A PK wNK" \ js/index.jsnu W+A PK wN]FJN1 N1 ] js/load-image-exif-map.jsnu W+A PK wN(|O ? js/load-image-meta.jsnu W+A PK wNfE fE js/load-image.all.min.jsnu W+A PK wN L*# *# js/load-image-exif.jsnu W+A PK wNb6FR R / js/load-image.all.min.js.mapnu W+A PK wN5!uz z Zb js/load-image-orientation.jsnu W+A PK wN8h h x js/load-image-fetch.jsnu W+A PK wND]BǴ | package.jsonnu W+A PK