Skip to content

Conversation

@lgritz
Copy link
Collaborator

@lgritz lgritz commented Feb 6, 2025

When you use frame or view wildcards, for example:

oiiotool foo.%04d.tif -o bar.%04d.exr

we noticed that if NO files matched, no iteration would occur. You would get this output:

$ oiiotool foo.%04d.tif -o bar.%04d.exr
oiiotool WARNING : oiiotool produced no output. Did you forget -o?

But maybe this is not helpful and it should be some kind of error to ask for a match and not get one? Or at least give a more clear explanation of what happened.

This PR detects the case where there is no match of the wildcard at all, warns about that, and then tries interpreting the command line literally (no wildcard expansion). So now the output is

$ oiiotool foo.%04d.tif -o bar.%04d.exr
oiiotool WARNING : No frame number or views matched the wildcards
oiiotool ERROR: read : File does not exist: "foo.%04d.tif"
Full command line was:
> oiiotool foo.%04d.tif -o bar.%04d.exr

Closes #4623

When you use frame or view wildcards, for example:

    oiiotool foo.%04d.tif -o bar.%04d.exr

we noticed that if NO files matched, no iteration would occur.
You would get this output:

```
$ oiiotool foo.%04d.tif -o bar.%04d.exr
oiiotool WARNING : oiiotool produced no output. Did you forget -o?
```

But maybe this is not helpful and it should be some kind of error
to ask for a match and not get one? Or at least give a more clear
explanation of what happened.

This PR detects the case where there is no match of the wildcard
at all, warns about that, and then tries interpreting the command
line literally (no wildcard expansion). So now the output is

```
$ oiiotool foo.%04d.tif -o bar.%04d.exr
oiiotool WARNING : No frame number or views matched the wildcards
oiiotool ERROR: read : File does not exist: "foo.%04d.tif"
Full command line was:
> oiiotool foo.%04d.tif -o bar.%04d.exr
```

Closes 4623

Signed-off-by: Larry Gritz <[email protected]>
Copy link
Contributor

@grdanny grdanny left a comment

Choose a reason for hiding this comment

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

that's a nice change, thank you for that!

@lgritz lgritz merged commit d5739a7 into AcademySoftwareFoundation:main Feb 6, 2025
28 checks passed
@lgritz lgritz added enhancement Improvement of existing/working features. oiiotool oiiotool labels Feb 6, 2025
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Feb 7, 2025
…ftwareFoundation#4627)

When you use frame or view wildcards, for example:

    oiiotool foo.%04d.tif -o bar.%04d.exr

we noticed that if NO files matched, no iteration would occur. You would
get this output:

```
$ oiiotool foo.%04d.tif -o bar.%04d.exr
oiiotool WARNING : oiiotool produced no output. Did you forget -o?
```

But maybe this is not helpful and it should be some kind of error to ask
for a match and not get one? Or at least give a more clear explanation
of what happened.

This PR detects the case where there is no match of the wildcard at all,
warns about that, and then tries interpreting the command line literally
(no wildcard expansion). So now the output is

```
$ oiiotool foo.%04d.tif -o bar.%04d.exr
oiiotool WARNING : No frame number or views matched the wildcards
oiiotool ERROR: read : File does not exist: "foo.%04d.tif"
Full command line was:
> oiiotool foo.%04d.tif -o bar.%04d.exr
```

Closes AcademySoftwareFoundation#4623

Signed-off-by: Larry Gritz <[email protected]>
@lgritz lgritz deleted the lg-frameerror branch February 8, 2025 19:50
scott-wilson pushed a commit to scott-wilson/OpenImageIO that referenced this pull request May 17, 2025
…ftwareFoundation#4627)

When you use frame or view wildcards, for example:

    oiiotool foo.%04d.tif -o bar.%04d.exr

we noticed that if NO files matched, no iteration would occur. You would
get this output:

```
$ oiiotool foo.%04d.tif -o bar.%04d.exr
oiiotool WARNING : oiiotool produced no output. Did you forget -o?
```

But maybe this is not helpful and it should be some kind of error to ask
for a match and not get one? Or at least give a more clear explanation
of what happened.

This PR detects the case where there is no match of the wildcard at all,
warns about that, and then tries interpreting the command line literally
(no wildcard expansion). So now the output is

```
$ oiiotool foo.%04d.tif -o bar.%04d.exr
oiiotool WARNING : No frame number or views matched the wildcards
oiiotool ERROR: read : File does not exist: "foo.%04d.tif"
Full command line was:
> oiiotool foo.%04d.tif -o bar.%04d.exr
```

Closes AcademySoftwareFoundation#4623

Signed-off-by: Larry Gritz <[email protected]>
Signed-off-by: Scott Wilson <[email protected]>
scott-wilson pushed a commit to scott-wilson/OpenImageIO that referenced this pull request May 18, 2025
…ftwareFoundation#4627)

When you use frame or view wildcards, for example:

    oiiotool foo.%04d.tif -o bar.%04d.exr

we noticed that if NO files matched, no iteration would occur. You would
get this output:

```
$ oiiotool foo.%04d.tif -o bar.%04d.exr
oiiotool WARNING : oiiotool produced no output. Did you forget -o?
```

But maybe this is not helpful and it should be some kind of error to ask
for a match and not get one? Or at least give a more clear explanation
of what happened.

This PR detects the case where there is no match of the wildcard at all,
warns about that, and then tries interpreting the command line literally
(no wildcard expansion). So now the output is

```
$ oiiotool foo.%04d.tif -o bar.%04d.exr
oiiotool WARNING : No frame number or views matched the wildcards
oiiotool ERROR: read : File does not exist: "foo.%04d.tif"
Full command line was:
> oiiotool foo.%04d.tif -o bar.%04d.exr
```

Closes AcademySoftwareFoundation#4623

Signed-off-by: Larry Gritz <[email protected]>
Signed-off-by: Scott Wilson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improvement of existing/working features. oiiotool oiiotool

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] oiiotool not returning correct error code for wildcard + missing file

2 participants