-
Notifications
You must be signed in to change notification settings - Fork 644
Add zstd as a compression option for the OpenEXR plugin in OIIO #4852
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
base: main
Are you sure you want to change the base?
Add zstd as a compression option for the OpenEXR plugin in OIIO #4852
Conversation
Signed-off-by: Todica Ionut <[email protected]>
Signed-off-by: Todica Ionut <[email protected]>
Signed-off-by: Todica Ionut <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beyond adding this to the documentation, adding a test would be good. See testsuite/openexr-compression/ for someplace that's easy to extend with zstd as a first step.
[edit] Though I don't immediately know a good pattern off-hand to use in the tests for when we need to restrict the test to only certain versions of openexr. Maybe someone else will chime in before I investigate that further tomorrow.
src/openexr.imageio/exroutput.cpp
Outdated
| // that 5 is a great tradeoff between size and speed, so that is our | ||
| // default. | ||
| if (Strutil::istarts_with(comp, "zstd")) { | ||
| header.zstdCompressionLevel() = (qual >= 1 && qual <= 22) ? qual : 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be important to document these values, and zstd in general, in the src/doc/builtinplugins.rst file under the OpenEXR section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the patch.
Would you prefer to add documentation for zstd to builtinplugins.rst as part of this PR before I merge it? Or follow up with a second PR (right away, please), or do you want me to add that myself?
|
Jesse makes a good point about the testing. I'm also not 100% sure how to best test openexr features that are only in some versions. And now that you mention it, I'm not sure we comprehensively test all the existing compression methods. This isn't necessarily making the situation any worse in practice, so I don't insist on fully solving that before merging this PR. But it would be good to shore up the testing in this regard. Also, and maybe this is longer term, but we conspicuously lack a way for an app to ask through the API what compression methods are supported by any given format. |
Signed-off-by: Todica Ionut <[email protected]>
Signed-off-by: Todica Ionut <[email protected]>
|
openexr's features |
|
Oh, wait, I just noticed that this PR is just a draft, and also that zstd support has not yet been merged into OpenEXR. |
|
Just noticed this. Zstd support is still WIP: I just got back to it yesterday.CheersPhilippe LeprinceSent from a tiny deviceOn 8 Aug 2025, at 19:11, Larry Gritz ***@***.***> wrote:lgritz left a comment (AcademySoftwareFoundation/OpenImageIO#4852)
Oh, wait, I just noticed that this PR is just a draft, and also that zstd support has not yet been merged into OpenEXR.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a real change request, I'm just removing approval so I don't accidentally merge it without remembering that it's still a draft and that it assumes a feature not yet in OpenEXR. The code still seems fine for what it does.
|
What should we do about this PR? The thing it's addressing isn't a feature in OpenEXR yet. |
Description
After adding the new
zstdcompression codec to OpenEXR, here we enable it in the OIIO stack so it will be recognized by the library and binary tools, such as using oiiotool to directly change compression type into zstd.add support
zstda new compression (AcademySoftwareFoundation/openexr#1604)I'm also trying to study if more changes on the OIIO side is required to enabled the new
zstdcodec throughout the OIIO tool chain... suggestions welcome.Checklist:
need to update the documentation, for example if this is a bug fix that
doesn't change the API.)
(adding new test cases if necessary).
corresponding Python bindings (and if altering ImageBufAlgo functions, also
exposed the new functionality as oiiotool options).
already run clang-format before submitting, I definitely will look at the CI
test that runs clang-format and fix anything that it highlights as being
nonconforming.