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

[imaging] make image extension case-insensitive #804

Conversation

pmolodo
Copy link
Contributor

@pmolodo pmolodo commented Mar 20, 2019

Description of Change(s)

so we can use, ie, .PNG, .TIF, etc
oiio already can handle this, and Glf_StbImage::_GetFilenameExtension() already converts to lowercase as well

Fixes Issue(s)

  • Loading of .PNG, .TIF, etc (ie, non-lower-case extensions)

so we can use, ie, .PNG, .TIF, etc
oiio already can handle this, and Glf_StbImage::_GetFilenameExtension()
already converts to lowercase as well
@@ -68,7 +68,8 @@ GlfImageRegistry::_ConstructImage(std::string const & filename)
static GlfImageSharedPtr NULL_IMAGE;

// Lookup the plug-in type name based on the filename.
TfToken fileExtension(ArGetResolver().GetExtension(filename));
TfToken fileExtension(
TfStringToLower(ArGetResolver().GetExtension(filename)));
Copy link

Choose a reason for hiding this comment

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

It would be better to not change the case when printing the unknown image type error message. You could put to tolower in the call to Find(), or you could change the error message to print the entire filename (which is what the Python version is doing).

@jilliene
Copy link

Filed as internal issue #USD-5169

@c64kernal
Copy link
Contributor

Thanks for the fix @elrond79 -- we merged this and it should land in dev soon after 20.02 is released. In order to address @spitzak's excellent point, I added some extra debug output that gives the exact name of the file before any filtering, so hopefully that should address the review feedback. Thank you both.

@pmolodo
Copy link
Contributor Author

pmolodo commented Jan 14, 2020

Great, thanks both!

pixar-oss added a commit that referenced this pull request Feb 1, 2020
…tive

[imaging] make image extension case-insensitive

(Internal change: 2034668)
@pixar-oss pixar-oss merged commit 131e93d into PixarAnimationStudios:dev Feb 1, 2020
AdamFelt pushed a commit to autodesk-forks/USD that referenced this pull request Apr 16, 2024
* remove hgi dependency from hio;
* update webgpu baselines.
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.

6 participants