Repository navigation
fix(xml): handle rational types in ImageSpec roundtrip - #5581
Open
ayushactiveat wants to merge 1 commit into
Open
ayushactiveat wants to merge 1 commit into
ayushactiveat wants to merge 1 commit into
Conversation
|
|
ayushactiveat
force-pushed
the
fix/xml-rational-roundtrip
branch
from
October 18, 2026 20:29
3cf27a4 to
8ca7943
Compare
Collaborator
|
OK, I understand the fix about how rationals were written to XML as "N / D" when they should have been "N, D". But what's rational2f about and why is it needed? |
Author
|
hi @lgritz , added rational2f because TypeDesc::c_str() can give that string for float based rationals, so just wanted the parser to handle everything the writer produces. if you like to keep focus only on the original issue for now, i can remove it, let me know |
Fixes AcademySoftwareFoundation#5571. 1) TypeDesc::fromstring() now recognizes 'rational2i' and 'rational2f'. 2) ParamValue parsing now replaces the '/' in rational XML values with ',' so the numbers load correctly. Added tests for both. Signed-off-by: Ayush Singh <ayushactiveat@gmail.com>
ayushactiveat
force-pushed
the
fix/xml-rational-roundtrip
branch
from
October 19, 2026 08:11
8ca7943 to
c5c710b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5571.
Description
Fixes two issues preventing rational types (like FramesPerSecond) from surviving an XML round-trip:
TypeDesc::fromstring()didn't recognizerational2iorrational2f. Added these mappings totypedesc.cpp.30000/1001(with a slash), but the parser expected commas. Added logic inparamlist.cppto handle the slash.Tests
Added tests in
typedesc_test.cppfor string parsing, andimagespec_test.cppfor the full XML round-trip. Both now verify that the type and the float value (29.97) surviveto_xml()andfrom_xml().Assisted-by: ByteAsk / GPT-5.4
Checklist:
Assisted-byline above.