diff --git a/CHANGELOG.md b/CHANGELOG.md index 30299da..aa31cd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.0.11 (8 May 2020) +* fixed: issue with IE support [#38](https://github.com/Donaldcwl/browser-image-compression/issues/38) [#23](https://github.com/Donaldcwl/browser-image-compression/issues/23) + ## v1.0.10 (7 May 2020) * fixed: issue in Web Worker when onProgress is undefined [#50](https://github.com/Donaldcwl/browser-image-compression/issues/50) * fixed: handle behavior change of exif orientation in iOS 13.4.1 and Safari 13.1 Desktop [#52](https://github.com/Donaldcwl/browser-image-compression/issues/52) diff --git a/README.md b/README.md index ff45021..26018c3 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,16 @@ or check the "[example]" folder in this repo | --------- | --------- | --------- | --------- | --------- | --------- | | IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions| last 2 versions +## IE support ## +Promise API is being used in this library. If you need to support browser that do not support Promise like IE. You can include the Promise polyfill in your project. + +See: https://github.com/taylorhakes/promise-polyfill + +You can include the following script to load the Promise polyfill: +```html + +``` + ## Typescript type definitions ## ``` npm install --save-dev @types/browser-image-compression diff --git a/example/basic.html b/example/basic.html index 10c3fa1..17fb023 100644 --- a/example/basic.html +++ b/example/basic.html @@ -51,7 +51,7 @@ + diff --git a/example/development.html b/example/development.html index b9d4548..1d71536 100644 --- a/example/development.html +++ b/example/development.html @@ -51,7 +51,7 @@ + diff --git a/lib/utils.js b/lib/utils.js index 2bca4a8..811d6e1 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -210,7 +210,7 @@ export function handleMaxWidthOrHeight (canvas, options) { const height = canvas.height const maxWidthOrHeight = options.maxWidthOrHeight - const needToHandle = Number.isFinite(maxWidthOrHeight) && (width > maxWidthOrHeight || height > maxWidthOrHeight) + const needToHandle = isFinite(maxWidthOrHeight) && (width > maxWidthOrHeight || height > maxWidthOrHeight) let newCanvas = canvas let ctx diff --git a/lib/web-worker.js b/lib/web-worker.js index 2e2afb4..52e9a40 100644 --- a/lib/web-worker.js +++ b/lib/web-worker.js @@ -109,6 +109,8 @@ export function compressOnWebWorker (file, options) { } worker.addEventListener('message', handler) + worker.addEventListener('error', reject) + worker.postMessage({ file, id,