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

class "jxlsave" not found #467

Open
euzada opened this issue May 1, 2024 · 9 comments
Open

class "jxlsave" not found #467

euzada opened this issue May 1, 2024 · 9 comments

Comments

@euzada
Copy link

euzada commented May 1, 2024

Hi @jcupitt,

I tried to save an image as jpeg XL but getting the following error:

pyvips.error.Error: no such operation jxlsave
  VipsOperation: class "jxlsave" not found

I compiled libvips for windows with ./build.sh --with-jpegli but didn't work. I saw that since version v8.11.0 that Add libjxl to 'all' group dependencies for JPEG XL support (https://github.com/libvips/build-win64-mxe/pull/28).. I used 'all' version and still having the same issue. I cannot use jxlsave in pyvips.

pyvips version = 2.2.3
libvips version = vips-8.15.2

Any suggestion?

@jcupitt
Copy link
Member

jcupitt commented May 1, 2024

Hello @euzada,

Did you try the official win binary? It should include jxlsave.

https://github.com/libvips/build-win64-mxe/releases/tag/v8.15.2

You need 8.15.2 w64 all.

@euzada
Copy link
Author

euzada commented May 2, 2024

Hello @euzada,

Did you try the official win binary? It should include jxlsave.

https://github.com/libvips/build-win64-mxe/releases/tag/v8.15.2

You need 8.15.2 w64 all.

Yes I did. getting the following error:

  jxlsave: error JxlEncoderProcessOutput```

@jcupitt
Copy link
Member

jcupitt commented May 2, 2024

Oh, strange, let me try here.

@jcupitt
Copy link
Member

jcupitt commented May 2, 2024

I tried on a win10 VM and it seems to work:

jcupi@DESKTOP-HGI6HBR MINGW64 /f/Pictures
$ ../vips-dev-8.15/bin/vips.exe copy DL-742.png x.jxl

jcupi@DESKTOP-HGI6HBR MINGW64 /f/Pictures
$ ../vips-dev-8.15/bin/vips.exe --version
vips-8.15.0

And the image seems fine. I'll try with the latest build.

@kleisauke
Copy link
Member

jxlsave: error JxlEncoderProcessOutput

I could not reproduce this with the vips-dev-w64-all-8.15.2.zip binaries on my Windows 11 PC.

$ python
Python 3.12.3 (tags/v3.12.3:f6650f9, Apr  9 2024, 14:05:25) [MSC v.1938 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyvips
>>> ref = pyvips.Image.new_from_file('zebra.jpg')
>>> ref.jxlsave('x.jxl', lossless=True)
>>> x = pyvips.Image.new_from_file('x.jxl', access='sequential')
>>> (ref - x).abs().max()
0.0
>>>

@euzada
Copy link
Author

euzada commented May 2, 2024

Hi,

I figure it out. I am having this image only for output image larger than 10kx10k image. For smaller images, it works, for larger it said jxlsave not found.

@jcupitt
Copy link
Member

jcupitt commented May 3, 2024

Could it be running out of memory? Until very recently, libjxl could use HUGE amounts of ram for larger images.

vipsdisp 3.0.4 for win is built against a recent libjxl. It could be worth checking memuse for that program when saving a large JXL image.

@kleisauke
Copy link
Member

Indeed, it sounds like an OOM error. I was able to create a 100000x100000 image without any issues.

$ python
Python 3.12.3 (tags/v3.12.3:f6650f9, Apr  9 2024, 14:05:25) [MSC v.1938 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyvips
>>> x = pyvips.Image.black(100000, 100000, bands=3)
>>> x.jxlsave('x.jxl')
>>> pyvips.Image.new_from_file('x.jxl', access='sequential')
<pyvips.Image 100000x100000 uchar, 3 bands, srgb>
>>>

@jcupitt
Copy link
Member

jcupitt commented May 3, 2024

I tried making a JXL image with libjxl 0.7:

$ /usr/bin/time -f %M:%e vips replicate nina.jpg x.jxl 2 3 
10983132:22.56

That's 11gb of memory for a 12k x 12k image. With 0.10.1 I see:

$ /usr/bin/time -f %M:%e vips replicate nina.jpg x.jxl 2 3 
1314856:70.23

A more reasonable 1.3gb, though it's noticeably slower for some reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants