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

BUG: Support compression and compressionargs in tifffile plugin #894

Merged
merged 7 commits into from
Oct 28, 2022

Conversation

FirefoxMetzger
Copy link
Contributor

Closes: #893

This PR adds a metadata kwarg to the LegacyPlugin, which allows passing metadata to a format's append_data function. It also adds support for the (not so) new kwargs compression and compressionargs which tifffile has introduced to manage compression. Among other things, these changes make it possible to use TIFF compression in the v3 API.

@FirefoxMetzger
Copy link
Contributor Author

@lagru @xkszltl If one of you has some spare time, feel free to check out this PR and see if it solves the compression issue on your end.

DeprecationWarning,
)

if _tifffile.__version__ < "2022":
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that mean there's no any version using compress?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. compress was used at some point to facilitate compression and while I didn't check the version of tifffile where this change happened, it has been deprecated for at least one year.

@@ -191,6 +191,8 @@
"resolution",
"description",
"compress",
"compression",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that all? Maybe we can add the entire set of new args they currently have?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could; although we would also have to also document those new kwargs. I would much rather spend that time on writing a v3 plugin for tifffile. That would also solve the problem of reoccurring maintenance costs for keeping the plugin in sync.

Speaking off documentation, I just noticed that I forgot to add documentation for compression and compressionargs ... will do :)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO undocumented feature is still better than not working, so if I'm doing it I would probably just copy-paste their arg list here. But anyway, my issue is resolved so will let someone else to worry about the rest.

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.

Saving TIFF files with v3 API and using the compression keyword results in unexpected argument
2 participants