Skip to content

Commit

Permalink
Bump squoosh to the latest version (#29506)
Browse files Browse the repository at this point in the history
Bump `squoosh` to the latest version, currently commit [cad09160](GoogleChromeLabs/squoosh@cad0916).

Ideally, we would use the version published to npm but it hasn't been published in [two months](https://www.npmjs.com/package/@squoosh/lib?activeTab=versions) and we have a patch (#23565) that isn't available upstream.

This also is a precursor to getting support for AVIF.

- Fixes #27092
- Fixes #26527 
- Reapplies the patch from #23565
  • Loading branch information
styfle committed Oct 6, 2021
1 parent 6329930 commit 5e29723
Show file tree
Hide file tree
Showing 30 changed files with 11,089 additions and 4,565 deletions.
32 changes: 32 additions & 0 deletions packages/next/server/lib/squoosh/avif/avif_enc.d.ts
@@ -0,0 +1,32 @@
// eslint-disable-next-line no-shadow
export const enum AVIFTune {
auto,
psnr,
ssim,
}

export interface EncodeOptions {
cqLevel: number
denoiseLevel: number
cqAlphaLevel: number
tileRowsLog2: number
tileColsLog2: number
speed: number
subsample: number
chromaDeltaQ: boolean
sharpness: number
tune: AVIFTune
}

export interface AVIFModule extends EmscriptenWasm.Module {
encode(
data: BufferSource,
width: number,
height: number,
options: EncodeOptions
): Uint8Array
}

declare var moduleFactory: EmscriptenWasm.ModuleFactory<AVIFModule>

export default moduleFactory

0 comments on commit 5e29723

Please sign in to comment.