-
Notifications
You must be signed in to change notification settings - Fork 622
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
Remove some dead code when writing #1592
Conversation
the version is set to 2 above, so it is impossible to take the first branch. Signed-off-by: Dave Sawyer <[email protected]>
Just to make sure I understand here... this code is specific to DWA compression, which is only a file version 2 feature, so that's why we can eliminate all the "version 1" clauses? |
@lgritz it's not the version of OpenEXR library, or the general file format version. It's related to #119, where the internal DWA structure was changed and a version field bumped. The uncompress code supports the old DWAv1 compression format, but the unreachable code to write version 1 seems unnecessary. If anyone needed to write a DWAv1 file they could still change one line in the C++ library and use that. |
Oh, maybe I didn't grep outside of the OpenEXRCore folder. |
@lgritz This is purely localized reasoning. The code is unreachable because the conditional is a constant value. |
@kingsawyer Yes, but the subtext of my question was "are we satisfied that the assignment of that constant is not itself a bug." |
@meshula Can you please reconsider your request as it would break v1 support? |
@meshula Hello Nick? |
Ah, I should have marked the question as resolved, since it was answered in the following discussion. @lgritz @peterhillman Any further comment? |
Fine with me. My understanding is that this code only comes into play with DWA compression, and therefore MUST be a v2 file. |
Well, it's v2 of DWA, not the OpenEXR file version, so the modification to the comment is rather misleading. I'm fine with this too, but I would suggest leaving a comment in the code stating that DWAv1 set |
Signed-off-by: Dave Sawyer <[email protected]>
Updated to say DWA v2, but I don't think current code should talk much or at all about how obsolete code worked (or didn't). Easy enough to go back in the file history to see what it did. The vast majority will not care about implementation details of bygone days. |
Thanks for contributing the original PR and for this update. That's a clearer comment now. An extra few words in that comment block noting how to generate DWAv1 would be useful because the code still supports decompressing DWAv1 files, which means it's not quite obsolete. It may be confusing that the compressor has no trace of how to generate a file that would trigger the v1 branch in the decompressor. The full history of DWA compression isn't in this file, it's in ImfDwaCompressor.cpp (which I'd forgotten might be removed later), so |
Updated the check-in comment to point to ImfDwaCompressor.cpp for history. That should be a good third path to finding the deleted code in case people don't want to look at the read code or sync the repo to an older hash. I don't think it's confusing that we write the latest format and read any of the old formats. It's how most any file format read/write works that wants to support backwards compatibility. |
I think that's good, thanks |
The file version is set to 2 above for writing files (it is impossible write version 1 data). Please refer to the history of history of ImfDwaCompressor.cpp or look at the reading code for details on the version 1 format. Signed-off-by: Dave Sawyer <[email protected]>
The file version is set to 2 above for writing files (it is impossible write version 1 data). Please refer to the history of history of ImfDwaCompressor.cpp or look at the reading code for details on the version 1 format. Signed-off-by: Dave Sawyer <[email protected]>
The file version is set to 2 above for writing files, so it is impossible to take the first branch and write version 1 style. If people are interested in how older versions wrote they can look in history of ImfDwaCompressor.cpp or look at the read code.