Skip to content

Commit

Permalink
feat: add support for JPEG 2000 (#15710)
Browse files Browse the repository at this point in the history
* chore(server): add support for .jp2

* docs: add support for .jp2

* chore: fix tests

* fix formatting

* unify sorting
  • Loading branch information
ayykamp authored Jan 28, 2025
1 parent da580d4 commit cc0cbd7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
33 changes: 17 additions & 16 deletions docs/docs/features/supported-formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,23 @@ For the full list, refer to the [Immich source code](https://github.com/immich-a

## Image formats

| Format | Extension(s) | Supported? | Notes |
| :-------- | :---------------------------- | :----------------: | :-------------- |
| `AVIF` | `.avif` | :white_check_mark: | |
| `BMP` | `.bmp` | :white_check_mark: | |
| `GIF` | `.gif` | :white_check_mark: | |
| `HEIC` | `.heic` | :white_check_mark: | |
| `HEIF` | `.heif` | :white_check_mark: | |
| `JPEG` | `.webp` `.jpg` `.jpe` `.insp` | :white_check_mark: | |
| `JPEG XL` | `.jxl` | :white_check_mark: | |
| `PNG` | `.webp` | :white_check_mark: | |
| `PSD` | `.psd` | :white_check_mark: | Adobe Photoshop |
| `RAW` | `.raw` | :white_check_mark: | |
| `RW2` | `.rw2` | :white_check_mark: | |
| `SVG` | `.svg` | :white_check_mark: | |
| `TIFF` | `.tif` `.tiff` | :white_check_mark: | |
| `WEBP` | `.webp` | :white_check_mark: | |
| Format | Extension(s) | Supported? | Notes |
| :---------- | :---------------------------- | :----------------: | :-------------- |
| `AVIF` | `.avif` | :white_check_mark: | |
| `BMP` | `.bmp` | :white_check_mark: | |
| `GIF` | `.gif` | :white_check_mark: | |
| `HEIC` | `.heic` | :white_check_mark: | |
| `HEIF` | `.heif` | :white_check_mark: | |
| `JPEG 2000` | `.jp2` | :white_check_mark: | |
| `JPEG` | `.webp` `.jpg` `.jpe` `.insp` | :white_check_mark: | |
| `JPEG XL` | `.jxl` | :white_check_mark: | |
| `PNG` | `.webp` | :white_check_mark: | |
| `PSD` | `.psd` | :white_check_mark: | Adobe Photoshop |
| `RAW` | `.raw` | :white_check_mark: | |
| `RW2` | `.rw2` | :white_check_mark: | |
| `SVG` | `.svg` | :white_check_mark: | |
| `TIFF` | `.tif` `.tiff` | :white_check_mark: | |
| `WEBP` | `.webp` | :white_check_mark: | |

## Video formats

Expand Down
1 change: 1 addition & 0 deletions server/src/services/asset-media.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const validImages = [
'.heic',
'.heif',
'.iiq',
'.jp2',
'.jpeg',
'.jpg',
'.jxl',
Expand Down
1 change: 1 addition & 0 deletions server/src/utils/mime-types.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ describe('mimeTypes', () => {
{ mimetype: 'image/heif', extension: '.heif' },
{ mimetype: 'image/hif', extension: '.hif' },
{ mimetype: 'image/iiq', extension: '.iiq' },
{ mimetype: 'image/jp2', extension: '.jp2' },
{ mimetype: 'image/jpeg', extension: '.jpe' },
{ mimetype: 'image/jpeg', extension: '.jpeg' },
{ mimetype: 'image/jpeg', extension: '.jpg' },
Expand Down
1 change: 1 addition & 0 deletions server/src/utils/mime-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const image: Record<string, string[]> = {
'.heif': ['image/heif'],
'.hif': ['image/hif'],
'.insp': ['image/jpeg'],
'.jp2': ['image/jp2'],
'.jpe': ['image/jpeg'],
'.jpeg': ['image/jpeg'],
'.jpg': ['image/jpeg'],
Expand Down

0 comments on commit cc0cbd7

Please sign in to comment.