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

Targa read fix for tga files with 0-sized thumbnails #2903

Merged
merged 1 commit into from
Mar 21, 2021

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented Mar 19, 2021

All of our prior tga tests had valid thumbnails. The code skipped the
thumbnail if the "offset to the thumbnail" was 0. But if the offset was
nonzero but the thumbnail record at that spot had a 0x0 size, we just
ran merrily along, and on Windows in debug mode even it an assert.

This patch makes it understand that a 0x0 thumbnail size means no
thumbnail.

I added an image from Doug Rogers, the reporter of the problem, to the
oiio-images repo in the targa directory, and updated the OIIO testsuite
to also check that image. (So testsuite will fail for people who don't
update their oiio-images repo.)

Also changed some stray refs to &vector[0] to vector.data().

Fixes #2900

All of our prior tga tests had valid thumbnails. The code skipped the
thumbnail if the "offset to the thumbnail" was 0. But if the offset was
nonzero but the thumbnail record at that spot had a 0x0 size, we just
ran merrily along, and on Windows in debug mode even it an assert.

This patch makes it understand that a 0x0 thumbnail size means no
thumbnail.

I added an image from Doug Rogers, the reporter of the problem, to the
oiio-images repo in the targa directory, and updated the OIIO testsuite
to also check that image. (So testsuite will fail for people who don't
update their oiio-images repo.)
@lgritz lgritz mentioned this pull request Mar 19, 2021
@lgritz lgritz merged commit eab20eb into AcademySoftwareFoundation:master Mar 21, 2021
@lgritz lgritz deleted the lg-targa branch March 21, 2021 04:24
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Mar 21, 2021
…Foundation#2903)

All of our prior tga tests had valid thumbnails. The code skipped the
thumbnail if the "offset to the thumbnail" was 0. But if the offset was
nonzero but the thumbnail record at that spot had a 0x0 size, we just
ran merrily along, and on Windows in debug mode even it an assert.

This patch makes it understand that a 0x0 thumbnail size means no
thumbnail.

I added an image from Doug Rogers, the reporter of the problem, to the
oiio-images repo in the targa directory, and updated the OIIO testsuite
to also check that image. (So testsuite will fail for people who don't
update their oiio-images repo.)

Also changed some stray refs to &vector[0] to vector.data().

Fixes AcademySoftwareFoundation#2900
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] Assert loading TGA
1 participant