Skip to content

oiiotool: -i:native=1, fix --native behavior, fix convert datatype #4708

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

Merged
merged 1 commit into from
May 9, 2025

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented Apr 24, 2025

A constellation of closely related fixes and additions related to oiiotool -i behavior:

  • When using -i:now=1 to force for immediate read rather than using an ImageCache, it would "forget" any prior setting of --native. This is fixed now to correctly combine desire for bypassing the cache with hinting to maintain native data type.

  • When restricting channel subset with -i:ch=..., use of the --native flag was incorrect in some cases -- it would use the overall best single data format of all channels, rather than restricting that to the selected channel range. So, for example, if you said -i:ch=R,G,B,A and those channels were all half, but channel 17 (not selected) was float, you would get a conversion to float rather than keeping the selected channels at their native half. The solution here is that the type chosen for --native behavior should only consider the selected channel subset, not all channels.

  • Add a new -i modifier: :native=1, allowing you to select the "native" behavior on a per-input-file basis (the existing --native command sets the default).

A constellation of closely related fixes and additions related to
oiiotool `-i` behavior:

* When using `-i:now=1` to force for immediate read rather than using
  an ImageCache, it would "forget" any prior setting of `--native`.
  This is fixed now to correctly combine desire for bypassing the
  cache with hinting to maintain native data type.

* When restricting channel subset with `-i:ch=...`, use of the
  `--native` flag was incorrect in some cases -- it would use the
  overall best single data format of all channels, rather than
  restricting that to the selected channel range. So, for example, if
  you said `-i:ch=R,G,B,A` and those channels were all `half`, but
  channel 17 (not selected) was `float`, you would get a conversion to
  float rather than keeping the selected channels at their native
  half. The solution here is that the type chosen for `--native`
  behavior should only consider the selected channel subset, not all
  channels.

* Add a new `-i` modifier: `:native=1`, allowing you to select the
  "native" behavior on a per-input-file basis (the existing `--native`
  command sets the default).

Signed-off-by: Larry Gritz <[email protected]>
@lgritz lgritz added the oiiotool oiiotool label Apr 30, 2025
@lgritz
Copy link
Collaborator Author

lgritz commented May 1, 2025

Any comments? This has been posted for a week now.

@lgritz
Copy link
Collaborator Author

lgritz commented May 9, 2025

Over 2 weeks in review, no objections -> merging

@lgritz lgritz merged commit 36f7c15 into AcademySoftwareFoundation:main May 9, 2025
28 checks passed
@lgritz lgritz deleted the lg-native branch May 9, 2025 16:19
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request May 9, 2025
…cademySoftwareFoundation#4708)

A constellation of closely related fixes and additions related to
oiiotool `-i` behavior:

* When using `-i:now=1` to force for immediate read rather than using an
ImageCache, it would "forget" any prior setting of `--native`. This is
fixed now to correctly combine desire for bypassing the cache with
hinting to maintain native data type.

* When restricting channel subset with `-i:ch=...`, use of the
`--native` flag was incorrect in some cases -- it would use the overall
best single data format of all channels, rather than restricting that to
the selected channel range. So, for example, if you said `-i:ch=R,G,B,A`
and those channels were all `half`, but channel 17 (not selected) was
`float`, you would get a conversion to float rather than keeping the
selected channels at their native half. The solution here is that the
type chosen for `--native` behavior should only consider the selected
channel subset, not all channels.

* Add a new `-i` modifier: `:native=1`, allowing you to select the
"native" behavior on a per-input-file basis (the existing `--native`
command sets the default).

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

A constellation of closely related fixes and additions related to
oiiotool `-i` behavior:

* When using `-i:now=1` to force for immediate read rather than using an
ImageCache, it would "forget" any prior setting of `--native`. This is
fixed now to correctly combine desire for bypassing the cache with
hinting to maintain native data type.

* When restricting channel subset with `-i:ch=...`, use of the
`--native` flag was incorrect in some cases -- it would use the overall
best single data format of all channels, rather than restricting that to
the selected channel range. So, for example, if you said `-i:ch=R,G,B,A`
and those channels were all `half`, but channel 17 (not selected) was
`float`, you would get a conversion to float rather than keeping the
selected channels at their native half. The solution here is that the
type chosen for `--native` behavior should only consider the selected
channel subset, not all channels.

* Add a new `-i` modifier: `:native=1`, allowing you to select the
"native" behavior on a per-input-file basis (the existing `--native`
command sets the default).

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
…cademySoftwareFoundation#4708)

A constellation of closely related fixes and additions related to
oiiotool `-i` behavior:

* When using `-i:now=1` to force for immediate read rather than using an
ImageCache, it would "forget" any prior setting of `--native`. This is
fixed now to correctly combine desire for bypassing the cache with
hinting to maintain native data type.

* When restricting channel subset with `-i:ch=...`, use of the
`--native` flag was incorrect in some cases -- it would use the overall
best single data format of all channels, rather than restricting that to
the selected channel range. So, for example, if you said `-i:ch=R,G,B,A`
and those channels were all `half`, but channel 17 (not selected) was
`float`, you would get a conversion to float rather than keeping the
selected channels at their native half. The solution here is that the
type chosen for `--native` behavior should only consider the selected
channel subset, not all channels.

* Add a new `-i` modifier: `:native=1`, allowing you to select the
"native" behavior on a per-input-file basis (the existing `--native`
command sets the default).

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
oiiotool oiiotool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant