{"_id":"@arimethys/ng2-img-max","_rev":"4-c273922750be089676e43c3cecaf6df0","name":"@arimethys/ng2-img-max","dist-tags":{"latest":"2.2.8"},"versions":{"2.2.5":{"name":"@arimethys/ng2-img-max","version":"2.2.5","description":"Angular module to resize images down to a certain width and height or to reduce the quality to fit a certain maximal filesize - all in the browser. Just an update of angular/core requirement","repository":{"type":"git","url":"git+https://github.com/arimethys/ng2-img-max.git"},"publishConfig":{"access":"public"},"license":"MIT","main":"./dist/bundles/ng2-img-max.umd.js","module":"./dist/ng2-img-max.js","typings":"./dist/ng2-img-max.d.ts","scripts":{"transpile":"ngc","package":"rollup -c","minify":"uglifyjs dist/bundles/ng2-img-max.umd.js --screw-ie8 --compress --mangle --comments --output dist/bundles/ng2-img-max.umd.min.js","build":"npm run transpile && npm run package && npm run minify"},"author":{"name":"Arimethys","email":"arimethys@gmail.com"},"keywords":["angular","angular2","img-max","maximal","size","limit","resize"],"dependencies":{"exifr":"^4.3.4","ng2-pica":"^1.3.1"},"peerDependencies":{"@angular/core":"^11.2.13","core-js":">=2.4.1","rxjs":"^6.5.3"},"devDependencies":{"@angular/common":"^11.2.13","@angular/compiler":"^11.2.13","@angular/compiler-cli":"^11.2.13","@angular/core":"^11.2.13","@angular/platform-browser":"^11.2.13","@angular/platform-browser-dynamic":"^11.2.13","@angular/router":"^11.2.13","@types/node":">=7.0.5","core-js":"^2.4.1","reflect-metadata":"^0.1.3","rollup":"^0.41.4","rxjs":"^6.5.3","tslint":"^5.20.1","typescript":"~4.1.0","uglify-js":"^2.7.5","zone.js":"^0.11.3"},"bugs":{"url":"https://github.com/arimethys/ng2-img-max/issues"},"homepage":"https://github.com/arimethys/ng2-img-max#readme","gitHead":"c5d7ab6cf510a9409999fdceb20ae6f7fc23ac94","_id":"@arimethys/ng2-img-max@2.2.5","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-aVCJwSvZzDe2Dl1cdkkumLNGOQlXIYqlONj13aPnVyDazxb4I/JvcCEmytsHcJq/YuR2pSNCkTdPMLwdJSw+Fw==","shasum":"b619f8eba617b5c68f5d755b25beb6bfba43929b","tarball":"https://registry.npmjs.org/@arimethys/ng2-img-max/-/ng2-img-max-2.2.5.tgz","fileCount":5,"unpackedSize":9859,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgroPKCRA9TVsSAnZWagAAZ6YP/3Gc+VNuaBJ5ak5hnItM\nx2egzk+xCNyNAHOZ1Q8V5GgGrDqXsucZ/kGrhLV8mffVub4dtFGpuboWISOT\nES+lF0stjszF9u/q86TnPfqHO9aau57pzztRv/5/HMtd9ZKIOCia56Mxr6Q+\nfB97S+JoQz+NWSpC31Y8BBhlPzq9bUVaPxnEPLiWJpuyXmIbCVZVrNb5Sa4+\n/6OQNWQa+o8MvlAfYkPXmJQ1pvg8fJqfUDBXIA0LRaoZl91WEuNf+Dvrxbdd\neolRczvY3sJdN54f0OxU6xbVsSYm78/gIk45M15Tmb0j5NiydTJriYllWOK2\n0pU4wuxiCMjiKFxolzQjpQQ/mRkZ6Xh6xGqz+M0O2u9vC5R0DlM5XaT+WxTj\ngHfwY4/tdLVllgT8MLjHV76xNBMyq4VYsB0S1r2tF2T/NSrdnXqTFReyw1pz\ni64K+K0rW/+vtddDPimJr+3gneN02kQJHWLK68KYspBMqQHYx0hNVfMEp7o5\ngYT43n8KV9AM0k8iBtmGjZJJgNTLSG3I3CyK0ust3grX/YQfSLWZ9QdT+Q1k\ndKOmNG2dM8HX8lRlpaqt0s/CcIydXJBH/fbxSX9QlerbRfMT1K70M6WMNKTj\nsbE4y5flpDNmVZX+d2oynlO1QQXI283PIg2i51U9QLveAKITVAIiFSVmae/A\ncHBT\r\n=uTnE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTw3c1OGenutSeQIL+QxsEp2AYxdB+1pRJUXwfsvSb2QIhAJEPZa9S0e1j7gk4S6mNFK2qNrcaCF4LMxH3tRQRpetD"}]},"_npmUser":{"name":"arimethys","email":"arimethys@gmail.com"},"directories":{},"maintainers":[{"name":"arimethys","email":"arimethys@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ng2-img-max_2.2.5_1622049737649_0.22195540568633843"},"_hasShrinkwrap":false},"2.2.6":{"name":"@arimethys/ng2-img-max","version":"2.2.6","description":"Angular module to resize images down to a certain width and height or to reduce the quality to fit a certain maximal filesize - all in the browser. Just an update of angular/core requirement","repository":{"type":"git","url":"git+https://github.com/arimethys/ng2-img-max.git"},"publishConfig":{"access":"public"},"license":"MIT","main":"./dist/bundles/ng2-img-max.umd.js","module":"./dist/ng2-img-max.js","typings":"./dist/ng2-img-max.d.ts","scripts":{"transpile":"ngc","package":"rollup -c","minify":"uglifyjs dist/bundles/ng2-img-max.umd.js --screw-ie8 --compress --mangle --comments --output dist/bundles/ng2-img-max.umd.min.js","build":"npm run transpile && npm run package && npm run minify"},"author":{"name":"Arimethys","email":"arimethys@gmail.com"},"keywords":["angular","angular2","img-max","maximal","size","limit","resize"],"dependencies":{"exifr":"^4.3.4","ng2-pica":"^1.3.1"},"peerDependencies":{"@angular/core":"^11.2.13","core-js":">=2.4.1","rxjs":"^6.5.3"},"devDependencies":{"@angular/common":"^11.2.13","@angular/compiler":"^11.2.13","@angular/compiler-cli":"^11.2.13","@angular/core":"^11.2.13","@angular/platform-browser":"^11.2.13","@angular/platform-browser-dynamic":"^11.2.13","@angular/router":"^11.2.13","@types/node":">=7.0.5","core-js":"^2.4.1","reflect-metadata":"^0.1.3","rollup":"^0.41.4","rxjs":"^6.5.3","tslint":"^5.20.1","typescript":"~4.1.0","uglify-js":"^2.7.5","zone.js":"^0.11.3"},"bugs":{"url":"https://github.com/arimethys/ng2-img-max/issues"},"homepage":"https://github.com/arimethys/ng2-img-max#readme","gitHead":"c5d7ab6cf510a9409999fdceb20ae6f7fc23ac94","_id":"@arimethys/ng2-img-max@2.2.6","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-wuzu2Ohjm0zdvzlREhdQAkp/Wyjdh09BMxFMPGK0WStCk+t2DbNEtUCHBu43orDtZ2+VJJb13UDAxeVP5iXA6g==","shasum":"c2ba0eb21fbd4771d7860a8f9d02ecc49b9f50c9","tarball":"https://registry.npmjs.org/@arimethys/ng2-img-max/-/ng2-img-max-2.2.6.tgz","fileCount":5,"unpackedSize":9871,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrocbCRA9TVsSAnZWagAABmIP/iQ4JIRCxQECUI+zBcw3\nI9GJRTID/F/PWHsxLaCClStWL3d9zEa3dGSOH8IVvOzoFvAoys3SDbBrk30N\nVZh4lU0FAu4iNYmYTFYpYVvRV1uIAKhmhnd0eVVcbYLOEqWR4x3bPJi4s9xm\nAeHf/PLOO8MnvWc+fEOS3XFpsvTT8PNSYQwTCxAE8aNeAOavCJlB5sfx/+LX\niRdmAwCK39yz+fWLxkRMlZg4k1kvsS3ozYPOkg/yKjVJR6nD88zzCNmwbgS9\neAoTID17i/UOYjVt7AAm9qri8ozV45WR7jzZZycB9YVbzQ4ulQhcUNV1gYwK\nLEkayW+rqs0C73L2ongQKy/mVy3ubse329wRLIX4k4EkARliP8cKEgk5MCnp\naEafw2+MlSNk+wxx/Q6N7OOZDfWOLaphy4etbsXRdD30GVm5TwOfRkwDP0v3\noJTrV75k/9gNEaOmBxLHZ7NyxDT0mVAA4qak8YurBCxr1WVO6TeSExArJVZ0\nzon51HWbXD8VhzLp6HIIJMRkVNnaXIqkGAvJe9aG9XpA6s0w9U0htjxOYTdm\nCauFWinTJmLPnUyvSY10i/GtYBcLHWtDQ/Fho6euwozlYxvOxCNRe/XgCowu\nuSvltsZu2bhGtIsOl+92/BeTbyEPFObHQe5r74OJksUACYnFje49yJ1wbCP/\nkDMq\r\n=JDbb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUpx1bIp24ZNi7pF8m+iG6olJtxUQGkdftPNQYgixbiwIhALuBkjMFrVeGbl9ra2F4KxD+FMJn8asscVlecZhdCpMa"}]},"_npmUser":{"name":"arimethys","email":"arimethys@gmail.com"},"directories":{},"maintainers":[{"name":"arimethys","email":"arimethys@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ng2-img-max_2.2.6_1622050586954_0.8852018239880226"},"_hasShrinkwrap":false},"2.2.7":{"name":"@arimethys/ng2-img-max","version":"2.2.7","description":"Angular module to resize images down to a certain width and height or to reduce the quality to fit a certain maximal filesize - all in the browser. Just an update of angular/core requirement","repository":{"type":"git","url":"git+https://github.com/arimethys/ng2-img-max.git"},"publishConfig":{"access":"public"},"license":"MIT","main":"./dist/bundles/ng2-img-max.umd.js","module":"./dist/ng2-img-max.js","typings":"./dist/ng2-img-max.d.ts","scripts":{"transpile":"ngc","package":"rollup -c","minify":"uglifyjs dist/bundles/ng2-img-max.umd.js --screw-ie8 --compress --mangle --comments --output dist/bundles/ng2-img-max.umd.min.js","build":"npm run transpile && npm run package && npm run minify"},"author":{"name":"Arimethys","email":"arimethys@gmail.com"},"keywords":["angular","angular2","img-max","maximal","size","limit","resize"],"dependencies":{"exifr":"^4.3.4","ng2-pica":"^1.3.1"},"peerDependencies":{"@angular/core":"^11.2.13","core-js":">=2.4.1","rxjs":"^6.5.3"},"devDependencies":{"@angular/common":"^11.2.13","@angular/compiler":"^11.2.13","@angular/compiler-cli":"^11.2.13","@angular/core":"^11.2.13","@angular/platform-browser":"^11.2.13","@angular/platform-browser-dynamic":"^11.2.13","@angular/router":"^11.2.13","@types/node":">=7.0.5","core-js":"^2.4.1","reflect-metadata":"^0.1.3","rollup":"^0.41.4","rxjs":"^6.5.3","tslint":"^5.20.1","typescript":"~4.1.0","uglify-js":"^2.7.5","zone.js":"^0.11.3"},"bugs":{"url":"https://github.com/arimethys/ng2-img-max/issues"},"homepage":"https://github.com/arimethys/ng2-img-max#readme","gitHead":"c5d7ab6cf510a9409999fdceb20ae6f7fc23ac94","_id":"@arimethys/ng2-img-max@2.2.7","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-mRWSY01XD5Pi5imFDRKBP4/BkU9FSSamk4plUgfwkJQplTpvBSxJn/KcC1sQt+YG+B+9007g0EGgi8ta6WIA3Q==","shasum":"2ffa4fb326e3b8415ad1524c2252ab21b564f54a","tarball":"https://registry.npmjs.org/@arimethys/ng2-img-max/-/ng2-img-max-2.2.7.tgz","fileCount":5,"unpackedSize":9871,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgroe4CRA9TVsSAnZWagAAj/8P/Rqg9CpuLGGIMHTV0HwM\n+0jXnlhJgCDfsYA+e/BOJwAVioJHVKqkPFLACoPmkfeCZslhg2s/ft4NPoay\nbl1uD6pGgXQtlVbeGgGSSlT4NMP4JtlqOhVfVHoa+6Xb9BVPU/XaPRAOi2S9\nCxJA+guCsmsGChDMHZFMjNa/fuX+t9ykSLYZOIxgRp6TH2BsB719HTgq9LAU\nQZ6fDyCl73Ug/1CY/sUwyxRywzkb3d+pkWyoVeubVsyNVU88aWkyzXKW5epr\nq4x/DRlwyTLUeszAG8rmCOEHpHF2Bc1ndvN60ijQwancstNgMDXQvH7AxNEP\n0oA8nPIPXNvjhccMleWk8HRa+5Pkci6CHuot2YBOceQgwXVsZT+6iaHda8wG\nHQHskz6UeKAXikfX49cS8b0kQXzjmrEtmpRtzgY5Exn6D899c5Jh65pj1klN\nQ3OlSuC6LHklEoL4dkp4+fLqLB/rrph9ifOqHMWlbeaTpCqu4SLsieQehRVK\nRp66cVqAcvSpjpggjPSLq+W+sCwYmAOwIF0khvbY9KIjFQgluD7mGHkERp3Q\nbGDMm2uyBqA0UgTY/T7CeErUgNDFuPAJmD/KkZQ1yHiLGKtme/xSqclaASpo\nazsGzpQxUDXsaPkDPs/j3cNO3yAZrRmqDDfzF5Cm7j+LYKYGaEFNv6xVYCKo\nTM6F\r\n=mysv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGIIOsPEh4akb5zjzXiYWHI3/r9BAJ5LNyw/cWdoha1/AiEAtstV35YS6i9vsOSHw0AK1nDWXwPvQSbNwzi1YdxB0II="}]},"_npmUser":{"name":"arimethys","email":"arimethys@gmail.com"},"directories":{},"maintainers":[{"name":"arimethys","email":"arimethys@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ng2-img-max_2.2.7_1622050743758_0.25308177039577506"},"_hasShrinkwrap":false},"2.2.8":{"name":"@arimethys/ng2-img-max","version":"2.2.8","description":"Angular module to resize images down to a certain width and height or to reduce the quality to fit a certain maximal filesize - all in the browser. Just an update of angular/core requirement","repository":{"type":"git","url":"git+https://github.com/arimethys/ng2-img-max.git"},"publishConfig":{"access":"public"},"license":"MIT","main":"./dist/bundles/ng2-img-max.umd.js","module":"./dist/ng2-img-max.js","typings":"./dist/ng2-img-max.d.ts","scripts":{"transpile":"ngc","package":"rollup -c","minify":"uglifyjs dist/bundles/ng2-img-max.umd.js --screw-ie8 --compress --mangle --comments --output dist/bundles/ng2-img-max.umd.min.js","build":"npm run transpile && npm run package && npm run minify"},"author":{"name":"Arimethys","email":"arimethys@gmail.com"},"keywords":["angular","angular2","img-max","maximal","size","limit","resize"],"dependencies":{"exifr":"^4.3.4","ng2-pica":"^1.3.1"},"peerDependencies":{"@angular/core":"^11.2.13","core-js":">=2.4.1","rxjs":"^6.5.3"},"devDependencies":{"@angular/common":"^11.2.13","@angular/compiler":"^11.2.13","@angular/compiler-cli":"^11.2.13","@angular/core":"^11.2.13","@angular/platform-browser":"^11.2.13","@angular/platform-browser-dynamic":"^11.2.13","@angular/router":"^11.2.13","@types/node":">=7.0.5","core-js":"^2.4.1","reflect-metadata":"^0.1.3","rollup":"^0.41.4","rxjs":"^6.5.3","tslint":"^5.20.1","typescript":"~4.1.0","uglify-js":"^2.7.5","zone.js":"^0.11.3"},"bugs":{"url":"https://github.com/arimethys/ng2-img-max/issues"},"homepage":"https://github.com/arimethys/ng2-img-max#readme","gitHead":"c5d7ab6cf510a9409999fdceb20ae6f7fc23ac94","_id":"@arimethys/ng2-img-max@2.2.8","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-mywLceSzUrOBLHaTFRqfqsNiewq+ai9mhGUpsUhyeIlwOpb+5RTrcYd8rjN4gfZfSQg07X/6lGpZ+tsnlQ4Kuw==","shasum":"44de191e00e0958a1c8f59cbe6af8cd6e218ebd1","tarball":"https://registry.npmjs.org/@arimethys/ng2-img-max/-/ng2-img-max-2.2.8.tgz","fileCount":40,"unpackedSize":98849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrvJCCRA9TVsSAnZWagAAaukQAI0bVC3fnOQXySwY4xu2\nu3C3B/pz1dQyeFfZuGD111BJaZTp3P2MgbKmZNXH8ioVKRBgGADulsA9xupg\nGM7WEymYbOWho7NFRD3/AMJkSpvdNFbLho2qFgIaoudPzI3LeI++PLcH611e\nB0n5Sf/lq4dEhAw4LqVXpw6B5R+i8mznkUFlUeZqFox2ialGK2QXZ9hvIX6U\nGvR5hio0gEs8kOLvljuDY1fLRwu55/XGCoeHQzNwPhcvBT6OHHybBO+Irdfp\njvbnS4sMFem0VZpZnScJFYxWFDSi4dQ0uNjeoij3UgCICAzE42IjVAZUqg7N\n/3rbnBEnD4drcX63DLePhLUMjOlHWJ/3yNocaPBWoU1pyQXRatH1ZA8wDqKj\nmA7b6cEBUUCdhCQOCtvhIRVxdFu00+mwq11sf98phr+0tIsOWiBXSUp/g9R/\nESjl924KjR/RTw6lEzY37xQbjbJSvZ5LSz/809fmAh92JDOtys3welxwGfAw\n+vhOR0W0wKaE1EzKSCetHcBgMjVyxfJpm/GMo6Mws+otxheIaoQV6clOGbv0\nATpBX7u/Xx3lmXZJsPCrV8TJk4kjSSkufVIzd6c6ZB5CA76kMgKlgae/hh1Q\nnG3QKxuRLpoAPusMEPP5m94U9mVZKqj8IgR6lHMajfIZVZOhm1AYrKo2HjPH\nCyEa\r\n=B9Od\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICmyWM1GZw5UAYTD0dbyVCXB47EbTOKG/4rI888eamMNAiEAoS5/6EZh3G3RGtx+xFXCgl0MTfMOdeJhm0QPKdei9Kc="}]},"_npmUser":{"name":"arimethys","email":"arimethys@gmail.com"},"directories":{},"maintainers":[{"name":"arimethys","email":"arimethys@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ng2-img-max_2.2.8_1622078018423_0.18673456596596405"},"_hasShrinkwrap":false}},"time":{"created":"2021-05-26T17:22:17.573Z","2.2.5":"2021-05-26T17:22:17.769Z","modified":"2022-04-04T15:26:03.858Z","2.2.6":"2021-05-26T17:36:27.082Z","2.2.7":"2021-05-26T17:39:03.861Z","2.2.8":"2021-05-27T01:13:38.555Z"},"maintainers":[{"name":"arimethys","email":"arimethys@gmail.com"}],"description":"Angular module to resize images down to a certain width and height or to reduce the quality to fit a certain maximal filesize - all in the browser. Just an update of angular/core requirement","homepage":"https://github.com/arimethys/ng2-img-max#readme","keywords":["angular","angular2","img-max","maximal","size","limit","resize"],"repository":{"type":"git","url":"git+https://github.com/arimethys/ng2-img-max.git"},"author":{"name":"Arimethys","email":"arimethys@gmail.com"},"bugs":{"url":"https://github.com/arimethys/ng2-img-max/issues"},"license":"MIT","readme":"[![Join the chat at https://gitter.im/bergben/bergben](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/bergben/bergben?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n\n# Not actively maintained anymore, looking for maintainer\nUnfortunately I don't have time to actively maintain my open source repos anymore. If anyone wants to take over, feel free to contact me anytime, I'd be happy if this project still finds use. \n\n# ng2-img-max\nAngular 2 and beyond module to resize images down to a certain width and height or to reduce the quality to fit a certain maximal filesize - all in the browser.\n\nThis means, the huge image that the user may select will never even need to be uploaded to the server.\n\n## Demo\nA simple demo is available as a plnkr: http://plnkr.co/edit/HRi5rQEDCBZb59a0lcPe?p=preview\n\n## Browser support\nThis module is supported by all major browsers recent versions (IE 10+). \n\nMake sure to include the following polyfill for `HtmlCanvasElement.toBlob()`: https://www.npmjs.com/package/blueimp-canvas-to-blob\n\n```bash\n$ npm install blueimp-canvas-to-blob --save\n```\n\n\n\n### Make sure to check out [ng2-img-tools](https://github.com/bergben/ng2-img-tools) for further image manipulation such as resizing to an exact size (e.g. to create thumbnails) or image cropping as seen in the demo.\n\n## Install\n```bash\n$ npm install ng2-img-max --save\n```\n\n### Import the module\n```TypeScript\n// app.module.ts\nimport { NgModule } from '@angular/core';\nimport { BrowserModule } from '@angular/platform-browser';\nimport { Ng2ImgMaxModule } from 'ng2-img-max'; // <-- import the module\nimport { MyComponent } from './my.component';\n\n@NgModule({\n    imports: [BrowserModule,\n              Ng2ImgMaxModule // <-- include it in your app module\n             ],\n    declarations: [MyComponent],  \n    bootstrap: [MyComponent]\n})\nexport class MyAppModule {}\n```\n## Usage\n```TypeScript\nimport { Ng2ImgMaxService } from 'ng2-img-max';\n[...]\n    constructor(private ng2ImgMaxService: Ng2ImgMaxService) {\n        this.ng2ImgMaxService.resize([someImage], 2000, 1000).subscribe((result)=>{\n        });\n    }\n}\n```\n\n## Methods\n### Maximal filesize\n#### IMPORTANT: Catch error cases\nWhen using the compression methods you should make sure to catch the error cases. \nIf an error happens, you will receive an object with the following properties: \n `compressedFile`:`File`, `reason`: `string` and `error`:`string`\n\nPossible errors are: <br /> \n<b>`INVALID_EXTENSION`</b>: File provided is neither of type jpg nor of type png). The `compressedFile` is the original file. <br />\n<b>`PNG_WITH_ALPHA`</b>: File provided is a png image which uses the alpha channel. No compression possible unless `ignoreAlpha` is set to true. The `compressedFile` is the original file.<br />\n<b>`MAX_STEPS_EXCEEDED`</b>: Could not find the correct compression quality in 15 steps - abort. This should rarely to never at all happen. The `compressedFile` is the result of step 15 of the compression.<br />\n<b>`FILE_BIGGER_THAN_INITIAL_FILE`</b>: This should actually never happen, just a precaution. The `compressedFile` is the original file.<br />\n<b>`UNABLE_TO_COMPRESS_ENOUGH`</b>: Could not compress image enough to fit the maximal file size limit. The `compressedFile` is a compression as close as it can get.<br />\n\nExample code catch errors:\n\n ```TypeScript\nthis.ng2ImgMaxService.resize([someImage], 2000, 1000).subscribe(result => {\n    //all good, result is a file\n    console.info(result);\n}, error => {\n    //something went wrong \n    //use result.compressedFile or handle specific error cases individually\n});\n```\n\n#### `compress(files: File[], maxSizeInMB: number, ignoreAlpha: boolean = false, logExecutionTime: boolean = false): Observable<any>` \nMethod to compress an image. This reduces the quality of an image down until it fits a certain fileSize which is given as `maxSizeInMB`.\nSet `ignoreAlpha` to true if you want to ignore the alpha channel for png images and compress them nonetheless (not recommended - the alpha channel will be lost and the resulting image might differ from the original image).\nReturns an observable that for every file given, onNext receives either a File when everything went as planned or an error Object if something went wrong. \n\n#### `compressImage` \nSame as above just that it takes in only one file instead of a whole array of files.\n\n### Maximal width / height\n\n#### `resize(files: File[], maxWidth: number, maxHeight: number, logExecutionTime: boolean = false): Observable<any>` \nMethod to resize files if necessary down to a certain maximal width or maximal height in px. If you want only one limit just set the other max to 10.000: for example `resize([myfile1,myfile2],2000,10000).subscribe([...]`\n\n#### `resizeImage` \nSame as above just that it takes in only one file instead of a whole array of files.\n\n### Get EXIF oriented image \n#### `getEXIFOrientedImage(image:HTMLImageElement): Promise<HTMLImageElement>`\nMethod that returns an image respecting the EXIF orientation data.\n\n## Contribute \nDue to the lack of other algorithms that also reduce the filesize of an image by reducing the quality until it fits a certain limit, help to find the best possible algorithm to do so is much appreciated.\nThe current algorithm can be found here: https://github.com/bergben/ng2-img-max/blob/master/src/img-max-size.service.ts.\n\n## Limitations\nAlthough the resizing functions do use web workers to do the heavy work, this is not possible for the compression methods. The reasons for this are that a web worker does not have access to the DOM and can therefor not create a new HtmlCanvasElement. Neither can it be passed as a parameter to the web worker, as a web worker can only receive serializable data, which only be the ImageData but that can only be turned into a 2DCanvasContext, not a HtmlCanvasElement itself without the DOM. \n","readmeFilename":"README.md"}