Skip to content

Commit

Permalink
Fix copying of JPEG EXIF into WebP
Browse files Browse the repository at this point in the history
  • Loading branch information
dtdesign committed Jan 17, 2025
1 parent 6b9ac71 commit 1021b7c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ts/WoltLabSuite/Core/Image/WebP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ class WebP {
}

exportWithExif(exif: Exif): Uint8Array {
// The EXIF might originate from a JPEG thus we need to strip the header.
if (exif[0] === 0xff && exif[1] === 0xe1 && exif[2] === 0xc3 && exif[3] === 0xef) {
exif = exif.slice(10);
}

const iccp = this.#getChunk(ChunkHeader.ICCP);
const anim = this.#getChunk(ChunkHeader.ANIM);

Expand Down
4 changes: 4 additions & 0 deletions wcfsetup/install/files/js/WoltLabSuite/Core/Image/WebP.js

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

0 comments on commit 1021b7c

Please sign in to comment.