From 9df2ebc5d48397af4242e69b3449b03ed53e4ce8 Mon Sep 17 00:00:00 2001 From: ruscoder Date: Tue, 19 Jan 2016 12:38:30 +0700 Subject: [PATCH 1/2] Added require support --- index.js | 1 + package.json | 1 + 2 files changed, 2 insertions(+) create mode 100644 index.js diff --git a/index.js b/index.js new file mode 100644 index 0000000..ef4e3e8 --- /dev/null +++ b/index.js @@ -0,0 +1 @@ +module.exports = require('./js/load-image'); diff --git a/package.json b/package.json index 4630a0b..45e0217 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "blueimp-load-image", "version": "2.1.0", + "main": "index.js", "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": [ From e2544488cba1cb2068c026c534fb66c8857e1bc3 Mon Sep 17 00:00:00 2001 From: ruscoder Date: Tue, 19 Jan 2016 16:25:58 +0700 Subject: [PATCH 2/2] Changed paths for define --- index.js | 6 ++++++ js/load-image-exif-map.js | 2 +- js/load-image-exif.js | 2 +- js/load-image-ios.js | 2 +- js/load-image-meta.js | 2 +- js/load-image-orientation.js | 2 +- 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index ef4e3e8..a6ae008 100644 --- a/index.js +++ b/index.js @@ -1 +1,7 @@ module.exports = require('./js/load-image'); + +require('./js/load-image-exif'); +require('./js/load-image-exif-map'); +require('./js/load-image-ios'); +require('./js/load-image-meta'); +require('./js/load-image-orientation'); diff --git a/js/load-image-exif-map.js b/js/load-image-exif-map.js index f96cbd9..7818650 100644 --- a/js/load-image-exif-map.js +++ b/js/load-image-exif-map.js @@ -18,7 +18,7 @@ 'use strict'; if (typeof define === 'function' && define.amd) { // Register as an anonymous AMD module: - define(['load-image', 'load-image-exif'], factory); + define(['./load-image', './load-image-exif'], factory); } else if (typeof module === 'object' && module.exports) { factory(require('./load-image'), require('./load-image-exif')); } else { diff --git a/js/load-image-exif.js b/js/load-image-exif.js index 6b56d1f..6e9bd69 100644 --- a/js/load-image-exif.js +++ b/js/load-image-exif.js @@ -15,7 +15,7 @@ 'use strict'; if (typeof define === 'function' && define.amd) { // Register as an anonymous AMD module: - define(['load-image', 'load-image-meta'], factory); + define(['./load-image', './load-image-meta'], factory); } else if (typeof module === 'object' && module.exports) { factory(require('./load-image'), require('./load-image-meta')); } else { diff --git a/js/load-image-ios.js b/js/load-image-ios.js index f12573e..0818d4b 100644 --- a/js/load-image-ios.js +++ b/js/load-image-ios.js @@ -19,7 +19,7 @@ 'use strict'; if (typeof define === 'function' && define.amd) { // Register as an anonymous AMD module: - define(['load-image'], factory); + define(['./load-image'], factory); } else if (typeof module === 'object' && module.exports) { factory(require('./load-image')); } else { diff --git a/js/load-image-meta.js b/js/load-image-meta.js index d64d4b4..e257d48 100644 --- a/js/load-image-meta.js +++ b/js/load-image-meta.js @@ -19,7 +19,7 @@ 'use strict'; if (typeof define === 'function' && define.amd) { // Register as an anonymous AMD module: - define(['load-image'], factory); + define(['./load-image'], factory); } else if (typeof module === 'object' && module.exports) { factory(require('./load-image')); } else { diff --git a/js/load-image-orientation.js b/js/load-image-orientation.js index 83c7675..370b091 100644 --- a/js/load-image-orientation.js +++ b/js/load-image-orientation.js @@ -15,7 +15,7 @@ 'use strict'; if (typeof define === 'function' && define.amd) { // Register as an anonymous AMD module: - define(['load-image'], factory); + define(['./load-image'], factory); } else if (typeof module === 'object' && module.exports) { factory(require('./load-image')); } else {