Skip to content

Conversation

@mkitti
Copy link

@mkitti mkitti commented Aug 29, 2024

Currently, TiffImages.jl uses Inflate.jl to decompress TIFF files that use deflate decompression.

This pull request creates a package extension CodecZlibExt that will use CodecZlib for delfate
decompression if it is already loaded.

This PR uses a Ref that can be modified via TiffImages.set_zlib_decompression_stream!.
That function is invoked the init function of the extension.

The main reason for wanting to use CodecZlib.jl is that it is much faster than Inflate.jl
for decompression.

@KristofferC
Copy link

KristofferC commented Aug 29, 2024

This seems like a bit unusual use case for an extension. Why not just change fully to CodecZlib if it is better?

One issue in my opinion with using an extension is that the default will change if any transitive dependency happen to load CodecZlib so you can get kind of spooky action at a distance from this.

@mkitti
Copy link
Author

mkitti commented Aug 29, 2024

@KristofferC, part of the idea of TiffImages.jl is that it has very few non-Julia dependencies. I would like to respect that choice while providing the option.

After sleeping on this, I think introducing Preferences.jl to select the Zlib backend may make more sense rather than the mechanism I initially wrote here.

@tlnagy
Copy link
Owner

tlnagy commented Oct 10, 2024

@KristofferC, part of the idea of TiffImages.jl is that it has very few non-Julia dependencies. I would like to respect that choice while providing the option.

This is correct. A full Julia (or as close as we can get) stack gives us a lot more maintainable and flexible code. I appreciate @mkitti's focus on this.

Is this PR still alive or should I go ahead and close?

@mkitti
Copy link
Author

mkitti commented Oct 11, 2024

We need to resolve Julia compat bounds, but yes this is very much alive.

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

Successfully merging this pull request may close these issues.

3 participants