Skip to content

Commit

Permalink
build: v2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Donaldcwl committed Mar 5, 2023
1 parent 227aeca commit db6a08a
Show file tree
Hide file tree
Showing 21 changed files with 859 additions and 570 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 2.0.1 (XX Mar 2023)
## 2.0.1 (6 Mar 2023)
* feature: preserve Exif metadata for JPEG [#164](https://github.com/Donaldcwl/browser-image-compression/issues/164)
* feature: support BMP image compression [#181](https://github.com/Donaldcwl/browser-image-compression/issues/181)
* optimized: solved error in sensible CSP environment [#106](https://github.com/Donaldcwl/browser-image-compression/issues/106)
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ Javascript module to be run in the web browser for image compression.
- **Multi-thread** (web worker) non-blocking compression is supported through options.


## Upgrade to version 2
Note that core-js is dropped in version 2, please read the [IE support](#ie-support) section.

## Demo / Example
open https://donaldcwl.github.io/browser-image-compression/example/basic.html

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.
8 changes: 8 additions & 0 deletions coverage/block-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ var jumpToCode = (function init() {
}

return function jump(event) {
if (
document.getElementById('fileSearch') === document.activeElement &&
document.activeElement != null
) {
// if we're currently focused on the search input, we don't want to navigate
return;
}

switch (event.which) {
case 78: // n
case 74: // j
Expand Down
12 changes: 7 additions & 5 deletions coverage/coverage-final.json

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions coverage/coverage-summary.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{"total": {"lines":{"total":295,"covered":239,"skipped":0,"pct":81.01},"statements":{"total":303,"covered":242,"skipped":0,"pct":79.86},"functions":{"total":30,"covered":27,"skipped":0,"pct":90},"branches":{"total":171,"covered":115,"skipped":0,"pct":67.25}}
,"D:\\Projects\\browser-image-compression\\lib\\image-compression.js": {"lines":{"total":61,"covered":60,"skipped":0,"pct":98.36},"functions":{"total":3,"covered":3,"skipped":0,"pct":100},"statements":{"total":61,"covered":60,"skipped":0,"pct":98.36},"branches":{"total":39,"covered":32,"skipped":0,"pct":82.05}}
,"D:\\Projects\\browser-image-compression\\lib\\index.js": {"lines":{"total":46,"covered":37,"skipped":0,"pct":80.43},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":46,"covered":37,"skipped":0,"pct":80.43},"branches":{"total":30,"covered":17,"skipped":0,"pct":56.66}}
,"D:\\Projects\\browser-image-compression\\lib\\utils.js": {"lines":{"total":188,"covered":142,"skipped":0,"pct":75.53},"functions":{"total":25,"covered":22,"skipped":0,"pct":88},"statements":{"total":196,"covered":145,"skipped":0,"pct":73.97},"branches":{"total":102,"covered":66,"skipped":0,"pct":64.7}}
{"total": {"lines":{"total":414,"covered":371,"skipped":0,"pct":89.61},"statements":{"total":430,"covered":379,"skipped":0,"pct":88.13},"functions":{"total":42,"covered":39,"skipped":0,"pct":92.85},"branches":{"total":216,"covered":153,"skipped":0,"pct":70.83},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}}
,"D:\\Projects\\browser-image-compression\\lib\\canvastobmp.js": {"lines":{"total":56,"covered":56,"skipped":0,"pct":100},"functions":{"total":7,"covered":7,"skipped":0,"pct":100},"statements":{"total":57,"covered":57,"skipped":0,"pct":100},"branches":{"total":4,"covered":4,"skipped":0,"pct":100}}
,"D:\\Projects\\browser-image-compression\\lib\\copyExifWithoutOrientation.js": {"lines":{"total":44,"covered":41,"skipped":0,"pct":93.18},"functions":{"total":4,"covered":4,"skipped":0,"pct":100},"statements":{"total":50,"covered":43,"skipped":0,"pct":86},"branches":{"total":19,"covered":13,"skipped":0,"pct":68.42}}
,"D:\\Projects\\browser-image-compression\\lib\\image-compression.js": {"lines":{"total":64,"covered":63,"skipped":0,"pct":98.43},"functions":{"total":3,"covered":3,"skipped":0,"pct":100},"statements":{"total":64,"covered":63,"skipped":0,"pct":98.43},"branches":{"total":41,"covered":35,"skipped":0,"pct":85.36}}
,"D:\\Projects\\browser-image-compression\\lib\\index.js": {"lines":{"total":55,"covered":43,"skipped":0,"pct":78.18},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":55,"covered":43,"skipped":0,"pct":78.18},"branches":{"total":43,"covered":23,"skipped":0,"pct":53.48}}
,"D:\\Projects\\browser-image-compression\\lib\\utils.js": {"lines":{"total":195,"covered":168,"skipped":0,"pct":86.15},"functions":{"total":26,"covered":23,"skipped":0,"pct":88.46},"statements":{"total":204,"covered":173,"skipped":0,"pct":84.8},"branches":{"total":109,"covered":78,"skipped":0,"pct":71.55}}
,"D:\\Projects\\browser-image-compression\\lib\\config\\browser-name.js": {"lines":{"total":0,"covered":0,"skipped":0,"pct":100},"functions":{"total":0,"covered":0,"skipped":0,"pct":100},"statements":{"total":0,"covered":0,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
,"D:\\Projects\\browser-image-compression\\lib\\config\\max-canvas-size.js": {"lines":{"total":0,"covered":0,"skipped":0,"pct":100},"functions":{"total":0,"covered":0,"skipped":0,"pct":100},"statements":{"total":0,"covered":0,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
}
Binary file modified coverage/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 28 additions & 23 deletions coverage/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,45 @@ <h1>All files</h1>
<div class='clearfix'>

<div class='fl pad1y space-right2'>
<span class="strong">79.86% </span>
<span class="strong">88.13% </span>
<span class="quiet">Statements</span>
<span class='fraction'>242/303</span>
<span class='fraction'>379/430</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">67.25% </span>
<span class="strong">70.83% </span>
<span class="quiet">Branches</span>
<span class='fraction'>115/171</span>
<span class='fraction'>153/216</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">90% </span>
<span class="strong">92.85% </span>
<span class="quiet">Functions</span>
<span class='fraction'>27/30</span>
<span class='fraction'>39/42</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">81.01% </span>
<span class="strong">89.61% </span>
<span class="quiet">Lines</span>
<span class='fraction'>239/295</span>
<span class='fraction'>371/414</span>
</div>


</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input oninput="onInput()" type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line medium'></div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
Expand All @@ -73,18 +79,18 @@ <h1>All files</h1>
</tr>
</thead>
<tbody><tr>
<td class="file medium" data-value="lib"><a href="lib/index.html">lib</a></td>
<td data-value="79.86" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 79%"></div><div class="cover-empty" style="width: 21%"></div></div>
<td class="file high" data-value="lib"><a href="lib/index.html">lib</a></td>
<td data-value="88.13" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 88%"></div><div class="cover-empty" style="width: 12%"></div></div>
</td>
<td data-value="79.86" class="pct medium">79.86%</td>
<td data-value="303" class="abs medium">242/303</td>
<td data-value="67.25" class="pct medium">67.25%</td>
<td data-value="171" class="abs medium">115/171</td>
<td data-value="90" class="pct high">90%</td>
<td data-value="30" class="abs high">27/30</td>
<td data-value="81.01" class="pct high">81.01%</td>
<td data-value="295" class="abs high">239/295</td>
<td data-value="88.13" class="pct high">88.13%</td>
<td data-value="430" class="abs high">379/430</td>
<td data-value="70.83" class="pct medium">70.83%</td>
<td data-value="216" class="abs medium">153/216</td>
<td data-value="92.85" class="pct high">92.85%</td>
<td data-value="42" class="abs high">39/42</td>
<td data-value="89.61" class="pct high">89.61%</td>
<td data-value="414" class="abs high">371/414</td>
</tr>

<tr>
Expand All @@ -109,10 +115,9 @@ <h1>All files</h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Apr 13 2022 03:48:38 GMT+0800 (Hong Kong Standard Time)
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2023-03-05T17:51:30.884Z
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
Expand Down
8 changes: 8 additions & 0 deletions coverage/lcov-report/block-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ var jumpToCode = (function init() {
}

return function jump(event) {
if (
document.getElementById('fileSearch') === document.activeElement &&
document.activeElement != null
) {
// if we're currently focused on the search input, we don't want to navigate
return;
}

switch (event.which) {
case 78: // n
case 74: // j
Expand Down
Binary file modified coverage/lcov-report/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 28 additions & 23 deletions coverage/lcov-report/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,45 @@ <h1>All files</h1>
<div class='clearfix'>

<div class='fl pad1y space-right2'>
<span class="strong">79.86% </span>
<span class="strong">88.13% </span>
<span class="quiet">Statements</span>
<span class='fraction'>242/303</span>
<span class='fraction'>379/430</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">67.25% </span>
<span class="strong">70.83% </span>
<span class="quiet">Branches</span>
<span class='fraction'>115/171</span>
<span class='fraction'>153/216</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">90% </span>
<span class="strong">92.85% </span>
<span class="quiet">Functions</span>
<span class='fraction'>27/30</span>
<span class='fraction'>39/42</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">81.01% </span>
<span class="strong">89.61% </span>
<span class="quiet">Lines</span>
<span class='fraction'>239/295</span>
<span class='fraction'>371/414</span>
</div>


</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input oninput="onInput()" type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line medium'></div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
Expand All @@ -73,18 +79,18 @@ <h1>All files</h1>
</tr>
</thead>
<tbody><tr>
<td class="file medium" data-value="lib"><a href="lib/index.html">lib</a></td>
<td data-value="79.86" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 79%"></div><div class="cover-empty" style="width: 21%"></div></div>
<td class="file high" data-value="lib"><a href="lib/index.html">lib</a></td>
<td data-value="88.13" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 88%"></div><div class="cover-empty" style="width: 12%"></div></div>
</td>
<td data-value="79.86" class="pct medium">79.86%</td>
<td data-value="303" class="abs medium">242/303</td>
<td data-value="67.25" class="pct medium">67.25%</td>
<td data-value="171" class="abs medium">115/171</td>
<td data-value="90" class="pct high">90%</td>
<td data-value="30" class="abs high">27/30</td>
<td data-value="81.01" class="pct high">81.01%</td>
<td data-value="295" class="abs high">239/295</td>
<td data-value="88.13" class="pct high">88.13%</td>
<td data-value="430" class="abs high">379/430</td>
<td data-value="70.83" class="pct medium">70.83%</td>
<td data-value="216" class="abs medium">153/216</td>
<td data-value="92.85" class="pct high">92.85%</td>
<td data-value="42" class="abs high">39/42</td>
<td data-value="89.61" class="pct high">89.61%</td>
<td data-value="414" class="abs high">371/414</td>
</tr>

<tr>
Expand All @@ -109,10 +115,9 @@ <h1>All files</h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Apr 13 2022 03:48:38 GMT+0800 (Hong Kong Standard Time)
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2023-03-05T17:51:30.921Z
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
Expand Down
Binary file modified coverage/lcov-report/sort-arrow-sprite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions coverage/lcov-report/sorter.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,31 @@ var addSorting = (function() {
return getTableHeader().querySelectorAll('th')[n];
}

function onFilterInput() {
const searchValue = document.getElementById('fileSearch').value;
const rows = document.getElementsByTagName('tbody')[0].children;
for (let i = 0; i < rows.length; i++) {
const row = rows[i];
if (
row.textContent
.toLowerCase()
.includes(searchValue.toLowerCase())
) {
row.style.display = '';
} else {
row.style.display = 'none';
}
}
}

// loads the search box
function addSearchBox() {
var template = document.getElementById('filterTemplate');
var templateClone = template.content.cloneNode(true);
templateClone.getElementById('fileSearch').oninput = onFilterInput;
template.parentElement.appendChild(templateClone);
}

// loads all columns
function loadColumns() {
var colNodes = getTableHeader().querySelectorAll('th'),
Expand Down Expand Up @@ -162,6 +187,7 @@ var addSorting = (function() {
}
cols = loadColumns();
loadData();
addSearchBox();
addSortIndicators();
enableUI();
};
Expand Down
Loading

0 comments on commit db6a08a

Please sign in to comment.