libvips / pyvips

python binding for libvips using cffi
MIT License
649 stars 50 forks source link

Assertion failed: sp->cinfo.comm.is_decompressor #468

Open euzada opened 6 months ago

euzada commented 6 months ago

Hi,

My code (python) was working correctly. One time my PC rebooted (crashed) for another reasons (wsl) and now when I try to run the script, I always get the following error:

Assertion failed: sp->cinfo.comm.is_decompressor, file /var/tmp/tmp-tiff-x86_64-w64-mingw32.shared.posix.web/tiff-4.6.0/libtiff/tif_jpeg.c, line 1115

I am on windows, I can't access /var/tmp and I don't know how to fix it. I dumped python and restart a new env (conda), but didn't help. I deleted libvips folder and past it again (it is in my PATH), but no sucess. I don't know what happened but no solution so far.

Any idea or suggestion? Google search didn't help.

Thanks,

euzada commented 6 months ago

The problem solved by building libvips without "--with-jpegli". I am not sure if it is related but it works for now.

I will build it again with "--with-jpegli" and see if it will work or not. Maybe the crash did something to my libtiff.

kleisauke commented 6 months ago

It sounds like libtiff is built against MozJPEG and jpegli is used at runtime, or vice versa.

When building with --with-jpegli (or --with-jpeg-turbo), you'll need to ensure a clean state by deleting the entire build/mxe/usr/<MINGW_TARGET> directory. Replace <MINGW_TARGET> with your specific target, such as x86_64-w64-mingw32.shared.posix.all, which varies depending on your build configuration.

euzada commented 6 months ago

It sounds like libtiff is built against MozJPEG and jpegli is used at runtime, or vice versa.

When building with --with-jpegli (or --with-jpeg-turbo), you'll need to ensure a clean state by deleting the entire build/mxe/usr/<MINGW_TARGET> directory. Replace <MINGW_TARGET> with your specific target, such as x86_64-w64-mingw32.shared.posix.all, which varies depending on your build configuration.

Thank you for your answer. mine is x86_64-w64-mingw32.shared.posix.web

I am going to follow your instructions and build one version with --with-jpegli and another with --with-jpeg-turbo and will test it and share my feedback.