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
Multipage TIFF operations broken #5640
Comments
Hi. If I run your code with one of our test images, it works. Would you be able to upload the image that you're having trouble with? |
Yes - please see below. As GitHub doesn't support adding .tif files directly, I put it in a .zip archive. |
I'm not able to reproduce this locally on my macOS machine. I guess this may be an issue specific to Windows/Anaconda. |
Are you using libtiff + Pillow from defaults or conda-forge channels? Works for me w/ conda-forge packages on Windows (Python 3.7.10 environment though) which are using Unix I/O, but also in mingw64 (3.9.6) which are using Win32 I/O. If it only fails w/ Anaconda defaults packages, it would indicate that most likely their libtiff and Pillow packages are now out of sync wrt the I/O scheme... This was indeed introduced in 8.2.0. |
Hi, I'm using libtiff + Pillow from the default channel (as that comes with the default Anaconda installation). Libtiff is version 4.2.0, which works fine with Pillow 8.1.2 but not with Pillow >= 8.2.0. |
This is a bug for Anaconda packaging then, you can try reporting there. Please try creating a test environment using the conda-forge channel and confirm it is working. |
If I switch only libtiff to conda-forge (which upgrades it to 4.3.0 from 4.2.0) it still isn't working. If both Pillow and libtiff are installed from conda-forge, it is working (which seems surprising as pillow is the same version in both repositories). I can't seem to create an environment where only Pillow is from conda-forge but libtiff is from default... |
Yes, because libtiff I/O scheme between default and conda-forge is now identical (Unix I/O) - this wasn't the case some time ago when default libtiff was using Win32 I/O (libtiff <= 4.1.0 or 4.0.10 I think)
This is not surprising because each repository might add its own specific patches to the package according to their internal policies (security critical fix, important feature bugfix until next version is released, compatibility fixes w/ other packages in that repository, enabled features, platform specifics, etc.) so they will likely differ in some subtle way even though the version is "the same". This is the case here, conda-forge disables Pillow's Win32 I/O by a patch to match their own libtiff package, while Anaconda default obviously does not, and the bug is within their repository. See also https://conda-forge.org/docs/user/tipsandtricks.html#using-multiple-channels |
I see, thanks. I'll try to report it there... Specifically, what would be needed on their side? To change the recipe for Pillow on the default channel so that it matches the conda-forge channel? |
Specifically, to keep libtiff and Pillow in sync wrt to I/O scheme. How they do that is up to them. |
@juhaszp95 Thanks for passing on the bug report! |
@juhaszp95 we've established that if you use conda-forge, the latest Pillow works for you. Unless there's anything further, do you mind if we close this and leave the problem as ContinuumIO/anaconda-issues#12546? |
No, not at all, I think that's right. I haven't managed to trigger a reponse from them so far, but at least conda-forge is an interim solution. Thanks for the help! |
What did you do?
What did you expect to happen?
image.tif is a 25-page TIFF file. I expected that this would save the 25 pages separately as png files. Up until Pillow 8.1.2 this works correctly, but beginning with Pillow 8.2.0 (I'm currently using 8.3.1) this seems to just break Python. Not just save, but many other operations (e.g. getpixel) also seem to produce the same issue.
What actually happened?
What are your OS, Python and Pillow versions?
OS: Windows 10
Python: 3.8.10 (as part of a standard Anaconda installation)
Pillow: 8.3.1 (as part of a standard Anaconda installation)
The text was updated successfully, but these errors were encountered: