Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
strategy:
matrix:
node: ['lts/*', 'current']
name: "Node ${{ matrix.node }} (macOS)"
name: "Node ${{ matrix.node }} (macOS, all browsers)"
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
Expand All @@ -50,9 +50,5 @@ jobs:
cache: npm
- name: "Install dependencies"
run: npm ci
- name: "Lint"
run: npm run lint
- name: "Build"
run: npm run build
- name: "Test"
run: npm test
- name: "Test (full browser matrix)"
run: npm run test:full
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ All notable changes to Compressor.js Next are documented in this file, which is

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.0] - 2026-02-20

### Fixed

* EXIF data is now consistently stripped across all browsers when `retainExif` is false—WebKit's canvas previously preserved the source EXIF in JPEG output

### Changed

* Expanded browser test matrix to include Firefox and WebKit (in addition to Chromium)

### Removed

* Removed `checkOrientation` option—all modern browsers now apply EXIF orientation natively via `image-orientation: from-image` (including in `canvas.drawImage()`), making manual correction redundant

## [1.1.2] - 2026-02-16

### Fixed
Expand Down
20 changes: 4 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ A JavaScript image compressor and converter. Uses the browser’s native [HTMLCa

Change the package name from `compressorjs` to `compressorjs-next` in your `package.json` and imports (`import Compressor from 'compressorjs-next'`).

The API is otherwise the same, with these exceptions (as of 1.1.0—follow [the changelog](https://github.com/j9t/compressorjs-next/blob/main/CHANGELOG.md) from there):
The API is otherwise the same, with these exceptions (as of 2.0.0—follow [the changelog](https://github.com/j9t/compressorjs-next/blob/main/CHANGELOG.md) from there):

* ESM is now the default module format (CommonJS is still supported)
* The `noConflict()` method has been removed
* The `checkOrientation` option has been removed, as all supported browsers now handle EXIF orientation natively
* The default for `convertTypes` has changed from `['image/png']` to `[]`
* The `noConflict()` method has been removed
* Internet Explorer is no longer supported

## Main files
Expand Down Expand Up @@ -85,7 +86,7 @@ document.getElementById('file').addEventListener('change', (e) => {
return;
}

new Compressor(file, {
const compressor = new Compressor(file, {
quality: 0.6,

// The compression process is asynchronous,
Expand Down Expand Up @@ -130,19 +131,6 @@ Indicates whether to output the original image instead of the compressed one whe
* The `maxWidth` option is set and its value is less than the natural width of the image.
* The `maxHeight` option is set and its value is less than the natural height of the image.

### `checkOrientation`

* Type: `boolean`
* Default: `true`

Indicates whether to read the image’s Exif Orientation value (JPEG image only), and then rotate or flip the image automatically with the value.

**Notes:**

* Don’t trust this all the time as some JPEG images have incorrect (not standard) `Orientation` values.
* If the size of the target image is too large (e.g., greater than 10 MB), you should disable this option to avoid an out-of-memory crash.
* The image’s Exif information will be removed after compressed, so if you need the Exif information, you may need to upload the original image as well.

### `retainExif`

* Type: `boolean`
Expand Down
6 changes: 0 additions & 6 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ <h4 class="card-header">Options</h4>
<label class="form-check-label" for="inputStrict">strict</label>
</div>
</fieldset>
<fieldset class="mb-3">
<div class="form-check form-check-inline">
<input type="checkbox" name="checkOrientation" class="form-check-input" id="inputCheckOrientation" v-model="options.checkOrientation">
<label class="form-check-label" for="inputCheckOrientation">checkOrientation</label>
</div>
</fieldset>
<fieldset class="mb-3">
<div class="form-check form-check-inline">
<input type="checkbox" name="retainExif" class="form-check-input" id="inputRetainExif" v-model="options.retainExif">
Expand Down
1 change: 0 additions & 1 deletion docs/setup/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ window.addEventListener('DOMContentLoaded', function () {
return {
options: {
strict: true,
checkOrientation: true,
retainExif: false,
maxWidth: undefined,
maxHeight: undefined,
Expand Down
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export default [
globals: {
window: 'readonly',
document: 'readonly',
navigator: 'readonly',
console: 'readonly',
Image: 'readonly',
FileReader: 'readonly',
Expand Down
19 changes: 10 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,16 @@
"lint:js": "eslint src test",
"prepare": "husky",
"pretest": "playwright install chromium",
"release": "npm run clean && npm run lint && npm run build && npm run compress && npm test",
"pretest:full": "playwright install",
"release": "npm run clean && npm run lint && npm run build && npm run compress && npm run test:full",
"start": "npm run dev",
"test": "vitest run",
"test:coverage": "vitest run --coverage",
"test:watch": "vitest"
"test": "vitest run --project=chromium",
"test:coverage": "vitest run --coverage --project=chromium",
"test:full": "vitest run",
"test:watch": "vitest --project=chromium"
},
"sideEffects": false,
"type": "module",
"types": "types/index.d.ts",
"version": "1.1.2"
"version": "2.0.0"
}
7 changes: 0 additions & 7 deletions src/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ export default {
*/
strict: true,

/**
* Indicates if read the image’s Exif Orientation information,
* and then rotate or flip the image automatically.
* @type {boolean}
*/
checkOrientation: true,

/**
* Indicates if retain the image’s Exif information after compressed.
* @type {boolean}
Expand Down
Loading