Skip to content

Commit

Permalink
Merge pull request #115 from Donaldcwl/dev
Browse files Browse the repository at this point in the history
Release 1.0.15
  • Loading branch information
Donaldcwl authored Aug 11, 2021
2 parents 3c41eb9 + bd9c9d5 commit d1fb088
Show file tree
Hide file tree
Showing 42 changed files with 4,121 additions and 7,475 deletions.
4 changes: 3 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"presets": [
["@babel/preset-env", {
"useBuiltIns": "usage",
"corejs": "3",
"targets": {
"browsers": ["> 0.25%", "not dead"]
"browsers": ["> 5%", "ie 10-11", "not dead"]
}
}]
],
Expand Down
10 changes: 0 additions & 10 deletions .eslintrc

This file was deleted.

16 changes: 16 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
env: {
browser: true,
},
extends: [
'airbnb-base',
],
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',
},
rules: {
'max-len': ['warn', { code: 150 }],
},
ignorePatterns: ['dist'],
};
12 changes: 9 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v1.0.15 (12 Aug 2021)
* fixed: Fixed black Images and type error by considering Canvas maximum size supported by different browsers [#84](https://github.com/Donaldcwl/browser-image-compression/issues/84), [#36](https://github.com/Donaldcwl/browser-image-compression/issues/36)
* fixed: IE compatibility, include polyfill with core-js@3 e.g, globalThis, Promise [#108](https://github.com/Donaldcwl/browser-image-compression/issues/108), [#110](https://github.com/Donaldcwl/browser-image-compression/issues/110)
* fixed: Test suites in few projects may have error, added extra checking on whether File and FileReader exist in the Window object [#92](https://github.com/Donaldcwl/browser-image-compression/issues/92)
* fixed: issue with export causing compile error in typescript project [#63](https://github.com/Donaldcwl/browser-image-compression/issues/63)

## v1.0.14 (6 Jan 2021)
* updated: use UZIP to compress PNG image instead of Canvas
* fixed: PNG transparent background become black after compression [#84](https://github.com/Donaldcwl/browser-image-compression/issues/84), [#76](https://github.com/Donaldcwl/browser-image-compression/issues/76)
Expand All @@ -8,7 +14,7 @@
* fixed: options object being altered by the compress func [#71](https://github.com/Donaldcwl/browser-image-compression/pull/71)
* fixed: issue with output size of png compression [#57](https://github.com/Donaldcwl/browser-image-compression/issues/57)

## v1.0.12 (4 June 2020)
## v1.0.12 (4 Jun 2020)
* fixed: issue with SSR [#58](https://github.com/Donaldcwl/browser-image-compression/issues/58)

## v1.0.11 (8 May 2020)
Expand Down Expand Up @@ -37,10 +43,10 @@
* fixed: issue in IE browser
* fixed: other issues

## v1.0.6 (5 July 2019)
## v1.0.6 (5 Jul 2019)
* fixed: exif orientation do not work in some situations

## v1.0.5 (1 June 2019)
## v1.0.5 (1 Jun 2019)
* added: support for cordova project that uses cordova-plugin-file
* optimized: follow image exif orientation even though image do not required to compress or resize
* fixed: error may throw on iPhone Safari because of OffscreenCanvas cannot get 2d context
Expand Down
16 changes: 3 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ yarn add browser-image-compression
```
or use a CDN like [delivrjs]:
```
https://cdn.jsdelivr.net/npm/[email protected].14/dist/browser-image-compression.js
https://cdn.jsdelivr.net/npm/[email protected].15/dist/browser-image-compression.js
or
https://cdn.jsdelivr.net/npm/browser-image-compression@latest/dist/browser-image-compression.js
```
Expand All @@ -42,7 +42,7 @@ or

#### In html file ####
```html
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected].14/dist/browser-image-compression.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected].15/dist/browser-image-compression.js"></script>
```

## API ##
Expand Down Expand Up @@ -153,16 +153,6 @@ or check the "[example]" folder in this repo
## Remarks for compression to work in Web Worker
The browser need to support "OffscreenCanvas" API in order to take advantage of non-blocking compression. If browser do not support "OffscreenCanvas" API, main thread is used instead. See https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas#browser_compatibility for browser compatibility of "OffscreenCanvas" API.

## 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
<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"></script>
```

## Typescript type definitions ##
Typescript definitions are included in the package & referenced in the `types` section of the `package.json`

Expand All @@ -174,7 +164,7 @@ Typescript definitions are included in the package & referenced in the `types` s
5. add/update test in test/ folder
6. `npm run test`
7. push to your forked repo on github
8. make a pull request to this repo
8. make a pull request to dev branch of this repo

[dist]: https://github.com/Donaldcwl/browser-image-compression/tree/master/dist
[example]: https://github.com/Donaldcwl/browser-image-compression/tree/master/example
Expand Down
2 changes: 1 addition & 1 deletion coverage/badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d1fb088

Please sign in to comment.