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

Issue1069 check for model/gltf.binary content type and accept #1075

Merged
merged 13 commits into from
Nov 27, 2021
Merged

Issue1069 check for model/gltf.binary content type and accept #1075

merged 13 commits into from
Nov 27, 2021

Conversation

tomjebo
Copy link
Collaborator

@tomjebo tomjebo commented Nov 19, 2021

This fix checks to see if the part content type is "model/gltf.binary" and the expected part is "model/gltf-binary". If so, then the SDK accepts the part as is. Both will be consumed but the SDK will continue to write out "model/gltf-binary" as this is the current standard and is accepted by PowerPoint.

@tomjebo
Copy link
Collaborator Author

tomjebo commented Nov 19, 2021

Fixes #1069

@sergey-tihon
Copy link

@tomjebo would be nice to have test for this case in the repo ;)

I build SDK from this branch and confirm that it works on my files.

@twsouthwick
Copy link
Member

Don't forget to update the changelog

@tomjebo tomjebo requested a review from twsouthwick November 23, 2021 21:59
@twsouthwick
Copy link
Member

Can you add a test for this?

Copy link
Member

@twsouthwick twsouthwick left a comment

Choose a reason for hiding this comment

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

Not sure the current override will do what you're expecting. It would be great to have a test for this.

twsouthwick
twsouthwick previously approved these changes Nov 24, 2021
Copy link
Member

@twsouthwick twsouthwick left a comment

Choose a reason for hiding this comment

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

A couple comments, but do with them as you want. Once you've addressed the warnings, feel free to merge!

Assert.NotNull(presDoc);
}

using (var testFile = GetStream(TestFiles._3DTestDot, false))
Copy link
Member

Choose a reason for hiding this comment

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

Can these be separate tests? Also, it would nice to assert on the content type of the package

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@twsouthwick not sure what you mean by "content type of the package". Do you mean assert on the model/gltf-binary content type (the part) or do you mean something else? The test is pretty much about validating the model/gltf(-|.)binary content type so I don't know why it should explicitly assert this. Maybe you mean assert that the glb part is not something else?

Copy link
Member

Choose a reason for hiding this comment

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

Because then when you look at the test, you know that is what you're testing here. In a year, or 5 years, you may not remember exactly what the test is supposed to be doing

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

what i meant was, there is no content type of the package. do you mean assert on the content type of the .glb part? If so, I can probably add code to find the part and check that it's either model/gltf-binary or model/gltf.binary. But we say that in the comments and the code will assert that naturally.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

But I can see what you mean. It's not clear what the test is actually looking for other than a clean open with a non-null package object. I'll add some code to look for the part and see if it's one of the two.

Copy link
Collaborator Author

@tomjebo tomjebo Nov 25, 2021

Choose a reason for hiding this comment

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

Actually, it will have to be model/gltf-binary. The part class (Model3DReferenceRelationshipPart) will always show as model/gltf-binary internally and will write this (when a new one is created). But will just look the other way when loading model/glft.binary. I added the assert for it.

@tomjebo tomjebo merged commit 7dfeb00 into dotnet:main Nov 27, 2021
@tomjebo tomjebo deleted the issue1069 branch June 15, 2022 21:08
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