AcademySoftwareFoundation / AcademySoftwareFoundation/OpenImageIO

[BUG] soft invalidation does not work for jpgs when autotile=0

Open
#3,286 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.4k
Forks
698
Avg merge
3d 9h
Merged PRs (30d)
48

Description

**Describe the bug**
Every time I do a soft invalidation on a jpg and with autotile=0, OIIO will detect the file as needing invalidation. This hurts performance. If nothing is changing, I don't expect it to be invalidated.

Here's some debug output to show it in action:
```c++
// printfs I added report the following. Since they got printed out, it also shows an invalidation occurred.
// level.spec.tile_width = 1000
// level.spec.tile_height = 1000
// m_autotile = 0

// Invalidate if any untiled subimage doesn't match the current
// auto-tile setting.
if (sub.untiled) {
for (int m = 0, mend = f->miplevels(s); m < mend; ++m) {
const ImageCacheFile::LevelInfo& level(f->levelinfo(s, m));
if (level.spec.tile_width != m_autotile
|| level.spec.tile_height != m_autotile) {
printf("level.spec.tile_width = %d\n", level.spec.tile_width);
printf("level.spec.tile_height = %d\n", level.spec.tile_height);
printf("m_autotile = %d\n", m_autotile);
all_files.push_back(name);
break;
}
}
}
```

**To Reproduce**
Steps to reproduce the behavior:
I suspect any jpg or other untiled/unmipped image that you call soft invalidate on will do this.

**Expected behavior**
don't invalidate if nothing changed.

**Evidence**
See above.

**Platform information:**
- OIIO branch/version: Master, maybe a week or so old, though there are some custom changes, but I don't think they are related.

Contributor guide

Open the contributing guide

Research direction

Start from the soft-invalidation logic shown in the issue, especially the untiled subimage check comparing level tile dimensions with autotile=0. Reproduce with a JPG or other untiled/unmipped image, then verify that unchanged files are not reported as needing invalidation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.