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

fix(exr): allow an empty "name" metadata to be read #4528

Merged
merged 1 commit into from
Nov 9, 2024

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented Nov 8, 2024

When the exr "name" metadata (used for the names of subimages/parts) existed but was the empty string, we were treating it like it didn't exist (and upon write substituted our own "subimageXY" name, as we are wont to do for unnamed parts). But now we've seen multi-part exrs where the name is "" (exists, but empty string) and we want a read-write cycle to preserve that. Even though it's not a very sensible or helpful part name, it's technically legal, so we should honor it.

When the exr "name" metadata (used for the names of subimages/parts)
existed but was the empty string, we were treating it like it didn't
exist (and upon write substituted our own "subimageXY" name, as we are
wont to do for unnamed parts). But now we've seen multi-part exrs
where the name is "" (exists, but empty string) and we want a
read-write cycle to preserve that. Even though it's not a very
sensible or helpful part name, it's technically legal, so we should
honor it.

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

lgritz commented Nov 8, 2024

@meimchu

@lgritz
Copy link
Collaborator Author

lgritz commented Nov 8, 2024

Does anybody object to this? In short, the change allows multi-part exr files to have a part whose name is the empty string "", which is technically allowed by OpenEXR itself. Our old behavior was to treat an empty string part name as if there was no name at all (in which case we substituted something else).

@lgritz
Copy link
Collaborator Author

lgritz commented Nov 8, 2024

N.B. I always say "does anybody object" but what I really mean is "somebody PLEASE review and approve (or critique) this, because it's bad open source practice to merge PRs with no approval by somebody who isn't the author of the patch and I don't want to do that except in cases of real emergencies."

lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Nov 9, 2024
…oundation#4528)

When the exr "name" metadata (used for the names of subimages/parts)
existed but was the empty string, we were treating it like it didn't
exist (and upon write substituted our own "subimageXY" name, as we are
wont to do for unnamed parts). But now we've seen multi-part exrs
where the name is "" (exists, but empty string) and we want a
read-write cycle to preserve that. Even though it's not a very
sensible or helpful part name, it's technically legal, so we should
honor it.

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

For what it's worth, in the OpenEXR subset documented in SMPTE's ACES Container (ST 2065-4:2023 ACES Image Container File Layout) zero-length attributes are everywhere -- unless we missed a spot -- disallowed. Point of information only. As for the change itself, LGTM

@lgritz lgritz merged commit 895f090 into AcademySoftwareFoundation:main Nov 9, 2024
28 checks passed
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Nov 9, 2024
…oundation#4528)

When the exr "name" metadata (used for the names of subimages/parts)
existed but was the empty string, we were treating it like it didn't
exist (and upon write substituted our own "subimageXY" name, as we are
wont to do for unnamed parts). But now we've seen multi-part exrs where
the name is "" (exists, but empty string) and we want a read-write cycle
to preserve that. Even though it's not a very sensible or helpful part
name, it's technically legal, so we should honor it.

Signed-off-by: Larry Gritz <[email protected]>
@lgritz lgritz deleted the lg-siname branch November 9, 2024 21:05
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Nov 12, 2024
Continuation of PR AcademySoftwareFoundation#4528. I forgot to change the spot in the
OpenEXR "core" API as well.
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Nov 12, 2024
Continuation of PR AcademySoftwareFoundation#4528. I forgot to change the spot in the
OpenEXR "core" API as well.
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Nov 12, 2024
Continuation of PR AcademySoftwareFoundation#4528. I forgot to change the spot in the
OpenEXR "core" API as well.

Signed-off-by: Larry Gritz <[email protected]>
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Nov 12, 2024
Continuation of PR AcademySoftwareFoundation#4528. I forgot to change the spot in the
OpenEXR "core" API as well.

Signed-off-by: Larry Gritz <[email protected]>
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Nov 12, 2024
…oundation#4536)

Continuation of PR AcademySoftwareFoundation#4528. I forgot to change the spot in the
OpenEXR "core" API as well.

Signed-off-by: Larry Gritz <[email protected]>
lgritz added a commit that referenced this pull request Nov 15, 2024
Continuation of PR #4528. I forgot to change the spot in the OpenEXR
"core" API as well.

Signed-off-by: Larry Gritz <[email protected]>
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Nov 15, 2024
…oundation#4536)

Continuation of PR AcademySoftwareFoundation#4528. I forgot to change the spot in the OpenEXR
"core" API as well.

Signed-off-by: Larry Gritz <[email protected]>
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.

2 participants