Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toFormat("jxl") throws an error #4153

Closed
oscarotero opened this issue Jul 3, 2024 · 2 comments
Closed

toFormat("jxl") throws an error #4153

oscarotero opened this issue Jul 3, 2024 · 2 comments
Labels

Comments

@oscarotero
Copy link

oscarotero commented Jul 3, 2024

I'm using Sharp 0.33.4 with Node.js v22.3.0 on a macOS 12.7.5

The following code runs well in sharp:

import sharp from "sharp"

sharp("avatar.png")
  .resize(300, 200)
  .toFormat("webp")
  .toFile("avatar.webp")

but when I want to save it to jxl:

import sharp from "sharp"

sharp("avatar.png")
  .resize(300, 200)
  .toFormat("jxl")
  .toFile("avatar.jxl")

It shows the following error:

/Users/oscarotero/www/lumeland/issues/630/node_modules/sharp/lib/output.js:89
    const stack = Error();
                  ^

Error: VipsOperation: class "jxlsave" not found
    at Sharp.toFile (/Users/oscarotero/test/node_modules/sharp/lib/output.js:89:19)
    at file:///Users/oscarotero/test/sharp.mjs:6:4
    at ModuleJob.run (node:internal/modules/esm/module_job:262:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:474:24)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:109:5)
@lovell
Copy link
Owner

lovell commented Jul 3, 2024

https://sharp.pixelplumbing.com/api-output#jxl

Requires libvips compiled with support for libjxl. The prebuilt binaries do not include this

Please see #2731 (comment)

@oscarotero
Copy link
Author

Understood!!
Thanks for your time and sorry for the noise 🙏

@lovell lovell closed this as completed Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants