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

Only check REST arguments if the file does not exist #4085

Merged

Conversation

AdamMainsTL
Copy link
Contributor

Description

Fix for #4084. Will now check if the given filename exists before checking for REST parameters.

Tests

I did not look into test cases for this, but I ran the following command before and after the change:

Before:

bin % ./oiiotool \?.png -o \?-output.png
oiiotool ERROR: read : "?.png": ImageInput::create() called with malformed filename
Full command line was:
> oiiotool ?.png -o ?-output.png

After:

bin % ./oiiotool \?.png -o \?-output.png

No output, ?-output.png created.

Checklist:

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable.
  • I have ensured that the change is tested somewhere in the testsuite
    (adding new test cases if necessary).
  • If I added or modified a C++ API call, I have also amended the
    corresponding Python bindings (and if altering ImageBufAlgo functions, also
    exposed the new functionality as oiiotool options).
  • My code follows the prevailing code style of this project. If I haven't
    already run clang-format before submitting, I definitely will look at the CI
    test that runs clang-format and fix anything that it highlights as being
    nonconforming.

Copy link

linux-foundation-easycla bot commented Dec 21, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@lgritz
Copy link
Collaborator

lgritz commented Dec 21, 2023

The solution looks right to me!

Can you please amend to fix the DCO signoff? The easiest way would be

git commit --amend -s
(just save, you don't need to change anything, the -s adds the sign-off)
git push origin fix/imageinput-rest-check  --force

Signed-off-by: AdamMainsTL <adam.mains@topazlabs.com>
@AdamMainsTL
Copy link
Contributor Author

Should be done!

Copy link
Collaborator

@lgritz lgritz left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

And I will backport to the release branch for the Jan 1 patch release.

@lgritz lgritz merged commit f29d6c1 into AcademySoftwareFoundation:master Dec 22, 2023
25 checks passed
lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Dec 22, 2023
…twareFoundation#4085)

Fix for AcademySoftwareFoundation#4084. Will now check if the given filename exists before
checking for REST parameters.

Before:
```
bin % ./oiiotool \?.png -o \?-output.png
oiiotool ERROR: read : "?.png": ImageInput::create() called with malformed filename
Full command line was:
> oiiotool ?.png -o ?-output.png
```

After: 
```
bin % ./oiiotool \?.png -o \?-output.png
```
No output, `?-output.png` created.


Signed-off-by: AdamMainsTL <adam.mains@topazlabs.com>
@AdamMainsTL AdamMainsTL deleted the fix/imageinput-rest-check branch December 22, 2023 14:45
1div0 pushed a commit to 1div0/OpenImageIO that referenced this pull request Feb 24, 2024
…twareFoundation#4085)

Fix for AcademySoftwareFoundation#4084. Will now check if the given filename exists before
checking for REST parameters.

Before:
```
bin % ./oiiotool \?.png -o \?-output.png
oiiotool ERROR: read : "?.png": ImageInput::create() called with malformed filename
Full command line was:
> oiiotool ?.png -o ?-output.png
```

After:
```
bin % ./oiiotool \?.png -o \?-output.png
```
No output, `?-output.png` created.

Signed-off-by: AdamMainsTL <adam.mains@topazlabs.com>
Signed-off-by: Peter Kovář <peter.kovar@reflexion.tv>
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.

None yet

2 participants