Skip to content

Conversation

@lgritz
Copy link
Collaborator

@lgritz lgritz commented Jul 25, 2025

Inside ImageInput::create(), there's a section where the created ImageInput tries to do a quick call to its valid_file() method to do an inexpensive check that the file appears to be the right file format corresponding to the ImageInput subclass. However, it always called the variety of valid_file() that takes a string filename, ignoring the fact that create() itself may have been passed an IOProxy, which should always take precedence over trying to open a real file.

lgritz added 2 commits July 25, 2025 16:10
Inside ImageInput::create(), there's a section where the created
ImageInput tries to do a quick call to its valid_file() method to do
an inexpensive check that the file appears to be the right file format
corresponding to the ImageInput subclass. However, it always called
the variety of valid_file() that takes a string filename, ignoring the
fact that create() itself may have been passed an IOProxy, which
should always take precedence over trying to open a real file.

Signed-off-by: Larry Gritz <[email protected]>
@lgritz
Copy link
Collaborator Author

lgritz commented Jul 30, 2025

Any comments on this?

@lgritz
Copy link
Collaborator Author

lgritz commented Jul 31, 2025

I will merge this shortly if there are no objections.

@lgritz
Copy link
Collaborator Author

lgritz commented Jul 31, 2025

I got a LGTM offline from somebody who tried it and confirmed the fix, but isn't allowed to comment publicly. So merging.

@lgritz lgritz merged commit a6cdf77 into AcademySoftwareFoundation:main Jul 31, 2025
30 checks passed
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Jul 31, 2025
…mySoftwareFoundation#4839)

Inside ImageInput::create(), there's a section where the created
ImageInput tries to do a quick call to its valid_file() method to do an
inexpensive check that the file appears to be the right file format
corresponding to the ImageInput subclass. However, it always called the
variety of valid_file() that takes a string filename, ignoring the fact
that create() itself may have been passed an IOProxy, which should
always take precedence over trying to open a real file.

---------

Signed-off-by: Larry Gritz <[email protected]>
@lgritz lgritz deleted the lg-ioproxy branch July 31, 2025 18:09
zachlewis pushed a commit to zachlewis/OpenImageIO that referenced this pull request Aug 1, 2025
…mySoftwareFoundation#4839)

Inside ImageInput::create(), there's a section where the created
ImageInput tries to do a quick call to its valid_file() method to do an
inexpensive check that the file appears to be the right file format
corresponding to the ImageInput subclass. However, it always called the
variety of valid_file() that takes a string filename, ignoring the fact
that create() itself may have been passed an IOProxy, which should
always take precedence over trying to open a real file.

---------

Signed-off-by: Larry Gritz <[email protected]>
@lgritz lgritz added bug Crash or wrong behavior of an existing feature. core APIs Affecting public APIs of core functionality classes, such as ImageInput, ImageOutput, ImageBuf. labels Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Crash or wrong behavior of an existing feature. core APIs Affecting public APIs of core functionality classes, such as ImageInput, ImageOutput, ImageBuf.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant