Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,22 @@ Or alternatively, choose which components you want to include:
<script src="js/load-image-exif-map.js"></script>
```

### AMD
The different modules support AMD, so you can load them with require.js either individually or from the minified bundle. The modules are named to support loading the bundle, so you need to use the actual module names in your `requirejs.config` (modules are named like their filenames without the file extension, so `load-image-orientation.js` becomes `load-image-orientation`).

If you want to load multiple modules from the minified bundle, use the [bundles options](http://requirejs.org/docs/api.html#config-bundles) in your `requirejs.config` call, like this:

```js
requirejs.config({
paths: {
'load-image-all': 'vendor/load-image.all.min'
},
bundles: {
'load-image-all': ['load-image', 'load-image-orientation', 'load-image-ios', 'load-image-meta', 'load-image-exif']
}
});
```

## Usage

### Image loading
Expand Down
4 changes: 2 additions & 2 deletions js/load-image-exif-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['load-image', 'load-image-exif'], factory);
// Register as a named AMD module:
define('load-image-exif-map', ['load-image', 'load-image-exif'], factory);
} else {
// Browser globals:
factory(window.loadImage);
Expand Down
4 changes: 2 additions & 2 deletions js/load-image-exif.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['load-image', 'load-image-meta'], factory);
// Register as a named AMD module:
define('load-image-exif', ['load-image', 'load-image-meta'], factory);
} else {
// Browser globals:
factory(window.loadImage);
Expand Down
4 changes: 2 additions & 2 deletions js/load-image-ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['load-image'], factory);
// Register as a named AMD module:
define('load-image-ios', ['load-image'], factory);
} else {
// Browser globals:
factory(window.loadImage);
Expand Down
4 changes: 2 additions & 2 deletions js/load-image-meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['load-image'], factory);
// Register as a named AMD module:
define('load-image-meta', ['load-image'], factory);
} else {
// Browser globals:
factory(window.loadImage);
Expand Down
4 changes: 2 additions & 2 deletions js/load-image-orientation.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['load-image'], factory);
// Register as a named AMD module:
define('load-image-orientation', ['load-image'], factory);
} else {
// Browser globals:
factory(window.loadImage);
Expand Down
2 changes: 1 addition & 1 deletion js/load-image.all.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/load-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
};

if (typeof define === 'function' && define.amd) {
define(function () {
define('load-image', function () {
return loadImage;
});
} else {
Expand Down