Skip to content

fix(oiiotool): Fix expression BOTTOM when there are exactly two images - #5046

Merged
lgritz merged 1 commit into
AcademySoftwareFoundation:mainfrom
lgritz:lg-bottom
Feb 19, 2026
Merged

fix(oiiotool): Fix expression BOTTOM when there are exactly two images#5046
lgritz merged 1 commit into
AcademySoftwareFoundation:mainfrom
lgritz:lg-bottom

Conversation

@lgritz

@lgritz lgritz commented Feb 12, 2026

Copy link
Copy Markdown
Collaborator

Fixes #5044

Oops, the logic was a little mixed up when there were exactly two images. One reason that this was a special case is that conceptually, there is just a stack, but the implementation is that there is a separate variable for the top item, and then the actual stack is all the other items.

Also add more thorough testing of TOP/BOTTOM, including what happens for 2, 1, and also 0 items on the image stack (errors in that last case).

Fixes 5044

Oops, the logic was a little mixed up when there were exactly two
images. One reason that this was a special case is that conceptually,
there is just a stack, but the implementation is that there is a
separate variable for the top item, and then the actual stack is all
the other items.

Also add more thorough testing of TOP/BOTTOM, including what happens for
2, 1, and also 0 items on the image stack (errors in that last case).

Signed-off-by: Larry Gritz <lg@larrygritz.com>
@lgritz lgritz changed the title fix(oiiotool): Fix expression BOTTOM vs TOP when there are two images fix(oiiotool): Fix expression BOTTOM when there are exactly two images Feb 12, 2026
@lgritz

lgritz commented Feb 19, 2026

Copy link
Copy Markdown
Collaborator Author

@rasmusbonnedal, is your thumb an approval of this PR? Have you verified that it solves your problem?

This has been up for a week without comment. I will merge if nobody objects today.

@rasmusbonnedal

Copy link
Copy Markdown

@lgritz Sorry for being so slow. Yes! It fixed it for me!

@rasmusbonnedal rasmusbonnedal left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM!

@lgritz
lgritz merged commit 2486b66 into AcademySoftwareFoundation:main Feb 19, 2026
30 checks passed
@lgritz
lgritz deleted the lg-bottom branch February 19, 2026 18:44
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Feb 19, 2026
AcademySoftwareFoundation#5046)

Fixes AcademySoftwareFoundation#5044

Oops, the logic was a little mixed up when there were exactly two
images. One reason that this was a special case is that conceptually,
there is just a stack, but the implementation is that there is a
separate variable for the top item, and then the actual stack is all the
other items.

Also add more thorough testing of TOP/BOTTOM, including what happens for
2, 1, and also 0 items on the image stack (errors in that last case).

Signed-off-by: Larry Gritz <lg@larrygritz.com>
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Feb 19, 2026
AcademySoftwareFoundation#5046)

Fixes AcademySoftwareFoundation#5044

Oops, the logic was a little mixed up when there were exactly two
images. One reason that this was a special case is that conceptually,
there is just a stack, but the implementation is that there is a
separate variable for the top item, and then the actual stack is all the
other items.

Also add more thorough testing of TOP/BOTTOM, including what happens for
2, 1, and also 0 items on the image stack (errors in that last case).

Signed-off-by: Larry Gritz <lg@larrygritz.com>
ssh4net pushed a commit to ssh4net/OpenImageIO that referenced this pull request Feb 24, 2026
AcademySoftwareFoundation#5046)

Fixes AcademySoftwareFoundation#5044

Oops, the logic was a little mixed up when there were exactly two
images. One reason that this was a special case is that conceptually,
there is just a stack, but the implementation is that there is a
separate variable for the top item, and then the actual stack is all the
other items.

Also add more thorough testing of TOP/BOTTOM, including what happens for
2, 1, and also 0 items on the image stack (errors in that last case).

Signed-off-by: Larry Gritz <lg@larrygritz.com>
Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com>
ssh4net pushed a commit to ssh4net/OpenImageIO that referenced this pull request Apr 1, 2026
AcademySoftwareFoundation#5046)

Fixes AcademySoftwareFoundation#5044

Oops, the logic was a little mixed up when there were exactly two
images. One reason that this was a special case is that conceptually,
there is just a stack, but the implementation is that there is a
separate variable for the top item, and then the actual stack is all the
other items.

Also add more thorough testing of TOP/BOTTOM, including what happens for
2, 1, and also 0 items on the image stack (errors in that last case).

Signed-off-by: Larry Gritz <lg@larrygritz.com>
Signed-off-by: Vlad <shaamaan@gmail.com>
ssh4net pushed a commit to ssh4net/OpenImageIO that referenced this pull request Apr 2, 2026
AcademySoftwareFoundation#5046)

Fixes AcademySoftwareFoundation#5044

Oops, the logic was a little mixed up when there were exactly two
images. One reason that this was a special case is that conceptually,
there is just a stack, but the implementation is that there is a
separate variable for the top item, and then the actual stack is all the
other items.

Also add more thorough testing of TOP/BOTTOM, including what happens for
2, 1, and also 0 items on the image stack (errors in that last case).

Signed-off-by: Larry Gritz <lg@larrygritz.com>
Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com>
ssh4net pushed a commit to ssh4net/OpenImageIO that referenced this pull request Apr 2, 2026
AcademySoftwareFoundation#5046)

Fixes AcademySoftwareFoundation#5044

Oops, the logic was a little mixed up when there were exactly two
images. One reason that this was a special case is that conceptually,
there is just a stack, but the implementation is that there is a
separate variable for the top item, and then the actual stack is all the
other items.

Also add more thorough testing of TOP/BOTTOM, including what happens for
2, 1, and also 0 items on the image stack (errors in that last case).

Signed-off-by: Larry Gritz <lg@larrygritz.com>
Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com>
ssh4net pushed a commit to ssh4net/OpenImageIO that referenced this pull request Apr 2, 2026
AcademySoftwareFoundation#5046)

Fixes AcademySoftwareFoundation#5044

Oops, the logic was a little mixed up when there were exactly two
images. One reason that this was a special case is that conceptually,
there is just a stack, but the implementation is that there is a
separate variable for the top item, and then the actual stack is all the
other items.

Also add more thorough testing of TOP/BOTTOM, including what happens for
2, 1, and also 0 items on the image stack (errors in that last case).

Signed-off-by: Larry Gritz <lg@larrygritz.com>
Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com>
Signed-off-by: Vlad <shaamaan@gmail.com>
ssh4net pushed a commit to ssh4net/OpenImageIO that referenced this pull request Apr 2, 2026
AcademySoftwareFoundation#5046)

Fixes AcademySoftwareFoundation#5044

Oops, the logic was a little mixed up when there were exactly two
images. One reason that this was a special case is that conceptually,
there is just a stack, but the implementation is that there is a
separate variable for the top item, and then the actual stack is all the
other items.

Also add more thorough testing of TOP/BOTTOM, including what happens for
2, 1, and also 0 items on the image stack (errors in that last case).

Signed-off-by: Larry Gritz <lg@larrygritz.com>
Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com>
Signed-off-by: Vlad <shaamaan@gmail.com>
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.

bug: (oiiotool) BOTTOM refers to TOP when NIMAGES == 2

2 participants