-
Notifications
You must be signed in to change notification settings - Fork 15
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
Libtiff issue while building --with-jepgli #69
Comments
Hi @kleisauke, |
Performing a round-trip conversion from JPEG to TIFF using a binary built with $ vips copy zebra.jpg x.tiff[compression=jpeg]
$ vips copy x.tiff x.jpg I did not encounter such issues in the libvips test suite either. Did you completely remove the Also, what type of binary did you build? IIRC, I only tested the jpegli integration with the shared builds. |
Thank you for your reply. I build mine with default like that which is web, shared and x86_64: I removed /build-win64-mxe completely before clone it again and rebuilding it. I get "vips-dev-w64-web-8.16.0-jpegli.zip". Do you mind sharing with me your binary? Regards, |
Hmm, can you reproduce this error with the newly created binaries? I'm using the exact same build command, so I don't think there's any difference between these binaries. |
I rebuild it right now and get "vips-dev-w64-web-030cbf9-disp-jpegli.zip". I added --with-disp and --nightly for the latest update. When I test it, I get again:
checking the libtiff website, here is the line where the error occured: [tiff_jpeg.c line1089](https://gitlab.com/libtiff/libtiff/-/blob/master/libtiff/tif_jpeg.c?ref_type=heads#L1089) This error again is about my input images that the libtiff had hard time to decompress the files. If I build it without jepgli, with turbo or mozjpeg, it works no issues. The libtiff can read my input files. I tested to read one file as input created as tiff with jpeg compression for a already stich image using turbo-jpeg, and it read it and save it with jpegli with no issue. except I got this warning: But if I tried to use the input images that was taken by microscope, it failed with assertion failed mentioned above. Do you think my input images has issues but only when libtiff build with jpegli? |
Are you able to provide a sample image that allows someone else to reproduce? If not, could you run
It sounds like a potential jpegli issue. I'll contact the JPEG XL Discord to check if there are any known compatibility problems with libtiff. |
I have 2 set of images:
second set:
it is very weird. If I do
or
they both works and load and save the output images correctly. Than why in python code I am having this error? I am very confused. BTW, this test is on VIPS-8.17.0 that I build today. Thank you. |
What's the output of the following command?: $ python -c "import pyvips; print('.'.join(str(pyvips.version(i)) for i in range(3)))" |
8.17.0 |
Hi, I run in PowerShell a script to load each file and covert it using vips copy
than I run my python script on the new saved tiff files. This time I got a different error more detailed when I tried to use mosaic feature between 2 images. It indicates Wrong JPEG library version. I hope this can help. I tested also with V8.15.5 --with-jepgli and get the same error.
|
Ah, libjpeg(-turbo) and MozJPEG include safeguards to prevent version mismatches between the library and the caller. This ensures that the version used at runtime matches the version with which the library was originally built. IIRC, jpegli doesn't implement such checks, so this issue seems like a DLL conflict at runtime. You might want to check your system for duplicates of |
Hold on a moment. Do you see |
Commit 0f648d2 ensures that jpegli produces an output binary named $ ./build.sh web x86_64 static --with-jpegli |
hi @kleisauke, you are right, I do have I tried to rebuild it again but I got error building libheif:
I saw you updated this lib too. Do you think it is related to the update? Regards, |
That libheif build error ought to be fixed via commit 0f648d2. What's the output of the following command in the $ git rev-parse HEAD |
I tried to build it as shared, it works the build. No issue with libheif build. Only while I build it with static. But again it creates libjpeg.dll |
I believe I get the latest update now. I am building it again:
|
To save you some build time, I'm (temporarily) providing prebuilt static binaries with jpegli here: (these binaries were built from commit 0f648d2 using |
Thank you @kleisauke, I confirm that this patch works. No more But as any 8.16 version, it takes 3 times longer than 8.15 version (similar time to jpeg-turbo in 8.16) but this is another issue that has PR in libvips. Please feel free to close it. |
Great! I'll close this issue for now, please feel free to re-open if there's still a problem. Note that I couldn't reproduce the potential performance regression. It would be helpful if you could provide a minimal, (standalone) code sample that allows someone else to reproduce. |
Hi @jcupitt and @kleisauke,
I have a python script to stich images and save the final image into tiff using:
I build libvips V 8.15.2 with jepg-turbo and jpegli. For jpeg-turbo, the stichwork and the final image is generated with no issue. But if I use jpegli instead, I got an 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 tested V8.16, and the same issue occurred.
or
Assertion failed: sp->cinfo.comm.is_decompressor, file /var/tmp/tmp-tiff-x86_64-w64-mingw32.shared.web/tiff-4.7.0/libtiff/tif_jpeg.c, line 1089
Any idea what can cause the issue? looking into libtiff, I beleive the issue could be from the following lines:
libtiff.
The text was updated successfully, but these errors were encountered: