diff --git a/README.md b/README.md
index 5f930c9..38cafac 100644
--- a/README.md
+++ b/README.md
@@ -10,6 +10,9 @@ Javascript module to be run in the web browser for image compression.
- **Multi-thread** (web worker) non-blocking compression are supported through options.
## Change log ##
+v1.0.1
+- fixing bug related to wrong image output resolution in some case
+
v1.0.0
- breaking change: change "imageCompression" function signature
- use of OffscreenCanvas when support, fallback to document.createElement('canvas')
@@ -141,6 +144,16 @@ cd browser-image-compression/example
# open "basic.html" on your browser
```
+## Contribution ##
+1. fork the repo and git clone it
+2. run `npm run watch` # it will watch code change in lib/ folder and generate js in dist/ folder
+3. add/update code in lib/ folder
+4. try the code by opening example/development.html which will load the js in dist/ folder
+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
+
[dist]: https://github.com/Donaldcwl/browser-image-compression/tree/master/dist
[example]: https://github.com/Donaldcwl/browser-image-compression/tree/master/example
[delivrjs]: https://cdn.jsdelivr.net/
diff --git a/coverage/badge.svg b/coverage/badge.svg
index 46a1b56..606cf04 100644
--- a/coverage/badge.svg
+++ b/coverage/badge.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/coverage/coverage-final.json b/coverage/coverage-final.json
index 1381e4d..7603b4a 100644
--- a/coverage/coverage-final.json
+++ b/coverage/coverage-final.json
@@ -1,4 +1,4 @@
-{"/Users/donald/Project/browser-image-compression/lib/image-compression.js": {"path":"/Users/donald/Project/browser-image-compression/lib/image-compression.js","statementMap":{"0":{"start":{"line":15,"column":24},"end":{"line":15,"column":50}},"1":{"start":{"line":17,"column":22},"end":{"line":17,"column":53}},"2":{"start":{"line":20,"column":2},"end":{"line":22,"column":3}},"3":{"start":{"line":21,"column":4},"end":{"line":21,"column":15}},"4":{"start":{"line":27,"column":13},"end":{"line":27,"column":41}},"5":{"start":{"line":28,"column":2},"end":{"line":28,"column":15}},"6":{"start":{"line":29,"column":2},"end":{"line":29,"column":18}},"7":{"start":{"line":32,"column":14},"end":{"line":32,"column":58}},"8":{"start":{"line":33,"column":2},"end":{"line":33,"column":19}},"9":{"start":{"line":34,"column":2},"end":{"line":34,"column":22}},"10":{"start":{"line":36,"column":2},"end":{"line":38,"column":3}},"11":{"start":{"line":37,"column":4},"end":{"line":37,"column":15}},"12":{"start":{"line":41,"column":2},"end":{"line":41,"column":85}},"13":{"start":{"line":42,"column":2},"end":{"line":42,"column":70}},"14":{"start":{"line":44,"column":16},"end":{"line":44,"column":17}},"15":{"start":{"line":45,"column":23},"end":{"line":45,"column":99}},"16":{"start":{"line":46,"column":2},"end":{"line":67,"column":3}},"17":{"start":{"line":47,"column":4},"end":{"line":55,"column":5}},"18":{"start":{"line":48,"column":6},"end":{"line":48,"column":25}},"19":{"start":{"line":49,"column":6},"end":{"line":49,"column":26}},"20":{"start":{"line":51,"column":18},"end":{"line":51,"column":41}},"21":{"start":{"line":52,"column":6},"end":{"line":52,"column":59}},"22":{"start":{"line":54,"column":6},"end":{"line":54,"column":99}},"23":{"start":{"line":57,"column":4},"end":{"line":66,"column":5}},"24":{"start":{"line":58,"column":6},"end":{"line":58,"column":25}},"25":{"start":{"line":59,"column":6},"end":{"line":59,"column":26}},"26":{"start":{"line":61,"column":18},"end":{"line":61,"column":41}},"27":{"start":{"line":62,"column":6},"end":{"line":62,"column":59}},"28":{"start":{"line":64,"column":6},"end":{"line":64,"column":20}},"29":{"start":{"line":65,"column":6},"end":{"line":65,"column":99}},"30":{"start":{"line":69,"column":2},"end":{"line":69,"column":23}}},"fnMap":{"0":{"name":"compress","decl":{"start":{"line":14,"column":30},"end":{"line":14,"column":38}},"loc":{"start":{"line":14,"column":55},"end":{"line":70,"column":1}},"line":14}},"branchMap":{"0":{"loc":{"start":{"line":15,"column":24},"end":{"line":15,"column":50}},"type":"binary-expr","locations":[{"start":{"line":15,"column":24},"end":{"line":15,"column":44}},{"start":{"line":15,"column":48},"end":{"line":15,"column":50}}],"line":15},"1":{"loc":{"start":{"line":20,"column":2},"end":{"line":22,"column":3}},"type":"if","locations":[{"start":{"line":20,"column":2},"end":{"line":22,"column":3}},{"start":{"line":20,"column":2},"end":{"line":22,"column":3}}],"line":20},"2":{"loc":{"start":{"line":20,"column":6},"end":{"line":20,"column":81}},"type":"binary-expr","locations":[{"start":{"line":20,"column":6},"end":{"line":20,"column":30}},{"start":{"line":20,"column":34},"end":{"line":20,"column":81}}],"line":20},"3":{"loc":{"start":{"line":36,"column":2},"end":{"line":38,"column":3}},"type":"if","locations":[{"start":{"line":36,"column":2},"end":{"line":38,"column":3}},{"start":{"line":36,"column":2},"end":{"line":38,"column":3}}],"line":36},"4":{"loc":{"start":{"line":36,"column":6},"end":{"line":36,"column":44}},"type":"binary-expr","locations":[{"start":{"line":36,"column":6},"end":{"line":36,"column":30}},{"start":{"line":36,"column":34},"end":{"line":36,"column":44}}],"line":36},"5":{"loc":{"start":{"line":41,"column":28},"end":{"line":41,"column":85}},"type":"binary-expr","locations":[{"start":{"line":41,"column":28},"end":{"line":41,"column":51}},{"start":{"line":41,"column":55},"end":{"line":41,"column":85}}],"line":41},"6":{"loc":{"start":{"line":46,"column":2},"end":{"line":67,"column":3}},"type":"if","locations":[{"start":{"line":46,"column":2},"end":{"line":67,"column":3}},{"start":{"line":46,"column":2},"end":{"line":67,"column":3}}],"line":46},"7":{"loc":{"start":{"line":47,"column":11},"end":{"line":47,"column":65}},"type":"binary-expr","locations":[{"start":{"line":47,"column":11},"end":{"line":47,"column":28}},{"start":{"line":47,"column":32},"end":{"line":47,"column":65}}],"line":47},"8":{"loc":{"start":{"line":57,"column":11},"end":{"line":57,"column":65}},"type":"binary-expr","locations":[{"start":{"line":57,"column":11},"end":{"line":57,"column":28}},{"start":{"line":57,"column":32},"end":{"line":57,"column":65}}],"line":57}},"s":{"0":2,"1":2,"2":2,"3":0,"4":2,"5":2,"6":2,"7":2,"8":2,"9":2,"10":2,"11":0,"12":2,"13":2,"14":2,"15":2,"16":2,"17":1,"18":5,"19":5,"20":5,"21":5,"22":5,"23":1,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":2},"f":{"0":2},"b":{"0":[2,2],"1":[0,2],"2":[2,0],"3":[0,2],"4":[2,0],"5":[2,0],"6":[1,1],"7":[6,6],"8":[1,1]},"_coverageSchema":"43e27e138ebf9cfc5966b082cf9a028302ed4184","hash":"beebf5b646233c5693357688f175a13472f43722","contentHash":"1aae39d6fc0b0b06d108acdaeda7f46c"}
-,"/Users/donald/Project/browser-image-compression/lib/index.js": {"path":"/Users/donald/Project/browser-image-compression/lib/index.js","statementMap":{"0":{"start":{"line":31,"column":2},"end":{"line":31,"column":67}},"1":{"start":{"line":32,"column":2},"end":{"line":32,"column":96}},"2":{"start":{"line":34,"column":2},"end":{"line":38,"column":3}},"3":{"start":{"line":35,"column":4},"end":{"line":35,"column":72}},"4":{"start":{"line":36,"column":9},"end":{"line":38,"column":3}},"5":{"start":{"line":37,"column":4},"end":{"line":37,"column":53}},"6":{"start":{"line":41,"column":22},"end":{"line":41,"column":99}},"7":{"start":{"line":49,"column":2},"end":{"line":59,"column":3}},"8":{"start":{"line":50,"column":4},"end":{"line":56,"column":5}},"9":{"start":{"line":52,"column":6},"end":{"line":52,"column":63}},"10":{"start":{"line":55,"column":6},"end":{"line":55,"column":52}},"11":{"start":{"line":58,"column":4},"end":{"line":58,"column":50}},"12":{"start":{"line":61,"column":2},"end":{"line":64,"column":16}},"13":{"start":{"line":62,"column":4},"end":{"line":62,"column":35}},"14":{"start":{"line":63,"column":4},"end":{"line":63,"column":51}},"15":{"start":{"line":66,"column":2},"end":{"line":66,"column":23}},"16":{"start":{"line":69,"column":0},"end":{"line":69,"column":56}},"17":{"start":{"line":70,"column":0},"end":{"line":70,"column":56}},"18":{"start":{"line":71,"column":0},"end":{"line":71,"column":38}},"19":{"start":{"line":72,"column":0},"end":{"line":72,"column":54}},"20":{"start":{"line":73,"column":0},"end":{"line":73,"column":52}},"21":{"start":{"line":74,"column":0},"end":{"line":74,"column":44}},"22":{"start":{"line":75,"column":0},"end":{"line":75,"column":56}},"23":{"start":{"line":76,"column":0},"end":{"line":76,"column":64}},"24":{"start":{"line":77,"column":0},"end":{"line":77,"column":62}}},"fnMap":{"0":{"name":"imageCompression","decl":{"start":{"line":27,"column":15},"end":{"line":27,"column":31}},"loc":{"start":{"line":27,"column":48},"end":{"line":67,"column":1}},"line":27}},"branchMap":{"0":{"loc":{"start":{"line":31,"column":22},"end":{"line":31,"column":67}},"type":"binary-expr","locations":[{"start":{"line":31,"column":22},"end":{"line":31,"column":39}},{"start":{"line":31,"column":43},"end":{"line":31,"column":67}}],"line":31},"1":{"loc":{"start":{"line":32,"column":25},"end":{"line":32,"column":96}},"type":"cond-expr","locations":[{"start":{"line":32,"column":69},"end":{"line":32,"column":89}},{"start":{"line":32,"column":92},"end":{"line":32,"column":96}}],"line":32},"2":{"loc":{"start":{"line":34,"column":2},"end":{"line":38,"column":3}},"type":"if","locations":[{"start":{"line":34,"column":2},"end":{"line":38,"column":3}},{"start":{"line":34,"column":2},"end":{"line":38,"column":3}}],"line":34},"3":{"loc":{"start":{"line":34,"column":8},"end":{"line":34,"column":52}},"type":"binary-expr","locations":[{"start":{"line":34,"column":8},"end":{"line":34,"column":28}},{"start":{"line":34,"column":32},"end":{"line":34,"column":52}}],"line":34},"4":{"loc":{"start":{"line":36,"column":9},"end":{"line":38,"column":3}},"type":"if","locations":[{"start":{"line":36,"column":9},"end":{"line":38,"column":3}},{"start":{"line":36,"column":9},"end":{"line":38,"column":3}}],"line":36},"5":{"loc":{"start":{"line":41,"column":22},"end":{"line":41,"column":99}},"type":"binary-expr","locations":[{"start":{"line":41,"column":22},"end":{"line":41,"column":62}},{"start":{"line":41,"column":66},"end":{"line":41,"column":99}}],"line":41},"6":{"loc":{"start":{"line":49,"column":2},"end":{"line":59,"column":3}},"type":"if","locations":[{"start":{"line":49,"column":2},"end":{"line":59,"column":3}},{"start":{"line":49,"column":2},"end":{"line":59,"column":3}}],"line":49},"7":{"loc":{"start":{"line":49,"column":6},"end":{"line":49,"column":74}},"type":"binary-expr","locations":[{"start":{"line":49,"column":6},"end":{"line":49,"column":26}},{"start":{"line":49,"column":30},"end":{"line":49,"column":58}},{"start":{"line":49,"column":62},"end":{"line":49,"column":74}}],"line":49}},"s":{"0":5,"1":5,"2":5,"3":2,"4":3,"5":1,"6":2,"7":2,"8":0,"9":0,"10":0,"11":2,"12":2,"13":2,"14":2,"15":2,"16":1,"17":1,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":1},"f":{"0":5},"b":{"0":[5,0],"1":[5,0],"2":[2,3],"3":[5,5],"4":[1,2],"5":[2,0],"6":[0,2],"7":[2,0,0]},"_coverageSchema":"43e27e138ebf9cfc5966b082cf9a028302ed4184","hash":"c6faf098a3ae71adbc865c5284132f0b67861195","contentHash":"ca857e27e9624169077901ec50dd53e3"}
-,"/Users/donald/Project/browser-image-compression/lib/utils.js": {"path":"/Users/donald/Project/browser-image-compression/lib/utils.js","statementMap":{"0":{"start":{"line":8,"column":2},"end":{"line":13,"column":4}},"1":{"start":{"line":9,"column":19},"end":{"line":9,"column":35}},"2":{"start":{"line":10,"column":4},"end":{"line":10,"column":48}},"3":{"start":{"line":10,"column":26},"end":{"line":10,"column":48}},"4":{"start":{"line":11,"column":4},"end":{"line":11,"column":37}},"5":{"start":{"line":11,"column":28},"end":{"line":11,"column":37}},"6":{"start":{"line":12,"column":4},"end":{"line":12,"column":30}},"7":{"start":{"line":25,"column":2},"end":{"line":43,"column":4}},"8":{"start":{"line":26,"column":16},"end":{"line":26,"column":34}},"9":{"start":{"line":27,"column":17},"end":{"line":27,"column":43}},"10":{"start":{"line":28,"column":17},"end":{"line":28,"column":29}},"11":{"start":{"line":29,"column":12},"end":{"line":29,"column":23}},"12":{"start":{"line":30,"column":18},"end":{"line":30,"column":35}},"13":{"start":{"line":31,"column":4},"end":{"line":33,"column":5}},"14":{"start":{"line":32,"column":6},"end":{"line":32,"column":35}},"15":{"start":{"line":35,"column":4},"end":{"line":41,"column":5}},"16":{"start":{"line":36,"column":6},"end":{"line":36,"column":56}},"17":{"start":{"line":38,"column":6},"end":{"line":38,"column":46}},"18":{"start":{"line":39,"column":6},"end":{"line":39,"column":26}},"19":{"start":{"line":40,"column":6},"end":{"line":40,"column":38}},"20":{"start":{"line":42,"column":4},"end":{"line":42,"column":17}},"21":{"start":{"line":53,"column":2},"end":{"line":58,"column":4}},"22":{"start":{"line":54,"column":16},"end":{"line":54,"column":27}},"23":{"start":{"line":55,"column":4},"end":{"line":55,"column":35}},"24":{"start":{"line":55,"column":23},"end":{"line":55,"column":35}},"25":{"start":{"line":56,"column":4},"end":{"line":56,"column":34}},"26":{"start":{"line":56,"column":25},"end":{"line":56,"column":34}},"27":{"start":{"line":57,"column":4},"end":{"line":57,"column":17}},"28":{"start":{"line":69,"column":2},"end":{"line":73,"column":3}},"29":{"start":{"line":70,"column":4},"end":{"line":70,"column":55}},"30":{"start":{"line":72,"column":4},"end":{"line":72,"column":45}},"31":{"start":{"line":74,"column":14},"end":{"line":74,"column":37}},"32":{"start":{"line":75,"column":2},"end":{"line":75,"column":55}},"33":{"start":{"line":76,"column":2},"end":{"line":76,"column":15}},"34":{"start":{"line":87,"column":2},"end":{"line":92,"column":3}},"35":{"start":{"line":88,"column":4},"end":{"line":88,"column":39}},"36":{"start":{"line":90,"column":20},"end":{"line":90,"column":50}},"37":{"start":{"line":91,"column":4},"end":{"line":91,"column":34}},"38":{"start":{"line":93,"column":17},"end":{"line":93,"column":39}},"39":{"start":{"line":94,"column":2},"end":{"line":94,"column":22}},"40":{"start":{"line":109,"column":2},"end":{"line":116,"column":3}},"41":{"start":{"line":110,"column":4},"end":{"line":110,"column":76}},"42":{"start":{"line":111,"column":4},"end":{"line":111,"column":34}},"43":{"start":{"line":112,"column":4},"end":{"line":112,"column":50}},"44":{"start":{"line":114,"column":20},"end":{"line":114,"column":55}},"45":{"start":{"line":115,"column":4},"end":{"line":115,"column":82}},"46":{"start":{"line":117,"column":2},"end":{"line":117,"column":23}},"47":{"start":{"line":129,"column":2},"end":{"line":166,"column":4}},"48":{"start":{"line":130,"column":19},"end":{"line":130,"column":35}},"49":{"start":{"line":131,"column":4},"end":{"line":163,"column":5}},"50":{"start":{"line":132,"column":19},"end":{"line":132,"column":48}},"51":{"start":{"line":133,"column":6},"end":{"line":135,"column":7}},"52":{"start":{"line":134,"column":8},"end":{"line":134,"column":26}},"53":{"start":{"line":136,"column":21},"end":{"line":136,"column":36}},"54":{"start":{"line":137,"column":19},"end":{"line":137,"column":20}},"55":{"start":{"line":138,"column":6},"end":{"line":161,"column":7}},"56":{"start":{"line":139,"column":8},"end":{"line":139,"column":70}},"57":{"start":{"line":139,"column":52},"end":{"line":139,"column":70}},"58":{"start":{"line":140,"column":23},"end":{"line":140,"column":52}},"59":{"start":{"line":141,"column":8},"end":{"line":141,"column":19}},"60":{"start":{"line":142,"column":8},"end":{"line":160,"column":9}},"61":{"start":{"line":143,"column":10},"end":{"line":145,"column":11}},"62":{"start":{"line":144,"column":12},"end":{"line":144,"column":30}},"63":{"start":{"line":147,"column":23},"end":{"line":147,"column":67}},"64":{"start":{"line":148,"column":10},"end":{"line":148,"column":54}},"65":{"start":{"line":149,"column":21},"end":{"line":149,"column":51}},"66":{"start":{"line":150,"column":10},"end":{"line":150,"column":21}},"67":{"start":{"line":151,"column":10},"end":{"line":155,"column":11}},"68":{"start":{"line":152,"column":12},"end":{"line":154,"column":13}},"69":{"start":{"line":153,"column":14},"end":{"line":153,"column":75}},"70":{"start":{"line":156,"column":15},"end":{"line":160,"column":9}},"71":{"start":{"line":157,"column":10},"end":{"line":157,"column":15}},"72":{"start":{"line":159,"column":10},"end":{"line":159,"column":49}},"73":{"start":{"line":162,"column":6},"end":{"line":162,"column":24}},"74":{"start":{"line":164,"column":4},"end":{"line":164,"column":37}},"75":{"start":{"line":164,"column":28},"end":{"line":164,"column":37}},"76":{"start":{"line":165,"column":4},"end":{"line":165,"column":34}},"77":{"start":{"line":177,"column":14},"end":{"line":177,"column":37}},"78":{"start":{"line":179,"column":27},"end":{"line":179,"column":51}},"79":{"start":{"line":180,"column":23},"end":{"line":180,"column":124}},"80":{"start":{"line":181,"column":2},"end":{"line":192,"column":3}},"81":{"start":{"line":182,"column":4},"end":{"line":188,"column":5}},"82":{"start":{"line":183,"column":6},"end":{"line":183,"column":37}},"83":{"start":{"line":184,"column":6},"end":{"line":184,"column":65}},"84":{"start":{"line":186,"column":6},"end":{"line":186,"column":64}},"85":{"start":{"line":187,"column":6},"end":{"line":187,"column":38}},"86":{"start":{"line":190,"column":4},"end":{"line":190,"column":28}},"87":{"start":{"line":191,"column":4},"end":{"line":191,"column":30}},"88":{"start":{"line":194,"column":2},"end":{"line":194,"column":55}},"89":{"start":{"line":195,"column":2},"end":{"line":195,"column":31}},"90":{"start":{"line":208,"column":14},"end":{"line":208,"column":37}},"91":{"start":{"line":210,"column":16},"end":{"line":210,"column":25}},"92":{"start":{"line":211,"column":17},"end":{"line":211,"column":27}},"93":{"start":{"line":214,"column":2},"end":{"line":220,"column":3}},"94":{"start":{"line":215,"column":4},"end":{"line":215,"column":25}},"95":{"start":{"line":216,"column":4},"end":{"line":216,"column":25}},"96":{"start":{"line":218,"column":4},"end":{"line":218,"column":24}},"97":{"start":{"line":219,"column":4},"end":{"line":219,"column":26}},"98":{"start":{"line":223,"column":2},"end":{"line":232,"column":3}},"99":{"start":{"line":224,"column":12},"end":{"line":224,"column":49}},"100":{"start":{"line":224,"column":50},"end":{"line":224,"column":56}},"101":{"start":{"line":225,"column":12},"end":{"line":225,"column":55}},"102":{"start":{"line":225,"column":56},"end":{"line":225,"column":62}},"103":{"start":{"line":226,"column":12},"end":{"line":226,"column":50}},"104":{"start":{"line":226,"column":51},"end":{"line":226,"column":57}},"105":{"start":{"line":227,"column":12},"end":{"line":227,"column":44}},"106":{"start":{"line":227,"column":45},"end":{"line":227,"column":51}},"107":{"start":{"line":228,"column":12},"end":{"line":228,"column":50}},"108":{"start":{"line":228,"column":51},"end":{"line":228,"column":57}},"109":{"start":{"line":229,"column":12},"end":{"line":229,"column":55}},"110":{"start":{"line":229,"column":56},"end":{"line":229,"column":62}},"111":{"start":{"line":230,"column":12},"end":{"line":230,"column":49}},"112":{"start":{"line":230,"column":50},"end":{"line":230,"column":56}},"113":{"start":{"line":231,"column":13},"end":{"line":231,"column":19}},"114":{"start":{"line":234,"column":2},"end":{"line":234,"column":26}},"115":{"start":{"line":236,"column":2},"end":{"line":236,"column":15}}},"fnMap":{"0":{"name":"getDataUrlFromFile","decl":{"start":{"line":7,"column":16},"end":{"line":7,"column":34}},"loc":{"start":{"line":7,"column":42},"end":{"line":14,"column":1}},"line":7},"1":{"name":"(anonymous_1)","decl":{"start":{"line":8,"column":21},"end":{"line":8,"column":22}},"loc":{"start":{"line":8,"column":42},"end":{"line":13,"column":3}},"line":8},"2":{"name":"(anonymous_2)","decl":{"start":{"line":10,"column":20},"end":{"line":10,"column":21}},"loc":{"start":{"line":10,"column":26},"end":{"line":10,"column":48}},"line":10},"3":{"name":"(anonymous_3)","decl":{"start":{"line":11,"column":21},"end":{"line":11,"column":22}},"loc":{"start":{"line":11,"column":28},"end":{"line":11,"column":37}},"line":11},"4":{"name":"getFilefromDataUrl","decl":{"start":{"line":24,"column":16},"end":{"line":24,"column":34}},"loc":{"start":{"line":24,"column":82},"end":{"line":44,"column":1}},"line":24},"5":{"name":"(anonymous_5)","decl":{"start":{"line":25,"column":21},"end":{"line":25,"column":22}},"loc":{"start":{"line":25,"column":34},"end":{"line":43,"column":3}},"line":25},"6":{"name":"loadImage","decl":{"start":{"line":52,"column":16},"end":{"line":52,"column":25}},"loc":{"start":{"line":52,"column":32},"end":{"line":59,"column":1}},"line":52},"7":{"name":"(anonymous_7)","decl":{"start":{"line":53,"column":21},"end":{"line":53,"column":22}},"loc":{"start":{"line":53,"column":42},"end":{"line":58,"column":3}},"line":53},"8":{"name":"(anonymous_8)","decl":{"start":{"line":55,"column":17},"end":{"line":55,"column":18}},"loc":{"start":{"line":55,"column":23},"end":{"line":55,"column":35}},"line":55},"9":{"name":"(anonymous_9)","decl":{"start":{"line":56,"column":18},"end":{"line":56,"column":19}},"loc":{"start":{"line":56,"column":25},"end":{"line":56,"column":34}},"line":56},"10":{"name":"drawImageInCanvas","decl":{"start":{"line":67,"column":16},"end":{"line":67,"column":33}},"loc":{"start":{"line":67,"column":40},"end":{"line":77,"column":1}},"line":67},"11":{"name":"drawFileInCanvas","decl":{"start":{"line":85,"column":22},"end":{"line":85,"column":38}},"loc":{"start":{"line":85,"column":46},"end":{"line":95,"column":1}},"line":85},"12":{"name":"canvasToFile","decl":{"start":{"line":107,"column":22},"end":{"line":107,"column":34}},"loc":{"start":{"line":107,"column":95},"end":{"line":118,"column":1}},"line":107},"13":{"name":"getExifOrientation","decl":{"start":{"line":128,"column":16},"end":{"line":128,"column":34}},"loc":{"start":{"line":128,"column":42},"end":{"line":167,"column":1}},"line":128},"14":{"name":"(anonymous_14)","decl":{"start":{"line":129,"column":21},"end":{"line":129,"column":22}},"loc":{"start":{"line":129,"column":42},"end":{"line":166,"column":3}},"line":129},"15":{"name":"(anonymous_15)","decl":{"start":{"line":131,"column":20},"end":{"line":131,"column":21}},"loc":{"start":{"line":131,"column":27},"end":{"line":163,"column":5}},"line":131},"16":{"name":"(anonymous_16)","decl":{"start":{"line":164,"column":21},"end":{"line":164,"column":22}},"loc":{"start":{"line":164,"column":28},"end":{"line":164,"column":37}},"line":164},"17":{"name":"handleMaxWidthOrHeight","decl":{"start":{"line":176,"column":16},"end":{"line":176,"column":38}},"loc":{"start":{"line":176,"column":62},"end":{"line":196,"column":1}},"line":176},"18":{"name":"followExifOrientation","decl":{"start":{"line":207,"column":16},"end":{"line":207,"column":37}},"loc":{"start":{"line":207,"column":69},"end":{"line":237,"column":1}},"line":207}},"branchMap":{"0":{"loc":{"start":{"line":24,"column":55},"end":{"line":24,"column":80}},"type":"default-arg","locations":[{"start":{"line":24,"column":70},"end":{"line":24,"column":80}}],"line":24},"1":{"loc":{"start":{"line":69,"column":2},"end":{"line":73,"column":3}},"type":"if","locations":[{"start":{"line":69,"column":2},"end":{"line":73,"column":3}},{"start":{"line":69,"column":2},"end":{"line":73,"column":3}}],"line":69},"2":{"loc":{"start":{"line":107,"column":82},"end":{"line":107,"column":93}},"type":"default-arg","locations":[{"start":{"line":107,"column":92},"end":{"line":107,"column":93}}],"line":107},"3":{"loc":{"start":{"line":109,"column":2},"end":{"line":116,"column":3}},"type":"if","locations":[{"start":{"line":109,"column":2},"end":{"line":116,"column":3}},{"start":{"line":109,"column":2},"end":{"line":116,"column":3}}],"line":109},"4":{"loc":{"start":{"line":109,"column":6},"end":{"line":109,"column":80}},"type":"binary-expr","locations":[{"start":{"line":109,"column":6},"end":{"line":109,"column":43}},{"start":{"line":109,"column":47},"end":{"line":109,"column":80}}],"line":109},"5":{"loc":{"start":{"line":133,"column":6},"end":{"line":135,"column":7}},"type":"if","locations":[{"start":{"line":133,"column":6},"end":{"line":135,"column":7}},{"start":{"line":133,"column":6},"end":{"line":135,"column":7}}],"line":133},"6":{"loc":{"start":{"line":139,"column":8},"end":{"line":139,"column":70}},"type":"if","locations":[{"start":{"line":139,"column":8},"end":{"line":139,"column":70}},{"start":{"line":139,"column":8},"end":{"line":139,"column":70}}],"line":139},"7":{"loc":{"start":{"line":142,"column":8},"end":{"line":160,"column":9}},"type":"if","locations":[{"start":{"line":142,"column":8},"end":{"line":160,"column":9}},{"start":{"line":142,"column":8},"end":{"line":160,"column":9}}],"line":142},"8":{"loc":{"start":{"line":143,"column":10},"end":{"line":145,"column":11}},"type":"if","locations":[{"start":{"line":143,"column":10},"end":{"line":145,"column":11}},{"start":{"line":143,"column":10},"end":{"line":145,"column":11}}],"line":143},"9":{"loc":{"start":{"line":152,"column":12},"end":{"line":154,"column":13}},"type":"if","locations":[{"start":{"line":152,"column":12},"end":{"line":154,"column":13}},{"start":{"line":152,"column":12},"end":{"line":154,"column":13}}],"line":152},"10":{"loc":{"start":{"line":156,"column":15},"end":{"line":160,"column":9}},"type":"if","locations":[{"start":{"line":156,"column":15},"end":{"line":160,"column":9}},{"start":{"line":156,"column":15},"end":{"line":160,"column":9}}],"line":156},"11":{"loc":{"start":{"line":180,"column":23},"end":{"line":180,"column":124}},"type":"binary-expr","locations":[{"start":{"line":180,"column":23},"end":{"line":180,"column":57}},{"start":{"line":180,"column":62},"end":{"line":180,"column":90}},{"start":{"line":180,"column":94},"end":{"line":180,"column":123}}],"line":180},"12":{"loc":{"start":{"line":181,"column":2},"end":{"line":192,"column":3}},"type":"if","locations":[{"start":{"line":181,"column":2},"end":{"line":192,"column":3}},{"start":{"line":181,"column":2},"end":{"line":192,"column":3}}],"line":181},"13":{"loc":{"start":{"line":182,"column":4},"end":{"line":188,"column":5}},"type":"if","locations":[{"start":{"line":182,"column":4},"end":{"line":188,"column":5}},{"start":{"line":182,"column":4},"end":{"line":188,"column":5}}],"line":182},"14":{"loc":{"start":{"line":214,"column":2},"end":{"line":220,"column":3}},"type":"if","locations":[{"start":{"line":214,"column":2},"end":{"line":220,"column":3}},{"start":{"line":214,"column":2},"end":{"line":220,"column":3}}],"line":214},"15":{"loc":{"start":{"line":214,"column":6},"end":{"line":214,"column":48}},"type":"binary-expr","locations":[{"start":{"line":214,"column":6},"end":{"line":214,"column":25}},{"start":{"line":214,"column":29},"end":{"line":214,"column":48}}],"line":214},"16":{"loc":{"start":{"line":223,"column":2},"end":{"line":232,"column":3}},"type":"switch","locations":[{"start":{"line":224,"column":4},"end":{"line":224,"column":56}},{"start":{"line":225,"column":4},"end":{"line":225,"column":62}},{"start":{"line":226,"column":4},"end":{"line":226,"column":57}},{"start":{"line":227,"column":4},"end":{"line":227,"column":51}},{"start":{"line":228,"column":4},"end":{"line":228,"column":57}},{"start":{"line":229,"column":4},"end":{"line":229,"column":62}},{"start":{"line":230,"column":4},"end":{"line":230,"column":56}},{"start":{"line":231,"column":4},"end":{"line":231,"column":19}}],"line":223}},"s":{"0":4,"1":4,"2":4,"3":4,"4":4,"5":0,"6":4,"7":8,"8":8,"9":8,"10":8,"11":8,"12":8,"13":8,"14":11825174,"15":8,"16":8,"17":7,"18":7,"19":7,"20":8,"21":5,"22":5,"23":5,"24":5,"25":5,"26":0,"27":5,"28":4,"29":0,"30":4,"31":4,"32":4,"33":4,"34":3,"35":3,"36":3,"37":3,"38":3,"39":3,"40":7,"41":0,"42":0,"43":0,"44":7,"45":7,"46":7,"47":1,"48":1,"49":1,"50":1,"51":1,"52":1,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":1,"75":0,"76":1,"77":2,"78":2,"79":2,"80":2,"81":0,"82":0,"83":0,"84":0,"85":0,"86":2,"87":2,"88":2,"89":2,"90":2,"91":2,"92":2,"93":2,"94":0,"95":0,"96":2,"97":2,"98":2,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":2,"114":2,"115":2},"f":{"0":4,"1":4,"2":4,"3":0,"4":8,"5":8,"6":5,"7":5,"8":5,"9":0,"10":4,"11":3,"12":7,"13":1,"14":1,"15":1,"16":0,"17":2,"18":2},"b":{"0":[8],"1":[0,4],"2":[0],"3":[0,7],"4":[7,0],"5":[1,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[2,0,0],"12":[0,2],"13":[0,0],"14":[0,2],"15":[2,0],"16":[0,0,0,0,0,0,0,2]},"_coverageSchema":"43e27e138ebf9cfc5966b082cf9a028302ed4184","hash":"a607eca64dbde11b3f11f4c3455396fbac241119","contentHash":"959705d371a0eae7e2a6bb5448fc98ee"}
+{"/Users/donald/Project/browser-image-compression/lib/image-compression.js": {"path":"/Users/donald/Project/browser-image-compression/lib/image-compression.js","statementMap":{"0":{"start":{"line":15,"column":24},"end":{"line":15,"column":50}},"1":{"start":{"line":17,"column":22},"end":{"line":17,"column":53}},"2":{"start":{"line":20,"column":2},"end":{"line":22,"column":3}},"3":{"start":{"line":21,"column":4},"end":{"line":21,"column":15}},"4":{"start":{"line":27,"column":13},"end":{"line":27,"column":41}},"5":{"start":{"line":28,"column":2},"end":{"line":28,"column":15}},"6":{"start":{"line":29,"column":2},"end":{"line":29,"column":18}},"7":{"start":{"line":32,"column":14},"end":{"line":32,"column":58}},"8":{"start":{"line":33,"column":2},"end":{"line":33,"column":19}},"9":{"start":{"line":34,"column":2},"end":{"line":34,"column":22}},"10":{"start":{"line":36,"column":2},"end":{"line":38,"column":3}},"11":{"start":{"line":37,"column":4},"end":{"line":37,"column":15}},"12":{"start":{"line":41,"column":2},"end":{"line":41,"column":85}},"13":{"start":{"line":42,"column":2},"end":{"line":42,"column":70}},"14":{"start":{"line":44,"column":16},"end":{"line":44,"column":17}},"15":{"start":{"line":45,"column":23},"end":{"line":45,"column":99}},"16":{"start":{"line":46,"column":2},"end":{"line":67,"column":3}},"17":{"start":{"line":47,"column":4},"end":{"line":55,"column":5}},"18":{"start":{"line":48,"column":6},"end":{"line":48,"column":25}},"19":{"start":{"line":49,"column":6},"end":{"line":49,"column":26}},"20":{"start":{"line":51,"column":18},"end":{"line":51,"column":41}},"21":{"start":{"line":52,"column":6},"end":{"line":52,"column":59}},"22":{"start":{"line":54,"column":6},"end":{"line":54,"column":99}},"23":{"start":{"line":57,"column":4},"end":{"line":66,"column":5}},"24":{"start":{"line":58,"column":6},"end":{"line":58,"column":25}},"25":{"start":{"line":59,"column":6},"end":{"line":59,"column":26}},"26":{"start":{"line":61,"column":18},"end":{"line":61,"column":41}},"27":{"start":{"line":62,"column":6},"end":{"line":62,"column":59}},"28":{"start":{"line":64,"column":6},"end":{"line":64,"column":20}},"29":{"start":{"line":65,"column":6},"end":{"line":65,"column":99}},"30":{"start":{"line":69,"column":2},"end":{"line":69,"column":23}}},"fnMap":{"0":{"name":"compress","decl":{"start":{"line":14,"column":30},"end":{"line":14,"column":38}},"loc":{"start":{"line":14,"column":55},"end":{"line":70,"column":1}},"line":14}},"branchMap":{"0":{"loc":{"start":{"line":15,"column":24},"end":{"line":15,"column":50}},"type":"binary-expr","locations":[{"start":{"line":15,"column":24},"end":{"line":15,"column":44}},{"start":{"line":15,"column":48},"end":{"line":15,"column":50}}],"line":15},"1":{"loc":{"start":{"line":20,"column":2},"end":{"line":22,"column":3}},"type":"if","locations":[{"start":{"line":20,"column":2},"end":{"line":22,"column":3}},{"start":{"line":20,"column":2},"end":{"line":22,"column":3}}],"line":20},"2":{"loc":{"start":{"line":20,"column":6},"end":{"line":20,"column":81}},"type":"binary-expr","locations":[{"start":{"line":20,"column":6},"end":{"line":20,"column":30}},{"start":{"line":20,"column":34},"end":{"line":20,"column":81}}],"line":20},"3":{"loc":{"start":{"line":36,"column":2},"end":{"line":38,"column":3}},"type":"if","locations":[{"start":{"line":36,"column":2},"end":{"line":38,"column":3}},{"start":{"line":36,"column":2},"end":{"line":38,"column":3}}],"line":36},"4":{"loc":{"start":{"line":36,"column":6},"end":{"line":36,"column":44}},"type":"binary-expr","locations":[{"start":{"line":36,"column":6},"end":{"line":36,"column":30}},{"start":{"line":36,"column":34},"end":{"line":36,"column":44}}],"line":36},"5":{"loc":{"start":{"line":41,"column":28},"end":{"line":41,"column":85}},"type":"binary-expr","locations":[{"start":{"line":41,"column":28},"end":{"line":41,"column":51}},{"start":{"line":41,"column":55},"end":{"line":41,"column":85}}],"line":41},"6":{"loc":{"start":{"line":46,"column":2},"end":{"line":67,"column":3}},"type":"if","locations":[{"start":{"line":46,"column":2},"end":{"line":67,"column":3}},{"start":{"line":46,"column":2},"end":{"line":67,"column":3}}],"line":46},"7":{"loc":{"start":{"line":47,"column":11},"end":{"line":47,"column":65}},"type":"binary-expr","locations":[{"start":{"line":47,"column":11},"end":{"line":47,"column":28}},{"start":{"line":47,"column":32},"end":{"line":47,"column":65}}],"line":47},"8":{"loc":{"start":{"line":57,"column":11},"end":{"line":57,"column":65}},"type":"binary-expr","locations":[{"start":{"line":57,"column":11},"end":{"line":57,"column":28}},{"start":{"line":57,"column":32},"end":{"line":57,"column":65}}],"line":57}},"s":{"0":6,"1":6,"2":6,"3":0,"4":6,"5":6,"6":6,"7":6,"8":6,"9":6,"10":6,"11":0,"12":6,"13":6,"14":6,"15":6,"16":6,"17":3,"18":5,"19":5,"20":5,"21":5,"22":5,"23":3,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":6},"f":{"0":6},"b":{"0":[6,6],"1":[0,6],"2":[6,0],"3":[0,6],"4":[6,0],"5":[6,0],"6":[3,3],"7":[8,8],"8":[3,3]},"_coverageSchema":"43e27e138ebf9cfc5966b082cf9a028302ed4184","hash":"beebf5b646233c5693357688f175a13472f43722","contentHash":"1aae39d6fc0b0b06d108acdaeda7f46c"}
+,"/Users/donald/Project/browser-image-compression/lib/index.js": {"path":"/Users/donald/Project/browser-image-compression/lib/index.js","statementMap":{"0":{"start":{"line":31,"column":2},"end":{"line":31,"column":67}},"1":{"start":{"line":32,"column":2},"end":{"line":32,"column":96}},"2":{"start":{"line":34,"column":2},"end":{"line":38,"column":3}},"3":{"start":{"line":35,"column":4},"end":{"line":35,"column":72}},"4":{"start":{"line":36,"column":9},"end":{"line":38,"column":3}},"5":{"start":{"line":37,"column":4},"end":{"line":37,"column":53}},"6":{"start":{"line":41,"column":22},"end":{"line":41,"column":99}},"7":{"start":{"line":49,"column":2},"end":{"line":59,"column":3}},"8":{"start":{"line":50,"column":4},"end":{"line":56,"column":5}},"9":{"start":{"line":52,"column":6},"end":{"line":52,"column":63}},"10":{"start":{"line":55,"column":6},"end":{"line":55,"column":52}},"11":{"start":{"line":58,"column":4},"end":{"line":58,"column":50}},"12":{"start":{"line":61,"column":2},"end":{"line":64,"column":16}},"13":{"start":{"line":62,"column":4},"end":{"line":62,"column":35}},"14":{"start":{"line":63,"column":4},"end":{"line":63,"column":51}},"15":{"start":{"line":66,"column":2},"end":{"line":66,"column":23}},"16":{"start":{"line":69,"column":0},"end":{"line":69,"column":56}},"17":{"start":{"line":70,"column":0},"end":{"line":70,"column":56}},"18":{"start":{"line":71,"column":0},"end":{"line":71,"column":38}},"19":{"start":{"line":72,"column":0},"end":{"line":72,"column":54}},"20":{"start":{"line":73,"column":0},"end":{"line":73,"column":52}},"21":{"start":{"line":74,"column":0},"end":{"line":74,"column":44}},"22":{"start":{"line":75,"column":0},"end":{"line":75,"column":56}},"23":{"start":{"line":76,"column":0},"end":{"line":76,"column":64}},"24":{"start":{"line":77,"column":0},"end":{"line":77,"column":62}}},"fnMap":{"0":{"name":"imageCompression","decl":{"start":{"line":27,"column":15},"end":{"line":27,"column":31}},"loc":{"start":{"line":27,"column":48},"end":{"line":67,"column":1}},"line":27}},"branchMap":{"0":{"loc":{"start":{"line":31,"column":22},"end":{"line":31,"column":67}},"type":"binary-expr","locations":[{"start":{"line":31,"column":22},"end":{"line":31,"column":39}},{"start":{"line":31,"column":43},"end":{"line":31,"column":67}}],"line":31},"1":{"loc":{"start":{"line":32,"column":25},"end":{"line":32,"column":96}},"type":"cond-expr","locations":[{"start":{"line":32,"column":69},"end":{"line":32,"column":89}},{"start":{"line":32,"column":92},"end":{"line":32,"column":96}}],"line":32},"2":{"loc":{"start":{"line":34,"column":2},"end":{"line":38,"column":3}},"type":"if","locations":[{"start":{"line":34,"column":2},"end":{"line":38,"column":3}},{"start":{"line":34,"column":2},"end":{"line":38,"column":3}}],"line":34},"3":{"loc":{"start":{"line":34,"column":8},"end":{"line":34,"column":52}},"type":"binary-expr","locations":[{"start":{"line":34,"column":8},"end":{"line":34,"column":28}},{"start":{"line":34,"column":32},"end":{"line":34,"column":52}}],"line":34},"4":{"loc":{"start":{"line":36,"column":9},"end":{"line":38,"column":3}},"type":"if","locations":[{"start":{"line":36,"column":9},"end":{"line":38,"column":3}},{"start":{"line":36,"column":9},"end":{"line":38,"column":3}}],"line":36},"5":{"loc":{"start":{"line":41,"column":22},"end":{"line":41,"column":99}},"type":"binary-expr","locations":[{"start":{"line":41,"column":22},"end":{"line":41,"column":62}},{"start":{"line":41,"column":66},"end":{"line":41,"column":99}}],"line":41},"6":{"loc":{"start":{"line":49,"column":2},"end":{"line":59,"column":3}},"type":"if","locations":[{"start":{"line":49,"column":2},"end":{"line":59,"column":3}},{"start":{"line":49,"column":2},"end":{"line":59,"column":3}}],"line":49},"7":{"loc":{"start":{"line":49,"column":6},"end":{"line":49,"column":74}},"type":"binary-expr","locations":[{"start":{"line":49,"column":6},"end":{"line":49,"column":26}},{"start":{"line":49,"column":30},"end":{"line":49,"column":58}},{"start":{"line":49,"column":62},"end":{"line":49,"column":74}}],"line":49}},"s":{"0":9,"1":9,"2":9,"3":2,"4":7,"5":1,"6":6,"7":6,"8":0,"9":0,"10":0,"11":6,"12":6,"13":6,"14":6,"15":6,"16":1,"17":1,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":1},"f":{"0":9},"b":{"0":[9,2],"1":[9,0],"2":[2,7],"3":[9,9],"4":[1,6],"5":[6,0],"6":[0,6],"7":[6,0,0]},"_coverageSchema":"43e27e138ebf9cfc5966b082cf9a028302ed4184","hash":"c6faf098a3ae71adbc865c5284132f0b67861195","contentHash":"ca857e27e9624169077901ec50dd53e3"}
+,"/Users/donald/Project/browser-image-compression/lib/utils.js": {"path":"/Users/donald/Project/browser-image-compression/lib/utils.js","statementMap":{"0":{"start":{"line":8,"column":2},"end":{"line":13,"column":4}},"1":{"start":{"line":9,"column":19},"end":{"line":9,"column":35}},"2":{"start":{"line":10,"column":4},"end":{"line":10,"column":48}},"3":{"start":{"line":10,"column":26},"end":{"line":10,"column":48}},"4":{"start":{"line":11,"column":4},"end":{"line":11,"column":37}},"5":{"start":{"line":11,"column":28},"end":{"line":11,"column":37}},"6":{"start":{"line":12,"column":4},"end":{"line":12,"column":30}},"7":{"start":{"line":25,"column":2},"end":{"line":43,"column":4}},"8":{"start":{"line":26,"column":16},"end":{"line":26,"column":34}},"9":{"start":{"line":27,"column":17},"end":{"line":27,"column":43}},"10":{"start":{"line":28,"column":17},"end":{"line":28,"column":29}},"11":{"start":{"line":29,"column":12},"end":{"line":29,"column":23}},"12":{"start":{"line":30,"column":18},"end":{"line":30,"column":35}},"13":{"start":{"line":31,"column":4},"end":{"line":33,"column":5}},"14":{"start":{"line":32,"column":6},"end":{"line":32,"column":35}},"15":{"start":{"line":35,"column":4},"end":{"line":41,"column":5}},"16":{"start":{"line":36,"column":6},"end":{"line":36,"column":56}},"17":{"start":{"line":38,"column":6},"end":{"line":38,"column":46}},"18":{"start":{"line":39,"column":6},"end":{"line":39,"column":26}},"19":{"start":{"line":40,"column":6},"end":{"line":40,"column":38}},"20":{"start":{"line":42,"column":4},"end":{"line":42,"column":17}},"21":{"start":{"line":53,"column":2},"end":{"line":58,"column":4}},"22":{"start":{"line":54,"column":16},"end":{"line":54,"column":27}},"23":{"start":{"line":55,"column":4},"end":{"line":55,"column":35}},"24":{"start":{"line":55,"column":23},"end":{"line":55,"column":35}},"25":{"start":{"line":56,"column":4},"end":{"line":56,"column":34}},"26":{"start":{"line":56,"column":25},"end":{"line":56,"column":34}},"27":{"start":{"line":57,"column":4},"end":{"line":57,"column":17}},"28":{"start":{"line":69,"column":2},"end":{"line":73,"column":3}},"29":{"start":{"line":70,"column":4},"end":{"line":70,"column":55}},"30":{"start":{"line":72,"column":4},"end":{"line":72,"column":45}},"31":{"start":{"line":74,"column":14},"end":{"line":74,"column":37}},"32":{"start":{"line":75,"column":2},"end":{"line":75,"column":55}},"33":{"start":{"line":76,"column":2},"end":{"line":76,"column":15}},"34":{"start":{"line":87,"column":2},"end":{"line":92,"column":3}},"35":{"start":{"line":88,"column":4},"end":{"line":88,"column":39}},"36":{"start":{"line":90,"column":20},"end":{"line":90,"column":50}},"37":{"start":{"line":91,"column":4},"end":{"line":91,"column":34}},"38":{"start":{"line":93,"column":17},"end":{"line":93,"column":39}},"39":{"start":{"line":94,"column":2},"end":{"line":94,"column":22}},"40":{"start":{"line":109,"column":2},"end":{"line":116,"column":3}},"41":{"start":{"line":110,"column":4},"end":{"line":110,"column":76}},"42":{"start":{"line":111,"column":4},"end":{"line":111,"column":34}},"43":{"start":{"line":112,"column":4},"end":{"line":112,"column":50}},"44":{"start":{"line":114,"column":20},"end":{"line":114,"column":55}},"45":{"start":{"line":115,"column":4},"end":{"line":115,"column":82}},"46":{"start":{"line":117,"column":2},"end":{"line":117,"column":23}},"47":{"start":{"line":129,"column":2},"end":{"line":166,"column":4}},"48":{"start":{"line":130,"column":19},"end":{"line":130,"column":35}},"49":{"start":{"line":131,"column":4},"end":{"line":163,"column":5}},"50":{"start":{"line":132,"column":19},"end":{"line":132,"column":48}},"51":{"start":{"line":133,"column":6},"end":{"line":135,"column":7}},"52":{"start":{"line":134,"column":8},"end":{"line":134,"column":26}},"53":{"start":{"line":136,"column":21},"end":{"line":136,"column":36}},"54":{"start":{"line":137,"column":19},"end":{"line":137,"column":20}},"55":{"start":{"line":138,"column":6},"end":{"line":161,"column":7}},"56":{"start":{"line":139,"column":8},"end":{"line":139,"column":70}},"57":{"start":{"line":139,"column":52},"end":{"line":139,"column":70}},"58":{"start":{"line":140,"column":23},"end":{"line":140,"column":52}},"59":{"start":{"line":141,"column":8},"end":{"line":141,"column":19}},"60":{"start":{"line":142,"column":8},"end":{"line":160,"column":9}},"61":{"start":{"line":143,"column":10},"end":{"line":145,"column":11}},"62":{"start":{"line":144,"column":12},"end":{"line":144,"column":30}},"63":{"start":{"line":147,"column":23},"end":{"line":147,"column":67}},"64":{"start":{"line":148,"column":10},"end":{"line":148,"column":54}},"65":{"start":{"line":149,"column":21},"end":{"line":149,"column":51}},"66":{"start":{"line":150,"column":10},"end":{"line":150,"column":21}},"67":{"start":{"line":151,"column":10},"end":{"line":155,"column":11}},"68":{"start":{"line":152,"column":12},"end":{"line":154,"column":13}},"69":{"start":{"line":153,"column":14},"end":{"line":153,"column":75}},"70":{"start":{"line":156,"column":15},"end":{"line":160,"column":9}},"71":{"start":{"line":157,"column":10},"end":{"line":157,"column":15}},"72":{"start":{"line":159,"column":10},"end":{"line":159,"column":49}},"73":{"start":{"line":162,"column":6},"end":{"line":162,"column":24}},"74":{"start":{"line":164,"column":4},"end":{"line":164,"column":37}},"75":{"start":{"line":164,"column":28},"end":{"line":164,"column":37}},"76":{"start":{"line":165,"column":4},"end":{"line":165,"column":34}},"77":{"start":{"line":177,"column":14},"end":{"line":177,"column":37}},"78":{"start":{"line":179,"column":27},"end":{"line":179,"column":51}},"79":{"start":{"line":180,"column":23},"end":{"line":180,"column":124}},"80":{"start":{"line":181,"column":2},"end":{"line":192,"column":3}},"81":{"start":{"line":182,"column":4},"end":{"line":188,"column":5}},"82":{"start":{"line":183,"column":6},"end":{"line":183,"column":37}},"83":{"start":{"line":184,"column":6},"end":{"line":184,"column":65}},"84":{"start":{"line":186,"column":6},"end":{"line":186,"column":64}},"85":{"start":{"line":187,"column":6},"end":{"line":187,"column":38}},"86":{"start":{"line":190,"column":4},"end":{"line":190,"column":28}},"87":{"start":{"line":191,"column":4},"end":{"line":191,"column":30}},"88":{"start":{"line":194,"column":2},"end":{"line":194,"column":55}},"89":{"start":{"line":195,"column":2},"end":{"line":195,"column":31}},"90":{"start":{"line":208,"column":14},"end":{"line":208,"column":37}},"91":{"start":{"line":210,"column":16},"end":{"line":210,"column":28}},"92":{"start":{"line":211,"column":17},"end":{"line":211,"column":30}},"93":{"start":{"line":214,"column":2},"end":{"line":220,"column":3}},"94":{"start":{"line":215,"column":4},"end":{"line":215,"column":25}},"95":{"start":{"line":216,"column":4},"end":{"line":216,"column":25}},"96":{"start":{"line":218,"column":4},"end":{"line":218,"column":24}},"97":{"start":{"line":219,"column":4},"end":{"line":219,"column":26}},"98":{"start":{"line":223,"column":2},"end":{"line":232,"column":3}},"99":{"start":{"line":224,"column":12},"end":{"line":224,"column":49}},"100":{"start":{"line":224,"column":50},"end":{"line":224,"column":56}},"101":{"start":{"line":225,"column":12},"end":{"line":225,"column":55}},"102":{"start":{"line":225,"column":56},"end":{"line":225,"column":62}},"103":{"start":{"line":226,"column":12},"end":{"line":226,"column":50}},"104":{"start":{"line":226,"column":51},"end":{"line":226,"column":57}},"105":{"start":{"line":227,"column":12},"end":{"line":227,"column":44}},"106":{"start":{"line":227,"column":45},"end":{"line":227,"column":51}},"107":{"start":{"line":228,"column":12},"end":{"line":228,"column":50}},"108":{"start":{"line":228,"column":51},"end":{"line":228,"column":57}},"109":{"start":{"line":229,"column":12},"end":{"line":229,"column":55}},"110":{"start":{"line":229,"column":56},"end":{"line":229,"column":62}},"111":{"start":{"line":230,"column":12},"end":{"line":230,"column":49}},"112":{"start":{"line":230,"column":50},"end":{"line":230,"column":56}},"113":{"start":{"line":231,"column":13},"end":{"line":231,"column":19}},"114":{"start":{"line":234,"column":2},"end":{"line":234,"column":55}},"115":{"start":{"line":236,"column":2},"end":{"line":236,"column":15}}},"fnMap":{"0":{"name":"getDataUrlFromFile","decl":{"start":{"line":7,"column":16},"end":{"line":7,"column":34}},"loc":{"start":{"line":7,"column":42},"end":{"line":14,"column":1}},"line":7},"1":{"name":"(anonymous_1)","decl":{"start":{"line":8,"column":21},"end":{"line":8,"column":22}},"loc":{"start":{"line":8,"column":42},"end":{"line":13,"column":3}},"line":8},"2":{"name":"(anonymous_2)","decl":{"start":{"line":10,"column":20},"end":{"line":10,"column":21}},"loc":{"start":{"line":10,"column":26},"end":{"line":10,"column":48}},"line":10},"3":{"name":"(anonymous_3)","decl":{"start":{"line":11,"column":21},"end":{"line":11,"column":22}},"loc":{"start":{"line":11,"column":28},"end":{"line":11,"column":37}},"line":11},"4":{"name":"getFilefromDataUrl","decl":{"start":{"line":24,"column":16},"end":{"line":24,"column":34}},"loc":{"start":{"line":24,"column":82},"end":{"line":44,"column":1}},"line":24},"5":{"name":"(anonymous_5)","decl":{"start":{"line":25,"column":21},"end":{"line":25,"column":22}},"loc":{"start":{"line":25,"column":34},"end":{"line":43,"column":3}},"line":25},"6":{"name":"loadImage","decl":{"start":{"line":52,"column":16},"end":{"line":52,"column":25}},"loc":{"start":{"line":52,"column":32},"end":{"line":59,"column":1}},"line":52},"7":{"name":"(anonymous_7)","decl":{"start":{"line":53,"column":21},"end":{"line":53,"column":22}},"loc":{"start":{"line":53,"column":42},"end":{"line":58,"column":3}},"line":53},"8":{"name":"(anonymous_8)","decl":{"start":{"line":55,"column":17},"end":{"line":55,"column":18}},"loc":{"start":{"line":55,"column":23},"end":{"line":55,"column":35}},"line":55},"9":{"name":"(anonymous_9)","decl":{"start":{"line":56,"column":18},"end":{"line":56,"column":19}},"loc":{"start":{"line":56,"column":25},"end":{"line":56,"column":34}},"line":56},"10":{"name":"drawImageInCanvas","decl":{"start":{"line":67,"column":16},"end":{"line":67,"column":33}},"loc":{"start":{"line":67,"column":40},"end":{"line":77,"column":1}},"line":67},"11":{"name":"drawFileInCanvas","decl":{"start":{"line":85,"column":22},"end":{"line":85,"column":38}},"loc":{"start":{"line":85,"column":46},"end":{"line":95,"column":1}},"line":85},"12":{"name":"canvasToFile","decl":{"start":{"line":107,"column":22},"end":{"line":107,"column":34}},"loc":{"start":{"line":107,"column":95},"end":{"line":118,"column":1}},"line":107},"13":{"name":"getExifOrientation","decl":{"start":{"line":128,"column":16},"end":{"line":128,"column":34}},"loc":{"start":{"line":128,"column":42},"end":{"line":167,"column":1}},"line":128},"14":{"name":"(anonymous_14)","decl":{"start":{"line":129,"column":21},"end":{"line":129,"column":22}},"loc":{"start":{"line":129,"column":42},"end":{"line":166,"column":3}},"line":129},"15":{"name":"(anonymous_15)","decl":{"start":{"line":131,"column":20},"end":{"line":131,"column":21}},"loc":{"start":{"line":131,"column":27},"end":{"line":163,"column":5}},"line":131},"16":{"name":"(anonymous_16)","decl":{"start":{"line":164,"column":21},"end":{"line":164,"column":22}},"loc":{"start":{"line":164,"column":28},"end":{"line":164,"column":37}},"line":164},"17":{"name":"handleMaxWidthOrHeight","decl":{"start":{"line":176,"column":16},"end":{"line":176,"column":38}},"loc":{"start":{"line":176,"column":62},"end":{"line":196,"column":1}},"line":176},"18":{"name":"followExifOrientation","decl":{"start":{"line":207,"column":16},"end":{"line":207,"column":37}},"loc":{"start":{"line":207,"column":69},"end":{"line":237,"column":1}},"line":207}},"branchMap":{"0":{"loc":{"start":{"line":24,"column":55},"end":{"line":24,"column":80}},"type":"default-arg","locations":[{"start":{"line":24,"column":70},"end":{"line":24,"column":80}}],"line":24},"1":{"loc":{"start":{"line":69,"column":2},"end":{"line":73,"column":3}},"type":"if","locations":[{"start":{"line":69,"column":2},"end":{"line":73,"column":3}},{"start":{"line":69,"column":2},"end":{"line":73,"column":3}}],"line":69},"2":{"loc":{"start":{"line":107,"column":82},"end":{"line":107,"column":93}},"type":"default-arg","locations":[{"start":{"line":107,"column":92},"end":{"line":107,"column":93}}],"line":107},"3":{"loc":{"start":{"line":109,"column":2},"end":{"line":116,"column":3}},"type":"if","locations":[{"start":{"line":109,"column":2},"end":{"line":116,"column":3}},{"start":{"line":109,"column":2},"end":{"line":116,"column":3}}],"line":109},"4":{"loc":{"start":{"line":109,"column":6},"end":{"line":109,"column":80}},"type":"binary-expr","locations":[{"start":{"line":109,"column":6},"end":{"line":109,"column":43}},{"start":{"line":109,"column":47},"end":{"line":109,"column":80}}],"line":109},"5":{"loc":{"start":{"line":133,"column":6},"end":{"line":135,"column":7}},"type":"if","locations":[{"start":{"line":133,"column":6},"end":{"line":135,"column":7}},{"start":{"line":133,"column":6},"end":{"line":135,"column":7}}],"line":133},"6":{"loc":{"start":{"line":139,"column":8},"end":{"line":139,"column":70}},"type":"if","locations":[{"start":{"line":139,"column":8},"end":{"line":139,"column":70}},{"start":{"line":139,"column":8},"end":{"line":139,"column":70}}],"line":139},"7":{"loc":{"start":{"line":142,"column":8},"end":{"line":160,"column":9}},"type":"if","locations":[{"start":{"line":142,"column":8},"end":{"line":160,"column":9}},{"start":{"line":142,"column":8},"end":{"line":160,"column":9}}],"line":142},"8":{"loc":{"start":{"line":143,"column":10},"end":{"line":145,"column":11}},"type":"if","locations":[{"start":{"line":143,"column":10},"end":{"line":145,"column":11}},{"start":{"line":143,"column":10},"end":{"line":145,"column":11}}],"line":143},"9":{"loc":{"start":{"line":152,"column":12},"end":{"line":154,"column":13}},"type":"if","locations":[{"start":{"line":152,"column":12},"end":{"line":154,"column":13}},{"start":{"line":152,"column":12},"end":{"line":154,"column":13}}],"line":152},"10":{"loc":{"start":{"line":156,"column":15},"end":{"line":160,"column":9}},"type":"if","locations":[{"start":{"line":156,"column":15},"end":{"line":160,"column":9}},{"start":{"line":156,"column":15},"end":{"line":160,"column":9}}],"line":156},"11":{"loc":{"start":{"line":180,"column":23},"end":{"line":180,"column":124}},"type":"binary-expr","locations":[{"start":{"line":180,"column":23},"end":{"line":180,"column":57}},{"start":{"line":180,"column":62},"end":{"line":180,"column":90}},{"start":{"line":180,"column":94},"end":{"line":180,"column":123}}],"line":180},"12":{"loc":{"start":{"line":181,"column":2},"end":{"line":192,"column":3}},"type":"if","locations":[{"start":{"line":181,"column":2},"end":{"line":192,"column":3}},{"start":{"line":181,"column":2},"end":{"line":192,"column":3}}],"line":181},"13":{"loc":{"start":{"line":182,"column":4},"end":{"line":188,"column":5}},"type":"if","locations":[{"start":{"line":182,"column":4},"end":{"line":188,"column":5}},{"start":{"line":182,"column":4},"end":{"line":188,"column":5}}],"line":182},"14":{"loc":{"start":{"line":214,"column":2},"end":{"line":220,"column":3}},"type":"if","locations":[{"start":{"line":214,"column":2},"end":{"line":220,"column":3}},{"start":{"line":214,"column":2},"end":{"line":220,"column":3}}],"line":214},"15":{"loc":{"start":{"line":214,"column":6},"end":{"line":214,"column":48}},"type":"binary-expr","locations":[{"start":{"line":214,"column":6},"end":{"line":214,"column":25}},{"start":{"line":214,"column":29},"end":{"line":214,"column":48}}],"line":214},"16":{"loc":{"start":{"line":223,"column":2},"end":{"line":232,"column":3}},"type":"switch","locations":[{"start":{"line":224,"column":4},"end":{"line":224,"column":56}},{"start":{"line":225,"column":4},"end":{"line":225,"column":62}},{"start":{"line":226,"column":4},"end":{"line":226,"column":57}},{"start":{"line":227,"column":4},"end":{"line":227,"column":51}},{"start":{"line":228,"column":4},"end":{"line":228,"column":57}},{"start":{"line":229,"column":4},"end":{"line":229,"column":62}},{"start":{"line":230,"column":4},"end":{"line":230,"column":56}},{"start":{"line":231,"column":4},"end":{"line":231,"column":19}}],"line":223}},"s":{"0":12,"1":12,"2":12,"3":12,"4":12,"5":0,"6":12,"7":12,"8":12,"9":12,"10":12,"11":12,"12":12,"13":12,"14":12578552,"15":12,"16":12,"17":11,"18":11,"19":11,"20":12,"21":13,"22":13,"23":13,"24":13,"25":13,"26":0,"27":13,"28":12,"29":0,"30":12,"31":12,"32":12,"33":12,"34":11,"35":11,"36":11,"37":11,"38":11,"39":11,"40":11,"41":0,"42":0,"43":0,"44":11,"45":11,"46":11,"47":1,"48":1,"49":1,"50":1,"51":1,"52":1,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":1,"75":0,"76":1,"77":6,"78":6,"79":6,"80":6,"81":4,"82":2,"83":2,"84":2,"85":2,"86":2,"87":2,"88":6,"89":6,"90":6,"91":6,"92":6,"93":6,"94":0,"95":0,"96":6,"97":6,"98":6,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":6,"114":6,"115":6},"f":{"0":12,"1":12,"2":12,"3":0,"4":12,"5":12,"6":13,"7":13,"8":13,"9":0,"10":12,"11":11,"12":11,"13":1,"14":1,"15":1,"16":0,"17":6,"18":6},"b":{"0":[12],"1":[0,12],"2":[0],"3":[0,11],"4":[11,0],"5":[1,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[6,4,0],"12":[4,2],"13":[2,2],"14":[0,6],"15":[6,0],"16":[0,0,0,0,0,0,0,6]},"_coverageSchema":"43e27e138ebf9cfc5966b082cf9a028302ed4184","hash":"1603c36e0b57721a330f54f37b51d78d490110bf","contentHash":"6539cdc1ebd20865e5cf1a3ecd0e79a0"}
}
diff --git a/coverage/coverage-summary.json b/coverage/coverage-summary.json
index 4675f35..b9c8487 100644
--- a/coverage/coverage-summary.json
+++ b/coverage/coverage-summary.json
@@ -1,5 +1,5 @@
-{"total": {"lines":{"total":159,"covered":110,"skipped":0,"pct":69.18},"statements":{"total":172,"covered":112,"skipped":0,"pct":65.12},"functions":{"total":21,"covered":18,"skipped":0,"pct":85.71},"branches":{"total":74,"covered":34,"skipped":0,"pct":45.95}}
+{"total": {"lines":{"total":159,"covered":115,"skipped":0,"pct":72.33},"statements":{"total":172,"covered":117,"skipped":0,"pct":68.02},"functions":{"total":21,"covered":18,"skipped":0,"pct":85.71},"branches":{"total":74,"covered":39,"skipped":0,"pct":52.7}}
,"/Users/donald/Project/browser-image-compression/lib/image-compression.js": {"lines":{"total":31,"covered":23,"skipped":0,"pct":74.19},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":31,"covered":23,"skipped":0,"pct":74.19},"branches":{"total":18,"covered":13,"skipped":0,"pct":72.22}}
-,"/Users/donald/Project/browser-image-compression/lib/index.js": {"lines":{"total":25,"covered":22,"skipped":0,"pct":88},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":25,"covered":22,"skipped":0,"pct":88},"branches":{"total":17,"covered":11,"skipped":0,"pct":64.71}}
-,"/Users/donald/Project/browser-image-compression/lib/utils.js": {"lines":{"total":103,"covered":65,"skipped":0,"pct":63.11},"functions":{"total":19,"covered":16,"skipped":0,"pct":84.21},"statements":{"total":116,"covered":67,"skipped":0,"pct":57.76},"branches":{"total":39,"covered":10,"skipped":0,"pct":25.64}}
+,"/Users/donald/Project/browser-image-compression/lib/index.js": {"lines":{"total":25,"covered":22,"skipped":0,"pct":88},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":25,"covered":22,"skipped":0,"pct":88},"branches":{"total":17,"covered":12,"skipped":0,"pct":70.59}}
+,"/Users/donald/Project/browser-image-compression/lib/utils.js": {"lines":{"total":103,"covered":70,"skipped":0,"pct":67.96},"functions":{"total":19,"covered":16,"skipped":0,"pct":84.21},"statements":{"total":116,"covered":72,"skipped":0,"pct":62.07},"branches":{"total":39,"covered":14,"skipped":0,"pct":35.9}}
}
diff --git a/coverage/image-compression.js.html b/coverage/image-compression.js.html
index a12e116..f6e76f5 100644
--- a/coverage/image-compression.js.html
+++ b/coverage/image-compression.js.html
@@ -129,39 +129,39 @@