@w5/img2jpg
TypeScript icon, indicating that this package has built-in type declarations

0.0.16 • Public • Published

@w5/img2jpg

Install

pnpm i -g @w5/img2jpg

Test

coffee/main.coffee :

#!/usr/bin/env coffee

> ../index.js:imgJpg
  ava:test
  path > join dirname
  @w5/uridir
  @w5/write
  # @w5/read
  fs > readFileSync

ROOT = dirname uridir import.meta
IMG = join ROOT, 'img'

test(
  'img → jpg'
  (t) =>
    for img from ['rgba16','rgb8','rgb16','rgba8']
      r = await imgJpg(
        readFileSync join IMG, img+'.avif'
        'avif'
        80 # https://docs.rs/jpegxl-rs/latest/jpegxl_rs/encode/struct.JpgEncoderBuilder.html#method.quality
      )
      write(
        join(IMG, img+'.jpg')
        r
      )
      t.true(r instanceof Buffer)
    # t.pass()
    return
)

output :


  ✔ img → jpg (7.2s)
  ─

  1 test passed

Readme

Keywords

none

Package Sidebar

Install

npm i @w5/img2jpg

Weekly Downloads

0

Version

0.0.16

License

MIT

Unpacked Size

660 kB

Total Files

41

Last publish

Collaborators

  • i-user