|
37 | 37 | - [crossOrigin](#crossorigin)
|
38 | 38 | - [noRevoke](#norevoke)
|
39 | 39 | - [Meta data parsing](#meta-data-parsing)
|
| 40 | + - [Image head](#image-head) |
40 | 41 | - [Exif parser](#exif-parser)
|
41 | 42 | - [IPTC parser](#iptc-parser)
|
42 | 43 | - [License](#license)
|
@@ -386,15 +387,43 @@ loadImage.parseMetaData(
|
386 | 387 | )
|
387 | 388 | ```
|
388 | 389 |
|
389 |
| -**Note:** |
390 |
| -Blob objects of resized images can be created via |
391 |
| -[canvas.toBlob()](https://github.com/blueimp/JavaScript-Canvas-to-Blob). |
392 |
| - |
393 | 390 | The Meta data extension also adds additional options used for the
|
394 | 391 | `parseMetaData` method:
|
395 | 392 |
|
396 | 393 | - `maxMetaDataSize`: Maximum number of bytes of meta data to parse.
|
397 | 394 | - `disableImageHead`: Disable parsing the original image head.
|
| 395 | +- `disableMetaDataParsers`: Disable parsing meta data (image head only) |
| 396 | + |
| 397 | +### Image head |
| 398 | + |
| 399 | +Resized JPEG images can be combined with their original image head via |
| 400 | +`loadImage.replaceHead`, which requires the resized image as `Blob` object as |
| 401 | +first argument and an `ArrayBuffer` image head as second argument. The third |
| 402 | +argument must be a `callback` function, which is called with the new `Blob` |
| 403 | +object: |
| 404 | + |
| 405 | +```js |
| 406 | +loadImage( |
| 407 | + fileOrBlobOrUrl, |
| 408 | + function (img, data) { |
| 409 | + if (data.imageHead && data.exif) { |
| 410 | + img.toBlob(function (blob) { |
| 411 | + loadImage.replaceHead(blob, data.imageHead, function (newBlob) { |
| 412 | + // do something with newBlob |
| 413 | + }) |
| 414 | + }, 'image/jpeg') |
| 415 | + } |
| 416 | + }, |
| 417 | + { meta: true, canvas: true, maxWidth: 800 } |
| 418 | +) |
| 419 | +``` |
| 420 | + |
| 421 | +**Note:** |
| 422 | +Blob objects of resized images can be created via |
| 423 | +[canvas.toBlob](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob). |
| 424 | +For browsers which don't have native support, a |
| 425 | +[canvas.toBlob polyfill](https://github.com/blueimp/JavaScript-Canvas-to-Blob) |
| 426 | +is available. |
398 | 427 |
|
399 | 428 | ### Exif parser
|
400 | 429 |
|
|
0 commit comments